import { TokenType , IExpectedIdToken , ITokenValidator , ClaimToken , ValidationError } from '../index' ; import { IValidationResponse } from '../input_validation/IValidationResponse' ; import ValidationOptions from '../options/ValidationOptions' ; import IValidatorOptions from '../options/IValidatorOptions' ; import { IdTokenValidation } from '../input_validation/IdTokenValidation' ; import ValidationQueue from '../input_validation/ValidationQueue' ; import ValidationQueueItem from '../input_validation/ValidationQueueItem' ; import ErrorHelpers from '../error_handling/ErrorHelpers' ; const errorCode = ( error ) => ErrorHelpers . errorCode ( 'VCSDKIDTV' , error ) ; /**
 * Class to validate a token
 */ export default class IdTokenTokenValidator implements ITokenValidator { param validatorOption param expected constructor ( private validatorOption , private expected ) { } param queue param queueItem param siopDid param siopContract public async validate ( _queue , queueItem , _siopDid , siopContract ) { const options = new ValidationOptions ( this . validatorOption , TokenType . idToken ) ; const validator = new IdTokenValidation ( options , this . expected , siopContract ) ; const validationResult = await validator . validate ( queueItem . tokenToValidate ) ; return validationResult as IValidationResponse ; } param validationResponse param queue public getTokens ( _validationResponse , _queue ) { throw new ValidationError ( `Not implemented` , errorCode ( 1 ) ) ; } /**
     * Gets the type of token to validate
     */ public get isType ( ) : TokenType { return TokenType . idToken ; } }