import { ITokenValidator, Validator, IDidResolver, Requestor } from '../index'; import { Crypto } from '../index'; import { IssuerMap } from '../options/IExpected'; import IFetchRequest from '../tracing/IFetchRequest'; /** * Class to build a token validator */ export default class ValidatorBuilder { private _crypto; private _tokenValidators; private _resolver; private _trustedIssuersForVerifiableCredentials; private _trustedIssuerConfigurationsForIdTokens; private _audienceUrl; private _requestor; private _state; private _nonce; private _fetchRequest; /** * Create a new instance of ValidatorBuilder * @param _crypto The crypto object */ constructor(_crypto: Crypto); /** * Gets the crypto object */ get crypto(): Crypto; /** * Build the validator */ build(): Validator; /** * Sets the state * @param state The state for the response * @returns The validator builder */ useState(state: string): ValidatorBuilder; /** * Get the state for the response */ get state(): string | undefined; /** * Sets the nonce * @param nonce The nonce for the response * @returns The validator builder */ useNonce(nonce: string): ValidatorBuilder; /** * Get the nonce for the response */ get nonce(): string | undefined; /** * Feed the request definition to automatically define the validation rules * @param requestor The request definition */ useRequestor(requestor: Requestor): ValidatorBuilder; /** * Gets the requestor */ get requestor(): Requestor | undefined; /** * Sets the token validator * @param validator The token validator * @returns The validator builder */ useValidators(validators: ITokenValidator[] | ITokenValidator): ValidatorBuilder; /** * Gets the token validators */ get tokenValidators(): { [type: string]: ITokenValidator; }; /** * Specify the fetch client for the validator * @param fetchRequest New fetch client */ useFetchRequest(fetchRequest: IFetchRequest): ValidatorBuilder; /** * Gets the fetch client */ get fetchRequest(): IFetchRequest; /** * Specify the resolver of the validator * @param resolver New resolver */ useResolver(resolver: IDidResolver): ValidatorBuilder; /** * Gets the resolver */ get resolver(): IDidResolver; /** * Specify the trusted issuer for the verifiable credentialsrush rebuild * * @param issuers array of issuers */ useTrustedIssuersForVerifiableCredentials(issuers: { [credentialType: string]: string[]; }): ValidatorBuilder; /** * Specify the trusted issuer for the verifiable credentials * @param issuers array of issuers or dictionary mapped to credential type */ get trustedIssuersForVerifiableCredentials(): { [credentialType: string]: string[]; } | undefined; /** * Specify the trusted issuer configuration endpoints for the OpenID Connect providers * @param issuers array of issuers */ useTrustedIssuerConfigurationsForIdTokens(issuers: IssuerMap): ValidatorBuilder; /** * Specify the trusted issuer for the verifiable credentials * @param issuers array of issuers */ get trustedIssuerConfigurationsForIdTokens(): IssuerMap | undefined; /** * Specify the audience url of the validator * @param audience url of the validator */ useAudienceUrl(audience: string): ValidatorBuilder; /** * Specify the trusted issuer for the verifiable credentials * @param issuers array of issuers */ get audienceUrl(): string | undefined; private _enableVerifiedCredentialsStatusCheck; get featureVerifiedCredentialsStatusCheckEnabled(): boolean; enableFeatureVerifiedCredentialsStatusCheck(enable: boolean): ValidatorBuilder; }