-
Notifications
You must be signed in to change notification settings - Fork 112
feat: SSO configuration and auth method management #2686
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
946968a
feat: add SSO configuration, auth method management, and domain-filte…
omar-inkeep 7ad8708
feedback
omar-inkeep 0dd7d14
update cypress login
omar-inkeep 1bcfc16
feedback
omar-inkeep 5237929
Merge remote-tracking branch 'origin/main' into feat/org-sso-login
omar-inkeep 2d50400
address UX feedback
omar-inkeep 0800710
add missing tests
omar-inkeep 7904496
Merge branch 'main' into feat/org-sso-login
omar-inkeep d5ade89
fix test
omar-inkeep 7b70907
Merge branch 'main' into feat/org-sso-login
omar-inkeep aec9f75
Merge branch 'main' into feat/org-sso-login
omar-inkeep 1cc7ccc
adjust sso config
omar-inkeep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@inkeep/agents-core": minor | ||
| "@inkeep/agents-api": minor | ||
| "@inkeep/agents-manage-ui": minor | ||
| --- | ||
|
|
||
| Add SSO configuration, auth method management, and domain-filtered login and invitation flows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { createApiError, getAuthLookupForEmail } from '@inkeep/agents-core'; | ||
| import { Hono } from 'hono'; | ||
| import { HTTPException } from 'hono/http-exception'; | ||
| import runDbClient from '../../../data/db/runDbClient'; | ||
| import type { ManageAppVariables } from '../../../types/app'; | ||
|
|
||
| const authLookupRoutes = new Hono<{ Variables: ManageAppVariables }>(); | ||
|
|
||
| /** | ||
| * GET /api/auth-lookup?email=user@example.com | ||
| * | ||
| * Unauthenticated endpoint for the email-first login flow. | ||
| * Returns org-aware auth methods: | ||
| * 1. Checks SSO providers by email domain -> resolves org -> returns org's allowed methods (SSO filtered to domain-matched providers) | ||
| * 2. Checks existing user account -> resolves org membership -> returns org's allowed methods (SSO filtered to domain-matched providers) | ||
| * | ||
| * Returns empty organizations array if no match is found. | ||
| * | ||
| * Response shape: `{ organizations: OrgAuthInfo[] }`. | ||
| */ | ||
| authLookupRoutes.get('/', async (c) => { | ||
| const email = c.req.query('email'); | ||
|
|
||
| if (!email) { | ||
| throw createApiError({ | ||
| code: 'bad_request', | ||
| message: 'Email parameter is required', | ||
| }); | ||
| } | ||
|
|
||
| const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; | ||
| if (!emailRegex.test(email)) { | ||
| throw createApiError({ | ||
| code: 'bad_request', | ||
| message: 'Invalid email format', | ||
| }); | ||
| } | ||
|
|
||
| try { | ||
| const organizations = await getAuthLookupForEmail(runDbClient)(email); | ||
|
|
||
| return c.json({ organizations }); | ||
| } catch (error) { | ||
omar-inkeep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (error instanceof HTTPException) { | ||
| throw error; | ||
| } | ||
|
|
||
| console.error('[auth-lookup] Error looking up auth method:', error); | ||
| throw createApiError({ | ||
| code: 'internal_server_error', | ||
| message: 'Failed to look up authentication method', | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| export default authLookupRoutes; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.