/** * Pure functions to generate OAuth 2.1 metadata responses. * These generators produce the JSON payloads for OAuth discovery endpoints * without any framework dependencies, making them reusable across different HTTP servers. */ import { type EnvironmentName } from '../../environments.js'; import type { OAuthUrls, OAuthConfig, ProtectedResourceMetadata, McpProtectedResourceMetadata, AuthorizationServerMetadata, OidcConfiguration } from '../types/http.types.js'; /** * Get OAuth URLs for a given environment with optional overrides. * * @param environment - The Nevermined environment name * @param overrides - Optional partial overrides for specific URLs * @returns Complete OAuth URLs configuration */ export declare function getOAuthUrls(environment: EnvironmentName, overrides?: Partial): OAuthUrls; /** * Build Protected Resource Metadata (RFC 9728). * This metadata tells OAuth clients about the protected resource. * * @param config - OAuth configuration * @returns Protected Resource Metadata response object * * @example * ```typescript * const metadata = buildProtectedResourceMetadata({ * baseUrl: 'http://localhost:5001', * agentId: 'agent_123', * environment: 'staging_sandbox' * }) * // Returns: { resource: 'http://localhost:5001', authorization_servers: [...], ... } * ``` */ export declare function buildProtectedResourceMetadata(config: OAuthConfig): ProtectedResourceMetadata; /** * Build MCP-specific Protected Resource Metadata. * Extends the base metadata with MCP capabilities information. * * @param config - OAuth configuration * @returns MCP Protected Resource Metadata response object * * @example * ```typescript * const metadata = buildMcpProtectedResourceMetadata({ * baseUrl: 'http://localhost:5001', * agentId: 'agent_123', * environment: 'staging_sandbox', * tools: ['hello_world', 'weather'] * }) * ``` */ export declare function buildMcpProtectedResourceMetadata(config: OAuthConfig): McpProtectedResourceMetadata; /** * Build OAuth Authorization Server Metadata (RFC 8414). * This metadata describes the OAuth authorization server configuration. * * @param config - OAuth configuration * @returns Authorization Server Metadata response object * * @example * ```typescript * const metadata = buildAuthorizationServerMetadata({ * baseUrl: 'http://localhost:5001', * agentId: 'agent_123', * environment: 'staging_sandbox' * }) * ``` */ export declare function buildAuthorizationServerMetadata(config: OAuthConfig): AuthorizationServerMetadata; /** * Build OpenID Connect Discovery Metadata. * Provides OIDC-compatible configuration for clients that expect OpenID Connect. * * @param config - OAuth configuration * @returns OIDC Configuration response object * * @example * ```typescript * const metadata = buildOidcConfiguration({ * baseUrl: 'http://localhost:5001', * agentId: 'agent_123', * environment: 'staging_sandbox' * }) * ``` */ export declare function buildOidcConfiguration(config: OAuthConfig): OidcConfiguration; /** * Build server info response for the root endpoint. * * @param config - OAuth configuration * @param options - Additional options for the server info * @returns Server info response object */ export declare function buildServerInfoResponse(config: OAuthConfig, options?: { version?: string; description?: string; }): { name: string; version: string; description: string; endpoints: Record; oauth: Record; tools: string[]; resources: string[]; prompts: string[]; }; //# sourceMappingURL=oauth-metadata.d.ts.map