Skip to content

Commit

Permalink
fix: provide roleScopingEntityURN in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Mar 14, 2024
1 parent 6d2b170 commit 89f570b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export interface ReadPolicyResponse extends AccessResponse {

// Create a ids client instance
let idsClientInstance: UserServiceClient;
const cfg = createServiceConfig(process.cwd());
const getUserServiceClient = async () => {
if (!idsClientInstance) {
const cfg = createServiceConfig(process.cwd());
// identity-srv client to resolve subject ID by token
const grpcIDSConfig = cfg.get('client:user');
const loggerCfg = cfg.get('logger');
Expand Down Expand Up @@ -229,7 +229,7 @@ export async function checkAccessRequest(ctx: ACSClientContext, resource: Resour

let result: DecisionResponse | PolicySetRQResponse;
try {
result = await accessRequest(subject, resource, action, ctx, { operation });
result = await accessRequest(subject, resource, action, ctx, { operation, roleScopingEntityURN: cfg?.get('authorization:urns:organization') });
} catch (err) {
return {
decision: Response_Decision.DENY,
Expand Down

0 comments on commit 89f570b

Please sign in to comment.