cloudflare
Version:
The official TypeScript library for the Cloudflare API
45 lines • 2.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SAMLCertificate = exports.BaseSAMLCertificate = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseSAMLCertificate = /* @__PURE__ */ (() => {
class BaseSAMLCertificate extends resource_1.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((0, path_1.path) `/accounts/${account_id}/access/identity_providers/${identityProviderID}/saml_certificate`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseSAMLCertificate._key = Object.freeze(['zeroTrust', 'identityProviders', 'samlCertificate']);
return BaseSAMLCertificate;
})();
exports.BaseSAMLCertificate = BaseSAMLCertificate;
class SAMLCertificate extends BaseSAMLCertificate {
}
exports.SAMLCertificate = SAMLCertificate;
//# sourceMappingURL=saml-certificate.js.map