UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

40 lines • 1.93 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseSAMLCertificate = /* @__PURE__ */ (() => { class BaseSAMLCertificate extends APIResource { /** * Creates a new SAML encryption certificate set and assigns it to the specified * SAML Identity Provider. This endpoint is idempotent - if the IdP already has a * certificate set assigned, the existing certificate set is returned with a 200 * status. * * **Workflow for enabling SAML encryption:** * * 1. Call this endpoint to create and assign a certificate set to the IdP * 2. Update the IdP configuration (PUT `/identity_providers/{id}`) with: * - `config.enable_encryption: true` * - `saml_certificate_set_id: <uid from step 1>` * 3. Configure the certificate's public key in your external SAML Identity * Provider * * @example * ```ts * const samlCertificate = * await client.zeroTrust.identityProviders.samlCertificate.create( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ create(identityProviderID, params, options) { const { account_id } = params; return this._client.post(path `/accounts/${account_id}/access/identity_providers/${identityProviderID}/saml_certificate`, options)._thenUnwrap((obj) => obj.result); } } BaseSAMLCertificate._key = Object.freeze(['zeroTrust', 'identityProviders', 'samlCertificate']); return BaseSAMLCertificate; })(); export class SAMLCertificate extends BaseSAMLCertificate { } //# sourceMappingURL=saml-certificate.mjs.map