-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: Keycloak user role org map #559
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f2374d1
Refactored org roles API to fetch roles from keycloak, worked on user…
nishad-ayanworks 79a57ca
Updated org invitation
nishad-ayanworks eee18df
Merge branch 'develop' of https://github.com/credebl/platform into ke…
nishad-ayanworks 1695655
created deleteUserCLient roles API, created migration file for idpRol…
nishad-ayanworks b608fde
Refactored the updateUserOrgRole function, Worked on the orgroleguard…
nishad-ayanworks d633fe1
worked on the code optimization of invitations flow, worked on the us…
nishad-ayanworks 8ebec4d
WIP migrate org as client to keycloak
nishad-ayanworks 51f25a7
Merge branch 'develop' of https://github.com/credebl/platform into ke…
nishad-ayanworks 0ba61cc
WIP register org to keycloak and map owner
nishad-ayanworks d14a8f5
refactored role guard, worked on the API to register clients and map …
nishad-ayanworks 1169733
Merge branch 'develop' of https://github.com/credebl/platform into ke…
nishad-ayanworks 6f7ba0f
refactor register user for org roles in DB
nishad-ayanworks b85a5ad
refactor API endpoint name
nishad-ayanworks 584198b
Merge branch 'develop' of https://github.com/credebl/platform into ke…
nishad-ayanworks b666d97
renamed the variable in organization repository
nishad-ayanworks 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 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 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,16 @@ | ||
import { Injectable, CanActivate, ExecutionContext, UnauthorizedException } from '@nestjs/common'; | ||
import { Observable } from 'rxjs'; | ||
|
||
@Injectable() | ||
export class UserAccessGuard implements CanActivate { | ||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> { | ||
const request = context.switchToHttp().getRequest(); | ||
|
||
const { user } = request; | ||
|
||
if (user.hasOwnProperty('client_id')) { | ||
throw new UnauthorizedException('You do not have access'); | ||
} | ||
return true; | ||
} | ||
} |
This file contains 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 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 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 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 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 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.
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.
Update variable name with recordsWithNullIdpId