export type CreateApiAppsSystemConfigComAdobeGraniteAuthSamlSamlAuthenticationHandlerConfigArgs = {keyStorePassword?: string | undefined, 'keyStorePassword@TypeHint'?: string | undefined, 'service.ranking'?: number | undefined, 'service.ranking@TypeHint'?: string | undefined, idpHttpRedirect?: boolean | undefined, 'idpHttpRedirect@TypeHint'?: string | undefined, createUser?: boolean | undefined, 'createUser@TypeHint'?: string | undefined, defaultRedirectUrl?: string | undefined, 'defaultRedirectUrl@TypeHint'?: string | undefined, userIDAttribute?: string | undefined, 'userIDAttribute@TypeHint'?: string | undefined, defaultGroups?: Array | undefined, 'defaultGroups@TypeHint'?: string | undefined, idpCertAlias?: string | undefined, 'idpCertAlias@TypeHint'?: string | undefined, addGroupMemberships?: boolean | undefined, 'addGroupMemberships@TypeHint'?: string | undefined, path?: Array | undefined, 'path@TypeHint'?: string | undefined, synchronizeAttributes?: Array | undefined, 'synchronizeAttributes@TypeHint'?: string | undefined, clockTolerance?: number | undefined, 'clockTolerance@TypeHint'?: string | undefined, groupMembershipAttribute?: string | undefined, 'groupMembershipAttribute@TypeHint'?: string | undefined, idpUrl?: string | undefined, 'idpUrl@TypeHint'?: string | undefined, logoutUrl?: string | undefined, 'logoutUrl@TypeHint'?: string | undefined, serviceProviderEntityId?: string | undefined, 'serviceProviderEntityId@TypeHint'?: string | undefined, assertionConsumerServiceURL?: string | undefined, 'assertionConsumerServiceURL@TypeHint'?: string | undefined, handleLogout?: boolean | undefined, 'handleLogout@TypeHint'?: string | undefined, spPrivateKeyAlias?: string | undefined, 'spPrivateKeyAlias@TypeHint'?: string | undefined, useEncryption?: boolean | undefined, 'useEncryption@TypeHint'?: string | undefined, nameIdFormat?: string | undefined, 'nameIdFormat@TypeHint'?: string | undefined, digestMethod?: string | undefined, 'digestMethod@TypeHint'?: string | undefined, signatureMethod?: string | undefined, 'signatureMethod@TypeHint'?: string | undefined, userIntermediatePath?: string | undefined, 'userIntermediatePath@TypeHint'?: string | undefined}; export type CreateApiAppsSystemConfigComAdobeGraniteAuthSamlSamlAuthenticationHandlerConfigOptions = {baseUrl: string, aemAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * POST /apps/system/config/com.adobe.granite.auth.saml.SamlAuthenticationHandler.config */ export const createApiAppsSystemConfigComAdobeGraniteAuthSamlSamlAuthenticationHandlerConfig = async (args: CreateApiAppsSystemConfigComAdobeGraniteAuthSamlSamlAuthenticationHandlerConfigArgs, options: CreateApiAppsSystemConfigComAdobeGraniteAuthSamlSamlAuthenticationHandlerConfigOptions) => { const {baseUrl, fetch: fetchFn = fetch, aemAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.keyStorePassword != null) query.append("keyStorePassword", String(args.keyStorePassword)) if (args['keyStorePassword@TypeHint'] != null) query.append("keyStorePassword@TypeHint", String(args['keyStorePassword@TypeHint'])) if (args['service.ranking'] != null) query.append("service.ranking", String(args['service.ranking'])) if (args['service.ranking@TypeHint'] != null) query.append("service.ranking@TypeHint", String(args['service.ranking@TypeHint'])) if (args.idpHttpRedirect != null) query.append("idpHttpRedirect", String(args.idpHttpRedirect)) if (args['idpHttpRedirect@TypeHint'] != null) query.append("idpHttpRedirect@TypeHint", String(args['idpHttpRedirect@TypeHint'])) if (args.createUser != null) query.append("createUser", String(args.createUser)) if (args['createUser@TypeHint'] != null) query.append("createUser@TypeHint", String(args['createUser@TypeHint'])) if (args.defaultRedirectUrl != null) query.append("defaultRedirectUrl", String(args.defaultRedirectUrl)) if (args['defaultRedirectUrl@TypeHint'] != null) query.append("defaultRedirectUrl@TypeHint", String(args['defaultRedirectUrl@TypeHint'])) if (args.userIDAttribute != null) query.append("userIDAttribute", String(args.userIDAttribute)) if (args['userIDAttribute@TypeHint'] != null) query.append("userIDAttribute@TypeHint", String(args['userIDAttribute@TypeHint'])) for (const item of args.defaultGroups ?? []) query.append("defaultGroups", String(item)) if (args['defaultGroups@TypeHint'] != null) query.append("defaultGroups@TypeHint", String(args['defaultGroups@TypeHint'])) if (args.idpCertAlias != null) query.append("idpCertAlias", String(args.idpCertAlias)) if (args['idpCertAlias@TypeHint'] != null) query.append("idpCertAlias@TypeHint", String(args['idpCertAlias@TypeHint'])) if (args.addGroupMemberships != null) query.append("addGroupMemberships", String(args.addGroupMemberships)) if (args['addGroupMemberships@TypeHint'] != null) query.append("addGroupMemberships@TypeHint", String(args['addGroupMemberships@TypeHint'])) for (const item of args.path ?? []) query.append("path", String(item)) if (args['path@TypeHint'] != null) query.append("path@TypeHint", String(args['path@TypeHint'])) for (const item of args.synchronizeAttributes ?? []) query.append("synchronizeAttributes", String(item)) if (args['synchronizeAttributes@TypeHint'] != null) query.append("synchronizeAttributes@TypeHint", String(args['synchronizeAttributes@TypeHint'])) if (args.clockTolerance != null) query.append("clockTolerance", String(args.clockTolerance)) if (args['clockTolerance@TypeHint'] != null) query.append("clockTolerance@TypeHint", String(args['clockTolerance@TypeHint'])) if (args.groupMembershipAttribute != null) query.append("groupMembershipAttribute", String(args.groupMembershipAttribute)) if (args['groupMembershipAttribute@TypeHint'] != null) query.append("groupMembershipAttribute@TypeHint", String(args['groupMembershipAttribute@TypeHint'])) if (args.idpUrl != null) query.append("idpUrl", String(args.idpUrl)) if (args['idpUrl@TypeHint'] != null) query.append("idpUrl@TypeHint", String(args['idpUrl@TypeHint'])) if (args.logoutUrl != null) query.append("logoutUrl", String(args.logoutUrl)) if (args['logoutUrl@TypeHint'] != null) query.append("logoutUrl@TypeHint", String(args['logoutUrl@TypeHint'])) if (args.serviceProviderEntityId != null) query.append("serviceProviderEntityId", String(args.serviceProviderEntityId)) if (args['serviceProviderEntityId@TypeHint'] != null) query.append("serviceProviderEntityId@TypeHint", String(args['serviceProviderEntityId@TypeHint'])) if (args.assertionConsumerServiceURL != null) query.append("assertionConsumerServiceURL", String(args.assertionConsumerServiceURL)) if (args['assertionConsumerServiceURL@TypeHint'] != null) query.append("assertionConsumerServiceURL@TypeHint", String(args['assertionConsumerServiceURL@TypeHint'])) if (args.handleLogout != null) query.append("handleLogout", String(args.handleLogout)) if (args['handleLogout@TypeHint'] != null) query.append("handleLogout@TypeHint", String(args['handleLogout@TypeHint'])) if (args.spPrivateKeyAlias != null) query.append("spPrivateKeyAlias", String(args.spPrivateKeyAlias)) if (args['spPrivateKeyAlias@TypeHint'] != null) query.append("spPrivateKeyAlias@TypeHint", String(args['spPrivateKeyAlias@TypeHint'])) if (args.useEncryption != null) query.append("useEncryption", String(args.useEncryption)) if (args['useEncryption@TypeHint'] != null) query.append("useEncryption@TypeHint", String(args['useEncryption@TypeHint'])) if (args.nameIdFormat != null) query.append("nameIdFormat", String(args.nameIdFormat)) if (args['nameIdFormat@TypeHint'] != null) query.append("nameIdFormat@TypeHint", String(args['nameIdFormat@TypeHint'])) if (args.digestMethod != null) query.append("digestMethod", String(args.digestMethod)) if (args['digestMethod@TypeHint'] != null) query.append("digestMethod@TypeHint", String(args['digestMethod@TypeHint'])) if (args.signatureMethod != null) query.append("signatureMethod", String(args.signatureMethod)) if (args['signatureMethod@TypeHint'] != null) query.append("signatureMethod@TypeHint", String(args['signatureMethod@TypeHint'])) if (args.userIntermediatePath != null) query.append("userIntermediatePath", String(args.userIntermediatePath)) if (args['userIntermediatePath@TypeHint'] != null) query.append("userIntermediatePath@TypeHint", String(args['userIntermediatePath@TypeHint'])) if (aemAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${aemAuth.username}:${aemAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/apps/system/config/com.adobe.granite.auth.saml.SamlAuthenticationHandler.config${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };