@zuplo/runtime 6.40.32 → 6.40.34

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.
@@ -451,6 +451,107 @@ export declare interface Auth0JwtInboundPolicyOptions {
451
451
  audience?: string;
452
452
  }
453
453
 
454
+ /**
455
+ * Authorize requests using an AuthZEN compatible PDP
456
+ *
457
+ * @title AuthZEN Authorization
458
+ * @beta
459
+ * @param request - The ZuploRequest
460
+ * @param context - The ZuploContext
461
+ * @param options - The policy options set in policies.json
462
+ * @param policyName - The name of the policy as set in policies.json
463
+ * @returns A Request or a Response
464
+ */
465
+ export declare class AuthZenInboundPolicy extends InboundPolicy<AuthZenInboundPolicyOptions> {
466
+ #private;
467
+ constructor(options: AuthZenInboundPolicyOptions, policyName: string);
468
+ /**
469
+ * The handler that is called each time this policy is invoked
470
+ *
471
+ * @param request - The incoming Request
472
+ * @param context - The current context of the Request
473
+ * @returns A Response or Request object
474
+ */
475
+ handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest | Response>;
476
+ /**
477
+ * Set the authorization payload for the current request.
478
+ *
479
+ * @param context - The ZuploContext for the current request
480
+ * @param payload - The AuthZEN payload to send to the PDP service
481
+ */
482
+ static setAuthorizationPayload(context: ZuploContext, payload: Partial<AuthZenPayload>): void;
483
+ /**
484
+ * Get the authorization payload for the current request.
485
+ *
486
+ * @param context - The ZuploContext for the current request
487
+ * @returns The AuthZEN payload to send to the PDP service
488
+ */
489
+ static getAuthorizationPayload(context: ZuploContext): Partial<AuthZenPayload> | undefined;
490
+ }
491
+
492
+ /**
493
+ * The options for this policy.
494
+ */
495
+ export declare interface AuthZenInboundPolicyOptions {
496
+ /**
497
+ * The hostname of the AuthZen PDP service.
498
+ */
499
+ authorizerHostname: string;
500
+ /**
501
+ * The authorization header to use when communicating with the AuthZen PDP service.
502
+ */
503
+ authorizerAuthorizationHeader?: string;
504
+ /**
505
+ * The subject of the request.
506
+ */
507
+ subject: {
508
+ /**
509
+ * The type of the resource.
510
+ */
511
+ type: string;
512
+ /**
513
+ * The id of the resource. Note you can use the `$authzen-prop()` syntax to reference the resource id.
514
+ */
515
+ id: string;
516
+ [k: string]: unknown;
517
+ };
518
+ /**
519
+ * The resource of the request. Note you can use the `$authzen-prop()` syntax to reference the resource id.
520
+ */
521
+ resource: {
522
+ /**
523
+ * The type of the resource.
524
+ */
525
+ type: string;
526
+ /**
527
+ * The id of the resource. Note you can use the `$authzen-prop()` syntax to reference the resource id.
528
+ */
529
+ id: string;
530
+ [k: string]: unknown;
531
+ };
532
+ /**
533
+ * The action of the request. Note you can use the `$authzen-prop()` syntax to reference the action.
534
+ */
535
+ action: string;
536
+ /**
537
+ * If explicitly set to false, the policy will not throw an error if there is any problem communicating with the AuthZen PDP service and allow calls through. By default throwOnError is assumed to be on/true.
538
+ */
539
+ throwOnError?: boolean;
540
+ }
541
+
542
+ /* Excluded from this release type: AuthZenPayload */
543
+
544
+ export declare interface AuthZenPayloadSettings {
545
+ subject?: AuthZenTypeIdPair;
546
+ resource?: AuthZenTypeIdPair;
547
+ action?: string;
548
+ }
549
+
550
+ export declare interface AuthZenTypeIdPair {
551
+ type: string;
552
+ id: string;
553
+ }
554
+
454
555
  declare interface AwsLambdaEventV1 {
455
556
  [key: string]: string | null | undefined | number | boolean | object;
456
557
  version: "1.0";
@@ -798,8 +899,7 @@ export declare interface BasicAuthInboundPolicyOptions {
798
899
  allowUnauthenticatedRequests?: boolean;
799
900
  }
800
901
 
801
- declare interface BasicDictionary {
802
- [key: string]: string | number | boolean | null | undefined;
902
+ declare interface BasicDictionary extends Record<string, string | number | boolean | null | undefined> {
803
903
  }
804
904
 
805
905
  /* Excluded from this release type: BatchDispatch */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.40.32",
4
+ "version": "6.40.34",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {