import { APIResource } from "../../../resource.js"; import * as Core from "../../../core.js"; import * as CredentialsAPI from "./credentials.js"; import { CredentialUpdateParams, CredentialUpdateResponse, Credentials as CredentialsAPICredentials } from "./credentials.js"; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../pagination.js"; export declare class Configuration extends APIResource { credentials: CredentialsAPI.Credentials; /** * Create a new Token Validation configuration * * @example * ```ts * const tokenConfig = * await client.tokenValidation.configuration.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * credentials: { * keys: [ * { * alg: 'ES256', * crv: 'P-256', * kid: '38013f13-c266-4eec-a72a-92ec92779f21', * kty: 'EC', * x: 'KN53JRwN3wCjm2o39bvZUX2VdrsHzS8pxOAGjm8m7EQ', * y: 'lnkkzIxaveggz-HFhcMWW15nxvOj0Z_uQsXbpK0GFcY', * }, * ], * }, * description: * 'Long description for Token Validation Configuration', * title: 'Example Token Validation Configuration', * token_sources: [ * 'http.request.headers["x-auth"][0]', * 'http.request.cookies["Authorization"][0]', * ], * token_type: 'JWT', * }); * ``` */ create(params: ConfigurationCreateParams, options?: Core.RequestOptions): Core.APIPromise; /** * Lists all token validation configurations for this zone * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const tokenConfig of client.tokenValidation.configuration.list( * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params: ConfigurationListParams, options?: Core.RequestOptions): Core.PagePromise; /** * Delete Token Configuration * * @example * ```ts * const configuration = * await client.tokenValidation.configuration.delete( * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(configId: string, params: ConfigurationDeleteParams, options?: Core.RequestOptions): Core.APIPromise; /** * Edit fields of an existing Token Configuration * * @example * ```ts * const response = * await client.tokenValidation.configuration.edit( * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ edit(configId: string, params: ConfigurationEditParams, options?: Core.RequestOptions): Core.APIPromise; /** * Get a single Token Configuration * * @example * ```ts * const tokenConfig = * await client.tokenValidation.configuration.get( * '4a7ee8d3-dd63-4ceb-9d5f-c27831854ce7', * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(configId: string, params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise; } export declare class TokenConfigsV4PagePaginationArray extends V4PagePaginationArray { } export interface TokenConfig { /** * UUID. */ id: string; created_at: string; credentials: TokenConfig.Credentials; description: string; last_updated: string; title: string; token_sources: Array; token_type: 'JWT'; } export declare namespace TokenConfig { interface Credentials { keys: Array; } namespace Credentials { /** * JSON representation of an RSA key. */ interface APIShieldCredentialsJWTKeyRSA { /** * Algorithm */ alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; /** * RSA exponent */ e: string; /** * Key ID */ kid: string; /** * Key Type */ kty: 'RSA'; /** * RSA modulus */ n: string; } /** * JSON representation of an ES256 key */ interface APIShieldCredentialsJWTKeyEcEs256 { /** * Algorithm */ alg: 'ES256'; /** * Curve */ crv: 'P-256'; /** * Key ID */ kid: string; /** * Key Type */ kty: 'EC'; /** * X EC coordinate */ x: string; /** * Y EC coordinate */ y: string; } /** * JSON representation of an ES384 key */ interface APIShieldCredentialsJWTKeyEcEs384 { /** * Algorithm */ alg: 'ES384'; /** * Curve */ crv: 'P-384'; /** * Key ID */ kid: string; /** * Key Type */ kty: 'EC'; /** * X EC coordinate */ x: string; /** * Y EC coordinate */ y: string; } } } export interface ConfigurationDeleteResponse { /** * UUID. */ id?: string; } export interface ConfigurationEditResponse { /** * UUID. */ id?: string; description?: string; title?: string; token_sources?: Array; } export interface ConfigurationCreateParams { /** * Path param: Identifier. */ zone_id: string; /** * Body param */ credentials: ConfigurationCreateParams.Credentials; /** * Body param */ description: string; /** * Body param */ title: string; /** * Body param */ token_sources: Array; /** * Body param */ token_type: 'JWT'; } export declare namespace ConfigurationCreateParams { interface Credentials { keys: Array; } namespace Credentials { /** * JSON representation of an RSA key. */ interface APIShieldCredentialsJWTKeyRSA { /** * Algorithm */ alg: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512'; /** * RSA exponent */ e: string; /** * Key ID */ kid: string; /** * Key Type */ kty: 'RSA'; /** * RSA modulus */ n: string; } /** * JSON representation of an ES256 key */ interface APIShieldCredentialsJWTKeyEcEs256 { /** * Algorithm */ alg: 'ES256'; /** * Curve */ crv: 'P-256'; /** * Key ID */ kid: string; /** * Key Type */ kty: 'EC'; /** * X EC coordinate */ x: string; /** * Y EC coordinate */ y: string; } /** * JSON representation of an ES384 key */ interface APIShieldCredentialsJWTKeyEcEs384 { /** * Algorithm */ alg: 'ES384'; /** * Curve */ crv: 'P-384'; /** * Key ID */ kid: string; /** * Key Type */ kty: 'EC'; /** * X EC coordinate */ x: string; /** * Y EC coordinate */ y: string; } } } export interface ConfigurationListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ zone_id: string; } export interface ConfigurationDeleteParams { /** * Identifier. */ zone_id: string; } export interface ConfigurationEditParams { /** * Path param: Identifier. */ zone_id: string; /** * Body param */ description?: string; /** * Body param */ title?: string; /** * Body param */ token_sources?: Array; } export interface ConfigurationGetParams { /** * Identifier. */ zone_id: string; } export declare namespace Configuration { export { type TokenConfig as TokenConfig, type ConfigurationDeleteResponse as ConfigurationDeleteResponse, type ConfigurationEditResponse as ConfigurationEditResponse, TokenConfigsV4PagePaginationArray as TokenConfigsV4PagePaginationArray, type ConfigurationCreateParams as ConfigurationCreateParams, type ConfigurationListParams as ConfigurationListParams, type ConfigurationDeleteParams as ConfigurationDeleteParams, type ConfigurationEditParams as ConfigurationEditParams, type ConfigurationGetParams as ConfigurationGetParams, }; export { CredentialsAPICredentials as Credentials, type CredentialUpdateResponse as CredentialUpdateResponse, type CredentialUpdateParams as CredentialUpdateParams, }; } //# sourceMappingURL=configuration.d.ts.map