-
Notifications
You must be signed in to change notification settings - Fork 236
Add support for indexed user attributes #539
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
Open
ThumulaPerera
wants to merge
17
commits into
asgardeo:main
Choose a base branch
from
ThumulaPerera:add-support-for-indexed-user-attributes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add support for indexed user attributes #539
ThumulaPerera
wants to merge
17
commits into
asgardeo:main
from
ThumulaPerera:add-support-for-indexed-user-attributes
Conversation
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
077be18 to
e7c2e53
Compare
Member
|
lets squash commits.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Currently, all user attributes are stored as a JSON in the DB. This prevents leveraging DB indexes to optimize reads (For example, reading the user data by username to perform authentication).
Resolves: #511
Goals
Add support to store a subset of user attributes in separate columns and index those. Attributes which need to be indexed should be configurable in the user schema
Approach
This pull request introduces support for indexed user properties in both the database schema and backend logic, enabling more efficient querying and filtering of users by specific attributes. It also refactors authentication and user identification flows to support an explicit
userTypeparameter and updates related interfaces and tests accordingly.Database schema enhancements for indexed properties:
INDEXED_PROP_1_VALUEthroughINDEXED_PROP_5_VALUE) to theUSERtable in both PostgreSQL and SQLite schemas, along with corresponding indexes to support efficient lookups. TheUSER_SCHEMAStable now also stores the names of these indexed properties. [1] [2]Backend logic and API changes for indexed properties and user type:
userServicenow extracts values for indexed properties from user attributes and stores them in the new indexed columns.BuildFilterQueryutility is updated to accept and process both indexed and unindexed filters, generating optimized queries for indexed columns. Related tests are updated as well. [1] [2] [3] [4] [5] [6] [7]Authentication and user service interface changes:
userTypeparameter for credential-based authentication, propagating this parameter through handler, service, and interface layers. [1] [2] [3] [4] [5] [6] [7] [8] [9]AuthenticateUserRequesttype is changed from a map to a struct withAttributesandUserTypefields for clarity and extensibility.IdentifyUsermethod in the user service interface and all its call sites are updated to accept auserTypeparameter. [1] [2] [3] [4] [5]These changes lay the groundwork for efficient querying of users by indexed properties and allow for more flexible authentication flows based on user type.
Release note
Add support for indexed user attributes