cloudflare
Version:
The official TypeScript library for the Cloudflare API
138 lines • 4.88 kB
TypeScript
import { APIResource } from "../../core/resource.js";
import { APIPromise } from "../../core/api-promise.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class BaseConfigurations extends APIResource {
static readonly _key: readonly ['apiGateway', 'configurations'];
/**
* Replaces the zone's authentication identifier characteristics used to identify
* distinct API sessions.
*
* @example
* ```ts
* const configuration =
* await client.apiGateway.configurations.update({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* auth_id_characteristics: [
* { name: 'authorization', type: 'header' },
* ],
* });
* ```
*/
update(params: ConfigurationUpdateParams, options?: RequestOptions): APIPromise<Configuration>;
/**
* Returns the authentication identifier characteristics configured for the zone.
* Header, cookie, or JWT claim values identify distinct API sessions.
*
* @example
* ```ts
* const configuration =
* await client.apiGateway.configurations.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params: ConfigurationGetParams, options?: RequestOptions): APIPromise<Configuration>;
}
export declare class Configurations extends BaseConfigurations {
}
export interface Configuration {
auth_id_characteristics: Array<Configuration.APIShieldAuthIDCharacteristic | Configuration.APIShieldAuthIDCharacteristicJWTClaim>;
}
export declare namespace Configuration {
/**
* Auth ID Characteristic
*/
interface APIShieldAuthIDCharacteristic {
/**
* The name of the characteristic field, i.e., the header or cookie name.
*/
name: string;
/**
* The type of characteristic.
*/
type: 'header' | 'cookie';
}
/**
* Auth ID Characteristic extracted from JWT Token Claims
*/
interface APIShieldAuthIDCharacteristicJWTClaim {
/**
* Claim location expressed as `$(token_config_id):$(json_path)`, where
* `token_config_id` is the ID of the token configuration used in validating the
* JWT, and `json_path` is a RFC 9535 JSONPath
* (https://goessner.net/articles/JsonPath/,
* https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in
* dot or bracket notation, may only specify literal keys or array indexes, and
* must return a singleton value, which will be interpreted as a string.
*/
name: string;
/**
* The type of characteristic.
*/
type: 'jwt';
}
}
export interface ConfigurationUpdateParams {
/**
* Path param: Identifier.
*/
zone_id: string;
/**
* Body param
*/
auth_id_characteristics: Array<ConfigurationUpdateParams.APIShieldAuthIDCharacteristic | ConfigurationUpdateParams.APIShieldAuthIDCharacteristicJWTClaim>;
/**
* Query param: Ensures that the configuration is written or retrieved in
* normalized fashion
*/
normalize?: boolean;
}
export declare namespace ConfigurationUpdateParams {
/**
* Auth ID Characteristic
*/
interface APIShieldAuthIDCharacteristic {
/**
* The name of the characteristic field, i.e., the header or cookie name.
*/
name: string;
/**
* The type of characteristic.
*/
type: 'header' | 'cookie';
}
/**
* Auth ID Characteristic extracted from JWT Token Claims
*/
interface APIShieldAuthIDCharacteristicJWTClaim {
/**
* Claim location expressed as `$(token_config_id):$(json_path)`, where
* `token_config_id` is the ID of the token configuration used in validating the
* JWT, and `json_path` is a RFC 9535 JSONPath
* (https://goessner.net/articles/JsonPath/,
* https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in
* dot or bracket notation, may only specify literal keys or array indexes, and
* must return a singleton value, which will be interpreted as a string.
*/
name: string;
/**
* The type of characteristic.
*/
type: 'jwt';
}
}
export interface ConfigurationGetParams {
/**
* Path param: Identifier.
*/
zone_id: string;
/**
* Query param: Ensures that the configuration is written or retrieved in
* normalized fashion
*/
normalize?: boolean;
}
export declare namespace Configurations {
export { type Configuration as Configuration, type ConfigurationUpdateParams as ConfigurationUpdateParams, type ConfigurationGetParams as ConfigurationGetParams, };
}
//# sourceMappingURL=configurations.d.ts.map