-
Notifications
You must be signed in to change notification settings - Fork 4
CLN: Interface for User and UserCache Services #68
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
7 commits
Select commit
Hold shift + click to select a range
f2a5f72
DRAFT: Initial set of changes for adding Interface for service layer
arjun-keyvalue cdb6190
CLN: Changed the naming convention for the interface
arjun-keyvalue e626e33
CLN: Merged the updates of development branch
arjun-keyvalue d284447
CLN: Added Symbol for the Interface to allow direct injection of it
arjun-keyvalue c2a995c
CLN: Interface for UserCache service
arjun-keyvalue 08e3df0
FIX: Resolved Conflicts
pooja-keyvalue b93884d
FIX: Export user service interface from authorization module
pooja-keyvalue 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import User from '../entity/user.entity'; | ||
| import { | ||
| OperationType, | ||
| UpdateUserGroupInput, | ||
| UpdateUserInput, | ||
| UpdateUserPermissionInput, | ||
| UserInputFilter, | ||
| } from '../../schema/graphql.schema'; | ||
| import Group from '../entity/group.entity'; | ||
| import Permission from '../entity/permission.entity'; | ||
|
|
||
| export interface UserServiceInterface { | ||
| getAllUsers(input?: UserInputFilter): Promise<[User[], number]>; | ||
|
|
||
| getUserById(id: string): Promise<User>; | ||
|
|
||
| createUser(user: User): Promise<User>; | ||
|
|
||
| updateUser(id: string, user: UpdateUserInput): Promise<User>; | ||
|
|
||
| updateUserGroups(id: string, user: UpdateUserGroupInput): Promise<Group[]>; | ||
|
|
||
| getUserGroups(id: string): Promise<Group[]>; | ||
|
|
||
| updateUserPermissions( | ||
| id: string, | ||
| request: UpdateUserPermissionInput, | ||
| ): Promise<Permission[]>; | ||
|
|
||
| getUserPermissions(id: string): Promise<Permission[]>; | ||
|
|
||
| deleteUser(id: string): Promise<User>; | ||
|
|
||
| getAllUserpermissionIds(id: string): Promise<Set<string>>; | ||
|
|
||
| permissionsOfUser(id: string): Promise<Permission[]>; | ||
|
|
||
| verifyUserPermissions( | ||
| id: string, | ||
| permissionsToVerify: string[], | ||
| operation?: OperationType, | ||
| ): Promise<boolean>; | ||
|
|
||
| verifyDuplicateUser( | ||
| email?: string | undefined, | ||
| phone?: string | undefined, | ||
| ): Promise<{ existingUserDetails?: User | null; duplicate: string }>; | ||
|
|
||
| getUserDetailsByEmailOrPhone( | ||
| email?: string | undefined, | ||
| phone?: string | undefined, | ||
| ): Promise<any>; | ||
|
|
||
| getUserDetailsByUsername( | ||
| email?: string | undefined, | ||
| phone?: string | undefined, | ||
| ): Promise<User | null>; | ||
|
|
||
| updateField(id: string, field: string, value: any): Promise<User>; | ||
|
|
||
| getActiveUserByPhoneNumber(phone: string): Promise<User | null>; | ||
|
|
||
| setOtpSecret(user: User, twoFASecret: string): Promise<void>; | ||
| } | ||
|
|
||
| export const UserServiceInterface = Symbol('UserServiceInterface'); |
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,11 @@ | ||
| export interface UserCacheServiceInterface { | ||
| getUserGroupsByUserId(userId: string): Promise<string[]>; | ||
|
|
||
| getUserPermissionsByUserId(userId: string): Promise<string[]>; | ||
|
|
||
| invalidateUserPermissionsCache(userId: string): Promise<void>; | ||
|
|
||
| invalidateUserGroupsCache(userId: string): Promise<void>; | ||
| } | ||
|
|
||
| export const UserCacheServiceInterface = Symbol('UserCacheServiceInterface'); |
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.
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.