/** * Service Key Constants and Utilities * * Centralized definitions for service-to-service authentication keys, * endpoint access rules, and utility functions for service key management. */ import { ServiceKeyConfig, ServiceKeyRegistry, ServiceKeyData, EndpointAuthRule } from './types'; /** * Registry of all service keys in the system * * Each service key defines authentication and authorization rules * for service-to-service communication. */ export declare const SERVICE_KEYS: ServiceKeyRegistry; /** * Endpoint authentication rules * * Defines which authentication modes are required for specific endpoints. */ export declare const ENDPOINT_AUTH_RULES: Record; /** * Get service key configuration by key type */ export declare function getServiceKeyConfig(keyType: keyof ServiceKeyRegistry): ServiceKeyConfig; /** * Get all service key emails for validation */ export declare function getAllServiceKeyEmails(): string[]; /** * Find service key type by email */ export declare function findServiceKeyByEmail(email: string): keyof ServiceKeyRegistry | null; /** * Check if an email belongs to a service key */ export declare function isServiceKeyEmail(email: string): boolean; /** * Check if a service key is authorized for a specific endpoint */ export declare function isServiceKeyAuthorizedForEndpoint(serviceKeyType: keyof ServiceKeyRegistry, endpoint: string): boolean; /** * Get authentication rule for an endpoint */ export declare function getEndpointAuthRule(endpoint: string): EndpointAuthRule | null; /** * Create service key data structure for database operations */ export declare function createServiceKeyData(serviceKeyType: keyof ServiceKeyRegistry, apiKey?: string): ServiceKeyData; /** * Generate a new service API key * * Format: sk-{48 hex characters} (same as admin service pattern) */ export declare function generateServiceApiKey(): string; /** * Validate service API key format */ export declare function isValidServiceApiKeyFormat(key: string): boolean; /** * Check if endpoint requires standalone mode only */ export declare function requiresStandaloneOnly(endpoint: string): boolean; /** * Check if endpoint allows service key authentication */ export declare function allowsServiceKeyAuth(endpoint: string): boolean; /** * Get required service key type for an endpoint */ export declare function getRequiredServiceKeyType(endpoint: string): keyof ServiceKeyRegistry | null; /** * Validate service key permissions for endpoint */ export declare function validateServiceKeyPermissions(serviceKeyType: keyof ServiceKeyRegistry, endpoint: string, requiredPermissions?: string[]): boolean;