UNPKG

@sap/xssec

Version:

XS Advanced Container Security API for node.js

72 lines 3.99 kB
export = XsaService; /** * @typedef {import('../util/Types').ServiceCredentials} ServiceCredentials * @typedef {import('../util/Types').XsaServiceCredentials} XsaServiceCredentials * @typedef {import('../util/Types').ServiceConfig} ServiceConfig * @typedef {import('../util/Types').SecurityContextConfig} SecurityContextConfig * @typedef {import('../util/Types').TokenFetchOptions} TokenFetchOptions * @typedef {import('../util/Types').TokenFetchResponse} TokenFetchResponse * @typedef {import('../util/Types').RefreshableTokenFetchResponse} RefreshableTokenFetchResponse * @typedef {import('../util/Types').GrantType} GrantType */ /** * New SAP BTP applications should start with SAP Identity Services instead of XSA! See README for details.\ * This {@link Service} class is constructed from XSA credentials to provide an API with selected functionality against that XSA service instance, e.g. token validation and token fetches. */ declare class XsaService extends XsuaaService { /** * @param {ServiceCredentials & XsaServiceCredentials} credentials * @param {ServiceConfig} [serviceConfig={}] */ constructor(credentials: ServiceCredentials & XsaServiceCredentials, serviceConfig?: ServiceConfig); /** * @override * @param {String|XsaToken} token token as JWT or XsaToken object * @param {SecurityContextConfig} contextConfig * @returns {Promise<XsaSecurityContext>} */ override createSecurityContext(token: string | XsaToken, contextConfig?: SecurityContextConfig): Promise<XsaSecurityContext>; validateTokenSignature(token: any, contextConfig: any): Promise<void>; /** * Fetches a token from this service with this service's client credentials. * @param {TokenFetchOptions} options * @returns {Promise<TokenFetchResponse>} response */ fetchClientCredentialsToken(options?: TokenFetchOptions): Promise<TokenFetchResponse>; /** * Fetches a user token from this service with the given username and password. * @param {String} username * @param {String} password * @param {TokenFetchOptions} options * @returns {Promise<TokenFetchResponse & RefreshableTokenFetchResponse>} response */ fetchPasswordToken(username: string, password: string, options?: TokenFetchOptions): Promise<TokenFetchResponse & RefreshableTokenFetchResponse>; /** * Fetches a JWT bearer token from this service with the given user token as assertion. * @param {String} assertion JWT bearer token used as assertion * @param {TokenFetchOptions} options * @returns {Promise<TokenFetchResponse & RefreshableTokenFetchResponse>} response */ fetchJwtBearerToken(assertion: string, options?: TokenFetchOptions): Promise<TokenFetchResponse & RefreshableTokenFetchResponse>; /** * Determines the URL that can be used for fetching tokens from this service. * @param {GrantType} grant_type */ getTokenUrl(grant_type: GrantType): Promise<URL>; #private; } declare namespace XsaService { export { ServiceCredentials, XsaServiceCredentials, ServiceConfig, SecurityContextConfig, TokenFetchOptions, TokenFetchResponse, RefreshableTokenFetchResponse, GrantType }; } import XsuaaService = require("./XsuaaService"); import XsaToken = require("../token/XsaToken"); import XsaSecurityContext = require("../context/XsaSecurityContext"); type ServiceCredentials = import("../util/Types").ServiceCredentials; type XsaServiceCredentials = import("../util/Types").XsaServiceCredentials; type ServiceConfig = import("../util/Types").ServiceConfig; type SecurityContextConfig = import("../util/Types").SecurityContextConfig; type TokenFetchOptions = import("../util/Types").TokenFetchOptions; type TokenFetchResponse = import("../util/Types").TokenFetchResponse; type RefreshableTokenFetchResponse = import("../util/Types").RefreshableTokenFetchResponse; type GrantType = import("../util/Types").GrantType; //# sourceMappingURL=XsaService.d.ts.map