@xemahq/platform-common 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-actor.guard.d.ts","sourceRoot":"","sources":["../../../src/nestjs/auth/service-actor.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAKjB,MAAM,gBAAgB,CAAC;AAkCxB,qBACa,iBAAkB,YAAW,WAAW;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAE7D,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"service-actor.guard.d.ts","sourceRoot":"","sources":["../../../src/nestjs/auth/service-actor.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAKjB,MAAM,gBAAgB,CAAC;AAkCxB,qBACa,iBAAkB,YAAW,WAAW;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAE7D,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CA2ChD"}
|
|
@@ -24,18 +24,19 @@ let ServiceActorGuard = ServiceActorGuard_1 = class ServiceActorGuard {
|
|
|
24
24
|
message: 'Internal route misconfigured: missing request context.',
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const isDelegated = ctx.actorChain.length > 0;
|
|
28
|
+
if (ctx.tokenClass !== subject_1.TokenClass.ServiceJwt || isDelegated) {
|
|
28
29
|
this.logger.warn({
|
|
29
30
|
message: 'service-actor-required',
|
|
30
31
|
route: `${request.method} ${request.originalUrl}`,
|
|
31
32
|
actorId: ctx.actorId,
|
|
32
33
|
tokenClass: ctx.tokenClass,
|
|
33
34
|
subjectKind: ctx.subject.kind,
|
|
34
|
-
delegated:
|
|
35
|
+
delegated: isDelegated,
|
|
35
36
|
});
|
|
36
37
|
throw new common_1.ForbiddenException({
|
|
37
38
|
code: 'ACTOR_NOT_SERVICE',
|
|
38
|
-
message: 'This endpoint is restricted to service-account callers. ' +
|
|
39
|
+
message: 'This endpoint is restricted to non-delegated service-account callers. ' +
|
|
39
40
|
'Mint a token via IdentityBootstrapService.getAccessToken().',
|
|
40
41
|
});
|
|
41
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-actor.guard.js","sourceRoot":"","sources":["../../../src/nestjs/auth/service-actor.guard.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAOwB;AAExB,8DAA8D;AAC9D,+DAA4D;AAgCrD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IACX,MAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAE7D,WAAW,CAAC,OAAyB;QACnC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;QAC7D,MAAM,GAAG,GAAI,OAA8C,CACzD,iCAAe,CACc,CAAC;QAEhC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,sDAAsD;gBACpD,4EAA4E,CAC/E,CAAC;YACF,MAAM,IAAI,qCAA4B,CAAC;gBACrC,IAAI,EAAE,yBAAyB;gBAC/B,OAAO,EAAE,wDAAwD;aAClE,CAAC,CAAC;QACL,CAAC;
|
|
1
|
+
{"version":3,"file":"service-actor.guard.js","sourceRoot":"","sources":["../../../src/nestjs/auth/service-actor.guard.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAOwB;AAExB,8DAA8D;AAC9D,+DAA4D;AAgCrD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IACX,MAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAE7D,WAAW,CAAC,OAAyB;QACnC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UA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