71 lines
No EOL
3.4 KiB
TypeScript
71 lines
No EOL
3.4 KiB
TypeScript
import { Activity } from 'botframework-schema';
|
|
import { AuthenticateRequestResult } from './authenticateRequestResult';
|
|
import type { BotFrameworkClient } from '../skills';
|
|
import { ClaimsIdentity } from './claimsIdentity';
|
|
import type { ConnectorFactory } from './connectorFactory';
|
|
import type { ServiceClientCredentialsFactory } from './serviceClientCredentialsFactory';
|
|
import type { UserTokenClient } from './userTokenClient';
|
|
/**
|
|
* Represents a Cloud Environment used to authenticate Bot Framework Protocol network calls within this environment.
|
|
*/
|
|
export declare abstract class BotFrameworkAuthentication {
|
|
/**
|
|
* Validate Bot Framework Protocol requests.
|
|
*
|
|
* @param activity The inbound Activity.
|
|
* @param authHeader The HTTP auth header.
|
|
* @returns {Promise<AuthenticateRequestResult>} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult).
|
|
*/
|
|
abstract authenticateRequest(activity: Activity, authHeader: string): Promise<AuthenticateRequestResult>;
|
|
/**
|
|
* Validate Bot Framework Protocol requests.
|
|
*
|
|
* @param authHeader The HTTP auth header.
|
|
* @param channelIdHeader The channel ID HTTP header.
|
|
* @returns {Promise<AuthenticateRequestResult>} An [AuthenticateRequestResult](xref:botframework-connector.AuthenticateRequestResult).
|
|
*/
|
|
abstract authenticateStreamingRequest(authHeader: string, channelIdHeader: string): Promise<AuthenticateRequestResult>;
|
|
/**
|
|
* Creates a ConnectorFactory that can be used to create ConnectorClients that can use credentials from this particular Cloud Environment.
|
|
*
|
|
* @param claimsIdentity The inbound Activity's ClaimsIdentity.
|
|
* @returns A [ConnectorFactory](xref:botframework-connector.ConnectorFactory).
|
|
*/
|
|
abstract createConnectorFactory(claimsIdentity: ClaimsIdentity): ConnectorFactory;
|
|
/**
|
|
* Creates the appropriate UserTokenClient instance.
|
|
*
|
|
* @param claimsIdentity The inbound Activity's ClaimsIdentity.
|
|
* @returns {Promise<UserTokenClient>} An [UserTokenClient](xref:botframework-connector.UserTokenClient).
|
|
*/
|
|
abstract createUserTokenClient(claimsIdentity: ClaimsIdentity): Promise<UserTokenClient>;
|
|
/**
|
|
* Creates a BotFrameworkClient for calling Skills.
|
|
*
|
|
* @returns A [BotFrameworkClient](xref:botframework-connector.BotFrameworkClient).
|
|
*/
|
|
createBotFrameworkClient(): BotFrameworkClient;
|
|
/**
|
|
* Gets the originating audience from Bot OAuth scope.
|
|
*
|
|
* @returns The originating audience.
|
|
*/
|
|
getOriginatingAudience(): string;
|
|
/**
|
|
* Authenticate Bot Framework Protocol request to Skills.
|
|
*
|
|
* @param authHeader The HTTP auth header in the skill request.
|
|
* @returns {Promise<ClaimsIdentity>} A [ClaimsIdentity](xref:botframework-connector.ClaimsIdentity).
|
|
*/
|
|
authenticateChannelRequest(authHeader: string): Promise<ClaimsIdentity>;
|
|
/**
|
|
* Generates the appropriate callerId to write onto the Activity, this might be null.
|
|
*
|
|
* @param credentialFactory A ServiceClientCredentialsFactory to use.
|
|
* @param claimsIdentity The inbound claims.
|
|
* @param callerId The default callerId to use if this is not a skill.
|
|
* @returns The callerId, this might be null.
|
|
*/
|
|
protected generateCallerId(credentialFactory: ServiceClientCredentialsFactory, claimsIdentity: ClaimsIdentity, callerId: string): Promise<string | null>;
|
|
}
|
|
//# sourceMappingURL=botFrameworkAuthentication.d.ts.map
|