@zuplo/runtime 5.2190.0 → 5.2192.0

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.
@@ -184,6 +184,34 @@ declare type Attribute = {
184
184
  value: string;
185
185
  }[];
186
186
 
187
+ /**
188
+ * A list of attributes that will be included in the authorization request.
189
+ */
190
+ declare type Attribute1 = {
191
+ /**
192
+ * The attribute ID that will be used in the PDP request.
193
+ */
194
+ attributeId: string;
195
+ /**
196
+ * The value of the attribute.
197
+ */
198
+ value: string;
199
+ }[];
200
+
201
+ /**
202
+ * A list of attributes that will be included in the authorization request.
203
+ */
204
+ declare type Attribute2 = {
205
+ /**
206
+ * The attribute ID that will be used in the PDP request.
207
+ */
208
+ attributeId: string;
209
+ /**
210
+ * The value of the attribute.
211
+ */
212
+ value: string;
213
+ }[];
214
+
187
215
  declare interface Attribute_2 {
188
216
  AttributeId: string;
189
217
  Value: string | boolean | number | string[] | boolean[] | number[];
@@ -421,7 +449,54 @@ export declare class AWSLoggingPlugin extends LogPlugin {
421
449
  /* Excluded from this release type: getTransport */
422
450
  }
423
451
 
424
- /* Excluded from this release type: AxiomaticsAuthZInboundPolicy */
452
+ /**
453
+ * Authorize requests using Axiomatics Policy Server.
454
+ *
455
+ * @remarks
456
+ * This policy will authorize requests using Axiomatics Policy Server. If the
457
+ * request is not authorized, a 403 response will be returned.
458
+ *
459
+ * This policy is designed to be highly customizable in order to tailor the
460
+ * authorization requests to the specific needs of your application. You can
461
+ * add default attributes on the policy that are included in every request, or
462
+ * you can programmatically add attributes to the request using the
463
+ * `setAuthAttributes` method.
464
+ *
465
+ * Using this policy in conjunction with an authorization policy will automatically
466
+ * set AttributeSubject attributes for the user in the request.
467
+ *
468
+ * @title Axiomatics Authorization Inbound
469
+ * @beta
470
+ * @param request - The ZuploRequest
471
+ * @param context - The ZuploContext
472
+ * @param options - The policy options set in policies.json
473
+ * @param policyName - The name of the policy as set in policies.json
474
+ * @returns A Request or a Response
475
+ */
476
+ export declare class AxiomaticsAuthZInboundPolicy extends InboundPolicy<AxiomaticsAuthZInboundPolicyOptions> {
477
+ #private;
478
+ private pdpService;
479
+ static setAuthAttributes(context: ZuploContext, attributes: XacmlRequest["Request"]): void;
480
+ constructor(options: AxiomaticsAuthZInboundPolicyOptions, policyName: string);
481
+ /**
482
+ * The handler that is called each time this policy is invoked
483
+ *
484
+ * @param request - The incoming Request
485
+ * @param context - The current context of the Request
486
+ * @returns A Response or Request object
487
+ */
488
+ handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest | Response>;
489
+ /**
490
+ * Gets the attributes for the authz request from the policy options
491
+ */
492
+ populateOptionAttributes({ optionName, authzRequestCategory, authzRequest, context, }: {
493
+ optionName: keyof Pick<AxiomaticsAuthZInboundPolicyOptions, "accessSubjectAttributes" | "resourceAttributes" | "actionAttributes">;
494
+ authzRequestCategory: keyof Omit<XacmlRequest["Request"], "ReturnPolicyIdList" | "CombinedDecision" | "XPathVersion" | "MultiRequests" | "Category">;
495
+ authzRequest: XacmlRequest;
496
+ context: ZuploContext;
497
+ }): void;
498
+ addAttributesToCategory(authzRequest: XacmlRequest, authzRequestCategory: keyof Omit<XacmlRequest["Request"], "ReturnPolicyIdList" | "CombinedDecision" | "XPathVersion" | "MultiRequests" | "Category">, attributes: Attribute_2[]): void;
499
+ }
425
500
 
426
501
  /**
427
502
  * The options for this policy.
@@ -460,8 +535,8 @@ export declare interface AxiomaticsAuthZInboundPolicyOptions {
460
535
  */
461
536
  tokenHeaderName?: string;
462
537
  accessSubjectAttributes?: Attribute;
463
- resourceAttributes?: Attribute;
464
- actionAttributes?: Attribute;
538
+ resourceAttributes?: Attribute1;
539
+ actionAttributes?: Attribute2;
465
540
  }
466
541
 
467
542
  export declare class BackgroundDispatcher<TPayload> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
- "version": "5.2190.0",
3
+ "version": "5.2192.0",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "exports": {