import { Constructor, Provider } from '@loopback/context'; import { EntityWithIdentifier, IAuthUser, VerifyFunction } from 'loopback4-authentication'; import { PublicKeysRepository, RevokedTokenRepository } from '../../../repositories'; import { ILogger } from '../../logger-extension'; export declare class FacadesBearerAsymmetricTokenVerifyProvider implements Provider { revokedTokenRepository: RevokedTokenRepository; publicKeysRepository: PublicKeysRepository; private readonly logger; authUserModel?: Constructor | undefined; constructor(revokedTokenRepository: RevokedTokenRepository, publicKeysRepository: PublicKeysRepository, logger: ILogger, authUserModel?: Constructor | undefined); /** * The function returns a BearerFn that verifies a token, checks if it is revoked, verifies the token * to get the user, and checks the password expiry before returning the authenticated user. * @returns The `value()` function is returning a `BearerFn` function that takes a token and an * optional request object as parameters. Inside the function, it first checks if the token is * revoked, then verifies the token and retrieves the user information. After that, it checks the * password expiry for the user. Finally, it returns either a new instance of `authUserModel` with * the user data or the */ value(): VerifyFunction.BearerFn; /** * The function `_checkIfTokenRevoked` checks if a token is revoked and throws an error if it is. * @param {string} token - The `token` parameter in the `_checkIfTokenRevoked` function is a string * that represents the token being checked for revocation. This token is used to query the * `revokedTokenRepository` to determine if it has been revoked. If the token is found to be revoked, * an ` */ private _checkIfTokenRevoked; /** * The function `_verifyTokenAndGetUser` verifies a token, decodes it, retrieves the corresponding * key, and then verifies the token's authenticity using the key. * @param {string} token - The `token` parameter in the `_verifyTokenAndGetUser` function is a string * that represents the JWT (JSON Web Token) that needs to be verified and decoded to extract user * information and permissions. * @returns The function `_verifyTokenAndGetUser` is returning a Promise that resolves to an object * of type `IAuthUserWithPermissions`. This object likely contains information about the * authenticated user along with their permissions. The function first decodes the JWT token, * retrieves the key associated with the token, verifies the token using the key, and finally returns * the decoded user information if the verification is successful. If any errors */ private _verifyTokenAndGetUser; /** * The function `_checkPasswordExpiry` checks if a user's password has expired based on the * `passwordExpiryTime` property in the `user` object. * @param {IAuthUserWithPermissions} user - The `user` parameter is of type * `IAuthUserWithPermissions`, which likely represents a user object with authentication-related * properties and permissions. In this specific function `_checkPasswordExpiry`, it checks if the * `user` object has a `passwordExpiryTime` property set and if the current */ private _checkPasswordExpiry; }