/** * PKCE (Proof Key for Code Exchange) test constants * * Provides RFC 7636 compliant test values for OAuth PKCE flow testing. * * Note: These are format-valid test values but are NOT cryptographically * linked (the challenge is not the SHA256 hash of the verifier). * Use them for format validation testing, not crypto verification testing. * * @example * ```typescript * import { VALID_CODE_VERIFIER, VALID_CODE_CHALLENGE } from '@xivdyetools/test-utils/constants'; * * const params = new URLSearchParams({ * code_verifier: VALID_CODE_VERIFIER, * code_challenge: VALID_CODE_CHALLENGE, * code_challenge_method: 'S256', * }); * ``` */ /** * Valid PKCE code_verifier for testing * * Per RFC 7636: * - 43-128 characters * - Unreserved URI characters: [A-Za-z0-9-._~] */ export declare const VALID_CODE_VERIFIER = "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk~test123456789012345"; /** * Valid PKCE code_challenge for testing * * Per RFC 7636: * - BASE64URL(SHA256(verifier)) = 43 characters for S256 method * - Unreserved URI characters: [A-Za-z0-9-._~] * * Note: This is a format-valid challenge but is NOT the actual * SHA256 hash of VALID_CODE_VERIFIER. */ export declare const VALID_CODE_CHALLENGE = "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM_test12345678"; /** * Invalid code_verifier (too short - less than 43 chars) */ export declare const INVALID_SHORT_VERIFIER = "tooshort"; /** * Invalid code_verifier (contains invalid characters) */ export declare const INVALID_CHARS_VERIFIER = "invalid@verifier#with$special%chars&that!are*not+allowed"; /** * Invalid code_challenge (too short) */ export declare const INVALID_SHORT_CHALLENGE = "tooshort"; /** * Minimum length for code_verifier (RFC 7636) */ export declare const MIN_VERIFIER_LENGTH = 43; /** * Maximum length for code_verifier (RFC 7636) */ export declare const MAX_VERIFIER_LENGTH = 128; /** * Expected length for S256 code_challenge */ export declare const S256_CHALLENGE_LENGTH = 43; /** * Regex pattern for valid code_verifier characters (RFC 7636) */ export declare const VERIFIER_PATTERN: RegExp; /** * Validates a code_verifier format * * @param verifier - The code_verifier to validate * @returns True if format is valid */ export declare function isValidVerifierFormat(verifier: string): boolean; /** * Validates a code_challenge format * * @param challenge - The code_challenge to validate * @returns True if format is valid */ export declare function isValidChallengeFormat(challenge: string): boolean; /** * Generates a cryptographically valid code_challenge from a verifier * * @param verifier - The code_verifier * @returns Base64URL encoded SHA256 hash */ export declare function generateCodeChallenge(verifier: string): Promise; //# sourceMappingURL=pkce.d.ts.map