Skip to content
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

chore: release #324

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.8
20.11.1
7 changes: 6 additions & 1 deletion src/core/accessController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,12 @@ export class AccessController {
*/
private async checkSubjectMatches(ruleSubAttributes: Attribute[],
requestSubAttributes: Attribute[], request: Request): Promise<boolean> {
let context = (request as any)?.context as ContextWithSubResolved;
// check if context subject_id contains HR scope if not make request 'createHierarchicalScopes'
if (context?.subject?.token &&
_.isEmpty(context.subject.hierarchical_scopes)) {
context = await this.createHRScope(context);
}
// Just check the Role value matches here in subject
const roleURN = this.urns.get('role');
let ruleRole: string;
Expand All @@ -803,7 +809,6 @@ export class AccessController {
this.logger.warn(`Subject does not match with rule attributes`, ruleSubAttributes);
return false;
}
const context = (request as any)?.context as ContextWithSubResolved;
if (!context?.subject?.role_associations) {
this.logger.warn('Subject role associations missing', ruleSubAttributes);
return false;
Expand Down
Loading