-
Notifications
You must be signed in to change notification settings - Fork 166
Add IntegrationAuthorization service and controller
#1793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IntegrationAuthorization service and controller
#1793
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for integration authorization by introducing a new IntegrationAuthorization service and controller. The implementation enables users to generate long-lived tokens for third-party integrations like Slack Bot.
Key changes:
- Added
IntegrationNameenum and updated the schema to use it instead of a generic string - Implemented
TokenGeneratorPrincipaltype and correspondingTOKEN_GENERATORprincipal type for integration tokens - Created service layer and REST endpoint for generating and storing integration authorization tokens
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/lib/integration-authorization/integration-authorization.ts | Added IntegrationName enum and updated schema to use enum instead of string |
| packages/shared/src/lib/authentication/model/principal.ts | Added TokenGeneratorPrincipal type for integration authorization |
| packages/shared/src/lib/authentication/model/principal-type.ts | Added TOKEN_GENERATOR principal type |
| packages/server/api/test/unit/integration-authorization/integration-authorization.service.test.ts | Added unit tests for integration authorization service |
| packages/server/api/src/app/integration-authorization/integration-authorization.service.ts | Implemented service for creating integration authorizations |
| packages/server/api/src/app/integration-authorization/integration-authorization.module.ts | Created module to register the controller |
| packages/server/api/src/app/integration-authorization/integration-authorization.controller.ts | Implemented REST endpoint for integration authorization |
| packages/server/api/src/app/authentication/context/access-token-manager.ts | Added method to generate token generator tokens with 3-month expiration |
| packages/server/api/src/app/app.ts | Registered the integration authorization module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/server/api/src/app/integration-authorization/integration-authorization.controller.ts
Outdated
Show resolved
Hide resolved
packages/server/api/src/app/authentication/context/access-token-manager.ts
Show resolved
Hide resolved
…authorization-controller # Conflicts: # packages/shared/src/lib/integration-authorization/integration-authorization.ts
…ice, controller, tests, and database logic accordingly.
…ler updates for client-specific handling
…lidation in `refreshTokenService`
…authorization-controller
…edRefreshToken` type and enhance token handling logic
|



Fixes OPS-2987.