UNPKG

1.86 kBTypeScriptView Raw
1import type { ODataRequest, ODataRequestConfig } from '../../odata-common';
2import { Destination } from './destination';
3/**
4 * @deprecated Since v1.20.0. Use [[buildAuthorizationHeaders]] instead.
5 * Adds authorization headers for a given ODataRequest to existing headers.
6 * @param request - an ODataRequest.
7 * @param headers - The headers that should be added to.
8 * @returns The provided headers with the new authorization headers.
9 */
10export declare function addAuthorizationHeader<RequestT extends ODataRequestConfig>(request: ODataRequest<RequestT>, headers: Record<string, string>): Promise<Record<string, string>>;
11export declare function getAuthHeaders(destination: Destination, customHeaders?: Record<string, any>): Promise<AuthenticationHeaders>;
12/**
13 * @deprecated Since v1.20.0. Use [[buildAuthorizationHeaders]] instead.
14 * Adds authorization headers for a given destination to existing headers.
15 * @param destination - A destination.
16 * @param headers - The headers that should be added to.
17 * @returns The provided headers with the new authorization headers.
18 */
19export declare function buildAndAddAuthorizationHeader(destination: Destination): (headers: Record<string, any>) => Promise<Record<string, string>>;
20export declare function basicHeader(username: string, password: string): string;
21interface AuthenticationHeaderCloud {
22 authorization: string;
23}
24interface AuthenticationHeaderOnPrem {
25 'SAP-Connectivity-Authentication': string;
26}
27interface AuthenticationHeaders {
28 authorization?: string;
29 'Proxy-Authorization'?: string;
30 'SAP-Connectivity-Authentication'?: string;
31}
32export declare function buildAuthorizationHeaders(destination: Destination, customAuthHeader?: AuthenticationHeaderCloud | AuthenticationHeaderOnPrem): Promise<AuthenticationHeaders>;
33export {};
34//# sourceMappingURL=authorization-header.d.ts.map
\No newline at end of file