@eclipse-ditto/ditto-javascript-client-dom
Version:
DOM implementation of Eclipse Ditto JavaScript API to be used in browsers.
72 lines • 2.77 kB
TypeScript
/*!
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
import { Base64Encoder, BasicAuth, HttpBasicAuth } from '../../api/src/auth/basic-auth';
import { HttpBearerAuth, TokenSupplier } from '../../api/src/auth/bearer-auth';
import { DittoHeaders, DittoURL } from '../../api/src/auth/auth-provider';
/**
* Dom implementation of a Base64 encoder.
*/
export declare class DomBase64Encoder implements Base64Encoder {
encodeBase64(toEncode: string): string;
}
/**
* Dom implementation of basic auth for HTTP connections.
*/
export declare class DomHttpBasicAuth extends HttpBasicAuth {
private constructor();
/**
* Create basic authentication for HTTP connections.
* @param username - The username.
* @param password - the password.
*/
static newInstance(username: string, password: string): BasicAuth;
}
/**
* Dom implementation of basic auth for WebSocket connections.
*/
export declare class DomWebSocketBasicAuth extends BasicAuth {
private constructor();
/**
* Create basic authentication for Http connections.
* @param username - The username.
* @param password - the password.
*/
static newInstance(username: string, password: string): BasicAuth;
authenticateWithHeaders(originalHeaders: DittoHeaders): DittoHeaders;
authenticateWithUrl(originalUrl: DittoURL): DittoURL;
}
/**
* DOM implementation of bearer authentication for HTTP connections
*/
export declare class DomHttpBearerAuth extends HttpBearerAuth {
constructor(tokenSupplier: TokenSupplier);
/**
* Create a new AuthProvider for bearer token authentication over http
* @param tokenSupplier Provides auth tokens to this AuthProvider when needed
*/
static newInstance(tokenSupplier: TokenSupplier): DomHttpBearerAuth;
}
/**
* DOM implementation of bearer authentication for WebSocket connections
*/
export declare class DomWebSocketBearerAuth extends HttpBearerAuth {
constructor(tokenSupplier: TokenSupplier);
/**
* Create a new AuthProvider for bearer token authentication over WebSocket
* @param tokenSupplier Provides auth tokens to this AuthProvider when needed
*/
static newInstance(tokenSupplier: TokenSupplier): DomWebSocketBearerAuth;
authenticateWithUrl(originalUrl: DittoURL): DittoURL;
authenticateWithHeaders(originalHeaders: DittoHeaders): DittoHeaders;
}
//# sourceMappingURL=dom-auth.d.ts.map