Skip to content

Conversation

@MrCreosote
Copy link
Member

Everything has been previously reviewed

MrCreosote and others added 30 commits June 3, 2024 14:22
* Fixed a bug where if a user name contained an underscore and
the search term included the underscore followed by at least one
letter the search wouldn't match
* Fixed a bug where if the search terms were all illegal characters
such that the search list was empty for a requested search a
mongo error would be thrown
PTV-1911: Fix user search bugs re underscores + mongo errors
SECURITY-4: Update Dependabot.yml
...because that's what it is and I want to create a non-integration
LoginTest.
CDM-367: Move LoginTest -> LoginIntegrationTest
Current users should be unaffected.

< 1% of KBase users have these features in their usernames.

Makes it easier to integrate with other systems that have stringent
character requirements where we want to insert a username into a field,
as now a double underscore can be used to separate the username from the
rest of the field.
CDM-367: Disallow repeating and trailing underscores in new user names
CDM-369: Update username suggestion endpoint for underscore changes
The MeTest.getMeMaximalInput test was failing in CI but passing locally
due to non-deterministic ordering of identities. The issue was that
u.getIdentities() returns a Set<RemoteIdentity>, and Sets don't guarantee
iteration order. This caused the identities array in the response to have
different ordering across different environments and test runs.

Fixed by making RemoteIdentity implement Comparable interface, sorting
identities by provider name then provider username. This provides a clean,
OOP solution where RemoteIdentity owns its own comparison logic.

Changes:
- Made RemoteIdentity implement Comparable<RemoteIdentity>
- Added compareTo() method sorting by provider name → provider username
- Added comprehensive unit tests for compareTo() functionality
- Simplified Me endpoints to use .sorted() instead of inline lambda

Fixes the failing test:
- us.kbase.test.auth2.service.ui.MeTest.getMeMaximalInput
Self explanatory.

Original version written by David Lyon here:
#471
CDM-243: Add MFAStatus class
CDM-243: Add identity provider response class
Also, one of the URLs was hanging for 10s or so, so changed the target
CDM-243: Use IdentityProviderResponse class in auth
Fix immutability bug in identity provider config
Based on code originally written by David Lyon here:
#471
CDM-243: Add MFA state determination code to OrcID provider
CDM_243: Add MFAStatus to Stored Token
Based on code originally written by David Lyon here:
#471
CDM-243: Store token MFA status in Mongo
Make token type case insenstive when creating serv / dev tokens
Will be exposed in the serivce API / UI
CDM-243: Update MFA descriptions
All the other changes in this PR flow out of that single change. eesh.

TODO: test the UITokens for MFA status once it's exposed in the API layer.
Currently the tests other than the Authentication unit tests can't see
the MFA status because it's not yet in the ExternalToken. Once that
happends there will be changes all over so I'll do that later.
Admin template endpoints were tested manually
CDM-243: Add MFA to TemporarySessionData LOGINIDENTS operation
CDM-243: Allow specifying the MFA status for test mode tokens
CDM-245: Add mfa to external endpoints
Bump version + release notes
Improve test mode create token test
@MrCreosote MrCreosote merged commit 9c6cc2a into master Nov 20, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants