-
Notifications
You must be signed in to change notification settings - Fork 69
feat: implement SSO support for Google Workspace (fixes #413) #416
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
base: main
Are you sure you want to change the base?
Conversation
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
The PR title indicates that this PR fixes issue #413, but the PR description (body) is empty. The rule requires the closing statement (e.g., "Fixes #413") to be present in the PR body, not just the title. Kody Rule violation: Ensure PR closes referenced issues |
| @@ -0,0 +1,89 @@ | |||
| import { | |||
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.
import {The file check-sso.use-case.ts is named using kebab-case, which violates the rule requiring camelCase for new files. Please rename the file to follow the camelCase convention (e.g., checkSsoUseCase.ts).
Kody Rule violation: Seguir padrão de nomenclatura de arquivos
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| this.logger.error({ | ||
| message: 'SSO Login failed', | ||
| error, | ||
| context: SSOLoginUseCase.name, | ||
| }); |
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.
this.logger.error({
message: 'SSO Login failed',
error,
context: SSOLoginUseCase.name,
metadata: {
organizationId,
},
});The error log is missing the 'organizationId' in the metadata, which is crucial for traceability. Note that 'organizationId' is currently defined inside the 'try' block and needs to be moved to the function scope to be accessible in the 'catch' block.
Kody Rule violation: Tratamento adequado de exceções.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| @@ -0,0 +1,184 @@ | |||
| import { | |||
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.
// Rename file to: ssoLoginUseCase.ts
import {The file name 'sso-login.use-case.ts' uses kebab-case, which violates the rule requiring camelCase for new files. Please rename the file to 'ssoLoginUseCase.ts'.
Kody Rule violation: Seguir padrão de nomenclatura de arquivos
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| @@ -0,0 +1,8 @@ | |||
| export interface SSOConfig { | |||
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.
export interface SSOConfig {The file name sso-config.type.ts violates the Kody Rule requiring camelCase for new files. Please rename the file to ssoConfig.type.ts.
Kody Rule violation: Seguir padrão de nomenclatura de arquivos
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
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.
Found critical issues please review the requested changes
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
The pull request title mentions fixing issue #413, but the pull request description body does not contain a valid closing statement (e.g., "Fixes #413", "Closes #413"). Please update the description to explicitly reference the issue being closed. Kody Rule violation: Ensure PR closes referenced issues |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
|
The PR title includes 'fixes #413', but the rule explicitly requires a closing statement (e.g., 'Closes #413', 'Fixes #413') to be present in the PR body (description). Please update the description to include this statement. Kody Rule violation: Ensure PR closes referenced issues |



This pull request implements Single Sign-On (SSO) support for Google Workspace, allowing users to authenticate via their organization's Google credentials. It includes the necessary backend logic for initiating the SSO flow, handling the OAuth callback, and managing user provisioning and organization membership.
Key Changes:
CheckSSOUseCase):SSOLoginUseCase):POST /auth/sso/check: Endpoint to check SSO availability for an email and retrieve the redirect URL.GET /auth/sso/callback: Endpoint to handle the Google OAuth redirect.SSOConfigtype (Client ID, Secret, Issuer, Domains, etc.).SSO_CONFIGtoOrganizationParametersKeyenum to support storing SSO settings in organization parameters.AuthModuleto register the new use cases and importOrganizationParametersModule.OrganizationModuleto exportGetOrganizationsByDomainUseCasefor use in the SSO login flow.