/// /// import * as q from 'q'; import * as express from 'express'; import { OAuthConfig, Token } from './types'; /** * Returns a promise containing the file content as json object. * * @param filePath * @param fileName * @returns {Promise} */ export declare function getFileData(filePath: string, fileName: string): q.Promise; /** * Returns the value of a specified header field from a request * * @param req * @param field The name of the field to return * @returns {string} The value of the header field */ export declare function getHeaderValue(req: express.Request, fieldName: string): string; /** * Returns a basic authentication header value with the given credentials * * @param client_id * @param client_secret * @returns {string} */ export declare function getBasicAuthHeaderValue(clientId: string, clientSecret: string): string; /** * Extracts and returns an access_token from an authorization header * * @param authHeader * @returns {any} */ export declare function extractAccessToken(authHeader: string): string; /** * Attach scopes on the req object for later validation. * * @param req * @returns {function(any): undefined} */ export declare function setTokeninfo(req: express.Request): (data: Token) => void; /** * Reject a request with 401 or the given status code. * * @param res * @param status */ export declare function rejectRequest(res: express.Response, status?: number): void; /** * Validates options object and throws TypeError if mandatory options is not specified. * * @param options */ export declare function validateOAuthConfig(options: OAuthConfig): void;