Skip to content

Commit

Permalink
rebase fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AleF83 committed Jun 29, 2020
1 parent 3aad83b commit 3a8678c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions services/src/modules/directives/policy/policy-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class PolicyExecutor {
const {done, allow} = await evaluate({
...policy,
args,
query,
policyAttachments: this.policyAttachments,
});
if (!done) throw new Error('in-line query evaluation not yet supported');
Expand Down
3 changes: 1 addition & 2 deletions services/src/modules/paramInjection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type jwtData = {
[name: string]: any;
};

const paramRegex = /{(source|args|exports)\.(\w+(\.\w+)*)}/;
const paramRegex = /{(source|args|jwt|exports)\.(\w+(\.\w+)*)}/;
const authzHeaderPrefix = 'Bearer ';

function resolveTemplate(
Expand Down Expand Up @@ -114,7 +114,6 @@ function getJwt(context: RequestContext): jwtData {
context.jwt = isAuthzHeaderValid(authzHeader)
? (decodeJwt(authzHeader.substr(authzHeaderPrefix.length), {json: true}) as jwtData)
: {};

return context.jwt;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Object {
"exception": Object {
"stacktrace": Array [
"Error: Unauthorized by policy alwaysDenied in namespace namespace",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:37:19)",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:42:19)",
" at async Promise.all (index 0)",
" at async PolicyExecutor.validatePolicies (/service/dist/modules/directives/policy/policy-executor.js:20:9)",
" at async field.resolve (/service/dist/modules/directives/policy/policy.js:14:17)",
Expand Down Expand Up @@ -58,7 +58,7 @@ Object {
"exception": Object {
"stacktrace": Array [
"Error: Unauthorized by policy notClassified in namespace namespace",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:37:19)",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:42:19)",
" at async Promise.all (index 0)",
" at async PolicyExecutor.validatePolicies (/service/dist/modules/directives/policy/policy-executor.js:20:9)",
" at async field.resolve (/service/dist/modules/directives/policy/policy.js:14:17)",
Expand Down Expand Up @@ -99,7 +99,7 @@ Object {
"exception": Object {
"stacktrace": Array [
"Error: Unauthorized by policy notClassified in namespace namespace",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:37:19)",
" at PolicyExecutor.validatePolicy (/service/dist/modules/directives/policy/policy-executor.js:42:19)",
" at async Promise.all (index 0)",
" at async PolicyExecutor.validatePolicies (/service/dist/modules/directives/policy/policy-executor.js:20:9)",
" at async field.resolve (/service/dist/modules/directives/policy/policy.js:14:17)",
Expand Down

0 comments on commit 3a8678c

Please sign in to comment.