Add gateway-first pattern: when AGILITON_API_KEY is set, route all external API calls through the gateway with X-API-Key auth. Falls back to direct API access when gateway is unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 lines
453 B
JavaScript
7 lines
453 B
JavaScript
import { isObject } from './is_object.js';
|
|
export const isJWK = (key) => isObject(key) && typeof key.kty === 'string';
|
|
export const isPrivateJWK = (key) => key.kty !== 'oct' &&
|
|
((key.kty === 'AKP' && typeof key.priv === 'string') || typeof key.d === 'string');
|
|
export const isPublicJWK = (key) => key.kty !== 'oct' && key.d === undefined && key.priv === undefined;
|
|
export const isSecretJWK = (key) => key.kty === 'oct' && typeof key.k === 'string';
|