import { AuthenticatedRoute, ClientRequestAuth, HttpOptions, TokenType, Tokens } from '../providers'; /** * D4H API Authentication * ============================================================================= * API requests are signed with an approprate bearer token. This service * determines the appropriate token based on the passed configuration and path. * Populates appropriate token if required by the API, based on config and URL. * * 1. Determine if route is authenticated. * 2. If token required, check whether the appropriate header has already been * set in options. TeamService and PhotoService#membership both require * this, because their methods employ the token of the passed team. * 3. Else if token required, try to fetch it. * 4. If token exists, set it as bearer header. * 5. If unable to fetch token, throw error. */ export declare class MissingTokenError extends Error { constructor(url: string); } export declare class AuthClient implements ClientRequestAuth { private readonly routes; constructor(routes: Array); bearerToken(tokens: Tokens, url: string, options?: HttpOptions): { Authorization: string; }; getToken(tokens: Tokens, tokenType: TokenType): string; private tokenType; }