@atproto/oauth-client
Version:
OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).
25 lines • 1.37 kB
TypeScript
import { type OAuthAuthorizationServerMetadata } from '@atproto/oauth-types';
import { type Fetch } from '@atproto-labs/fetch';
import { CachedGetter, type GetCachedOptions, type SimpleStore, type StoreErrorHandler } from '@atproto-labs/simple-store';
export type { GetCachedOptions, OAuthAuthorizationServerMetadata };
export type AuthorizationServerMetadataCache = SimpleStore<string, OAuthAuthorizationServerMetadata>;
export type OAuthAuthorizationServerMetadataResolverConfig = {
allowHttpIssuer?: boolean;
/**
* Called when the metadata cache throws. The cache is best-effort: failures
* are logged (by default) and degrade to a cache miss + refetch, rather than
* being propagated.
*/
onCacheError?: StoreErrorHandler<string>;
};
/**
* @see {@link https://datatracker.ietf.org/doc/html/rfc8414}
*/
export declare class OAuthAuthorizationServerMetadataResolver extends CachedGetter<string, OAuthAuthorizationServerMetadata> {
private readonly fetch;
private readonly allowHttpIssuer;
constructor(cache: AuthorizationServerMetadataCache, fetch?: Fetch, config?: OAuthAuthorizationServerMetadataResolverConfig);
get(input: URL | string, options?: GetCachedOptions): Promise<OAuthAuthorizationServerMetadata>;
private fetchMetadata;
}
//# sourceMappingURL=oauth-authorization-server-metadata-resolver.d.ts.map