-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
✨ feat: Add support for Okta Authentication #8547
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
Conversation
@actions-user is attempting to deploy a commit to the LobeHub Community Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's GuideThis PR introduces support for Okta authentication by extending environment configuration, deprecation warnings, and schema definitions, adds corresponding test coverage, and tweaks the default callback URL fallback in the sign-in component. Class diagram for updated Auth environment configurationclassDiagram
class Env {
+ZITADEL_CLIENT_ID?: string
+ZITADEL_CLIENT_SECRET?: string
+ZITADEL_ISSUER?: string
+OKTA_CLIENT_ID?: string
+OKTA_CLIENT_SECRET?: string
+OKTA_ISSUER?: string
+LOGTO_CLIENT_ID?: string
+LOGTO_CLIENT_SECRET?: string
+LOGTO_ISSUER?: string
...
}
Class diagram for getAuthConfig function changesclassDiagram
class getAuthConfig {
+createEnv()
+add Okta env variables to schema
+add Okta env variables to returned config
+add Okta deprecation warnings
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Thank you for raising your pull request and contributing to our Community |
TestGru AssignmentSummary
Tip You can |
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.
Hey @JamieStivala - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/config/__tests__/auth.test.ts:199` </location>
<code_context>
);
});
});
+ it('should warn about Okta deprecated environment variables', () => {
+ // Set all deprecated environment variables
+ process.env.OKTA_CLIENT_ID = 'okta_client_id';
+ process.env.OKTA_CLIENT_SECRET = 'okta_client_secret';
+ process.env.OKTA_ISSUER = 'okta_issuer';
+ // Call the function
+ getAuthConfig();
+
+ // Check that the spyConsoleWarn function was called for each deprecated environment variable
+ expect(spyConsoleWarn).toHaveBeenCalledWith(
+ expect.stringMatching(/OKTA_CLIENT_ID.*AUTH_OKTA_ID/),
+ );
</code_context>
<issue_to_address>
Missing test cleanup for environment variables.
Restore or unset the modified environment variables after the test to prevent side effects in other tests.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/config/__tests__/auth.test.ts
Outdated
it('should warn about Okta deprecated environment variables', () => { | ||
// Set all deprecated environment variables | ||
process.env.OKTA_CLIENT_ID = 'okta_client_id'; | ||
process.env.OKTA_CLIENT_SECRET = 'okta_client_secret'; | ||
process.env.OKTA_ISSUER = 'okta_issuer'; | ||
// Call the function | ||
getAuthConfig(); | ||
|
||
// Check that the spyConsoleWarn function was called for each deprecated environment variable | ||
expect(spyConsoleWarn).toHaveBeenCalledWith( |
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.
suggestion (testing): Missing test cleanup for environment variables.
Restore or unset the modified environment variables after the test to prevent side effects in other tests.
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.
the implement is not correctly , please check other pr like #7342. And add relative documents
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8547 +/- ##
=======================================
Coverage 85.58% 85.58%
=======================================
Files 910 910
Lines 69093 69093
Branches 4530 4531 +1
=======================================
Hits 59134 59134
Misses 9959 9959
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thank you for your reply. I just implemented the changes as per PR #7342, and removed any references to the old "runtimeEnv" Environment Variables (as well as the tests). Please let me know if there are any further changes I need to make. Unfortunately, I am not able to translate the documentation from English to Chinese, as I do not possess the language knowledge. Additionally, sorry for the commit spam. I forgot to include some files in the original commits. Should be all good now. |
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.
LGTM. I will add Chinese docs for you. Thanks for your contribution!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❤️ Great PR @JamieStivala ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 1.106.0](v1.105.6...v1.106.0) <sup>Released on **2025-07-29**</sup> #### ✨ Features - **misc**: Add support for Okta Authentication. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add support for Okta Authentication, closes [#8547](#8547) ([67abdfe](67abdfe)) </details> <div align="right"> [](#readme-top) </div>
🎉 This PR is included in version 1.106.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.105.0](v1.104.1...v1.105.0) <sup>Released on **2025-07-29**</sup> #### ✨ Features - **misc**: Add support for Okta Authentication. #### 🐛 Bug Fixes - **misc**: Fix subscription plan tag display, reorder AppTheme and Locale to fix modal i18n, revert jose to ^5 to fix auth issue on desktop. #### 💄 Styles - **misc**: Open new topic by tap Just Chat again, support Minimax T2I models. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add support for Okta Authentication, closes [lobehub#8547](https://github.com/jaworldwideorg/OneJA-Bot/issues/8547) ([67abdfe](67abdfe)) #### What's fixed * **misc**: Fix subscription plan tag display, closes [lobehub#8599](https://github.com/jaworldwideorg/OneJA-Bot/issues/8599) ([2a3754a](2a3754a)) * **misc**: Reorder AppTheme and Locale to fix modal i18n, closes [lobehub#8600](https://github.com/jaworldwideorg/OneJA-Bot/issues/8600) ([3264cf2](3264cf2)) * **misc**: Revert jose to ^5 to fix auth issue on desktop, closes [lobehub#8603](https://github.com/jaworldwideorg/OneJA-Bot/issues/8603) ([57118b0](57118b0)) #### Styles * **misc**: Open new topic by tap Just Chat again, closes [lobehub#8426](https://github.com/jaworldwideorg/OneJA-Bot/issues/8426) ([018ca75](018ca75)) * **misc**: Support Minimax T2I models, closes [lobehub#8583](https://github.com/jaworldwideorg/OneJA-Bot/issues/8583) ([f8a01aa](f8a01aa)) </details> <div align="right"> [](#readme-top) </div>
* Add Okta support to auth config and tests * Added documentation * Removed deprecated env variables * Added Okta as SSO Provider * Removed Okta Test * Reverted a micro-change which was changed during some testing (back to original) * Added Okta to SSO providers list
## [Version 1.106.0](lobehub/lobe-chat@v1.105.6...v1.106.0) <sup>Released on **2025-07-29**</sup> #### ✨ Features - **misc**: Add support for Okta Authentication. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add support for Okta Authentication, closes [lobehub#8547](lobehub#8547) ([ad57abe](lobehub@ad57abe)) </details> <div align="right"> [](#readme-top) </div>
* Add Okta support to auth config and tests * Added documentation * Removed deprecated env variables * Added Okta as SSO Provider * Removed Okta Test * Reverted a micro-change which was changed during some testing (back to original) * Added Okta to SSO providers list
## [Version 1.106.0](lobehub/lobe-chat@v1.105.6...v1.106.0) <sup>Released on **2025-07-29**</sup> #### ✨ Features - **misc**: Add support for Okta Authentication. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add support for Okta Authentication, closes [lobehub#8547](lobehub#8547) ([67abdfe](lobehub@67abdfe)) </details> <div align="right"> [](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
Added support for Okta authentication
📝 补充信息 | Additional Information
Summary by Sourcery
Add support for Okta authentication by registering Okta environment variables for type declarations, validation, and configuration, emit deprecation warnings for them, update sign-in callback URL logic, and include tests for the new warnings.
New Features:
Enhancements:
Tests: