-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(users): store and retrieve lineage_context from DB instead of Redis #7940
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 all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dd1428c
feat(users): store and retrieve lineage_context from DB instead of Redis
tsdk02 cb18d6b
check v2 user role first before v1 user role
tsdk02 b0bd6c1
add lineage_context column in v2 schema
tsdk02 078716d
add comment
tsdk02 6884b69
resolved comments and refactored code
tsdk02 87ef460
chore: run formatter
hyperswitch-bot[bot] e84b153
fixed clippy errors
tsdk02 07a5d92
chore: run formatter
hyperswitch-bot[bot] a716d29
fixed clippy errors
tsdk02 187002b
removed comment
tsdk02 deb41a5
Merge branch 'main' into lineage-context-db
tsdk02 c3ed3a8
update last_modified_at for MockDb
tsdk02 e80d127
move lineage_context DB update to background using tokio::spawn
tsdk02 670c2e9
added logging message for successfully updating lineage context
tsdk02 4ca1ce6
deleted file
tsdk02 cdb7ce6
moved the lineage_db_update to a util function
tsdk02 d37ac24
Merge branch 'main' into lineage-context-db
Gnanasundari24 48aed58
resolved merge conflicts
tsdk02 5414b0d
minor nits
tsdk02 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
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
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,9 @@ | ||
/// User related types | ||
pub mod core; | ||
|
||
/// Theme related types | ||
pub mod theme; | ||
|
||
pub use core::*; | ||
|
||
pub use theme::*; |
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,28 @@ | ||
use diesel::{deserialize::FromSqlRow, expression::AsExpression}; | ||
|
||
use crate::id_type; | ||
|
||
/// Struct for lineageContext | ||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, AsExpression, FromSqlRow)] | ||
#[diesel(sql_type = diesel::sql_types::Jsonb)] | ||
pub struct LineageContext { | ||
/// user_id: String | ||
pub user_id: String, | ||
|
||
/// merchant_id: MerchantId | ||
pub merchant_id: id_type::MerchantId, | ||
|
||
/// role_id: String | ||
pub role_id: String, | ||
|
||
/// org_id: OrganizationId | ||
pub org_id: id_type::OrganizationId, | ||
|
||
/// profile_id: ProfileId | ||
pub profile_id: id_type::ProfileId, | ||
|
||
/// tenant_id: TenantId | ||
pub tenant_id: id_type::TenantId, | ||
} | ||
|
||
crate::impl_to_sql_from_sql_json!(LineageContext); |
File renamed without changes.
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
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
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.
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.
💯