UNPKG

@aws-lambda-powertools/parser

Version:
32 lines (31 loc) 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppSyncOidcIdentity = exports.AppSyncIamIdentity = exports.AppSyncCognitoIdentity = void 0; const zod_1 = require("zod"); const AppSyncIamIdentity = zod_1.z.object({ accountId: zod_1.z.string(), cognitoIdentityPoolId: zod_1.z.string().nullable(), cognitoIdentityId: zod_1.z.string().nullable(), sourceIp: zod_1.z.array(zod_1.z.string()), username: zod_1.z.string(), userArn: zod_1.z.string(), cognitoIdentityAuthType: zod_1.z.string().nullable(), cognitoIdentityAuthProvider: zod_1.z.string().nullable(), }); exports.AppSyncIamIdentity = AppSyncIamIdentity; const AppSyncCognitoIdentity = zod_1.z.object({ sub: zod_1.z.string(), issuer: zod_1.z.string(), username: zod_1.z.string(), claims: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()), sourceIp: zod_1.z.array(zod_1.z.ipv4()), defaultAuthStrategy: zod_1.z.string().nullable(), groups: zod_1.z.array(zod_1.z.string()).nullable(), }); exports.AppSyncCognitoIdentity = AppSyncCognitoIdentity; const AppSyncOidcIdentity = zod_1.z.object({ claims: zod_1.z.any(), issuer: zod_1.z.string(), sub: zod_1.z.string(), }); exports.AppSyncOidcIdentity = AppSyncOidcIdentity;