@sap-cloud-sdk/connectivity
Version:
SAP Cloud SDK for JavaScript connectivity
36 lines (35 loc) • 1.33 kB
TypeScript
import type { AuthenticationType, Destination } from './destination';
/**
* @internal
* Get an authentication header from given custom headers.
* @param authenticationType - The authentication type of a destination
* @param customHeaders - Custom headers.
* @returns An authentication header.
*/
export declare function getAuthHeader(authenticationType: AuthenticationType | undefined, customHeaders?: Record<string, any>): AuthenticationHeaderOnPrem | AuthenticationHeaderCloud | undefined;
/**
* @internal
* @param username - The username
* @param password - The password
* @returns basic header as string
*/
export declare function basicHeader(username: string, password: string): string;
interface AuthenticationHeaderCloud {
authorization: string;
}
interface AuthenticationHeaderOnPrem {
'SAP-Connectivity-Authentication': string;
}
interface AuthenticationHeaders {
authorization?: string;
'Proxy-Authorization'?: string;
'SAP-Connectivity-Authentication'?: string;
}
/**
* @param destination - Destination from which headers are build
* @param customAuthHeader - Additional custom headers
* @returns authorization - headers build from destination
* @internal
*/
export declare function buildAuthorizationHeaders(destination: Destination): Promise<AuthenticationHeaders>;
export {};