import { BindingKey , MetadataAccessor } from '@loopback/core' ; import { SecurityBindings , UserProfile } from '@loopback/security' ; import { Middleware } from '@loopback/rest' ; import { AuthenticationComponent } from './authentication.component' ; import { AuthenticateFn , AuthenticationMetadata , AuthenticationStrategy , UserProfileFactory , } from './types' ; /**
 * Binding keys used by this component.
 */ export namespace AuthenticationBindings { export const COMPONENT = BindingKey . create < AuthenticationComponent > ( 'components.AuthenticationComponent' ) ; example export const USER_PROFILE_FACTORY = BindingKey . create < UserProfileFactory < any > > ( 'authentication.userProfileFactory' ) ; example export const STRATEGY = BindingKey . create < AuthenticationStrategy | AuthenticationStrategy [ ] | undefined > ( 'authentication.strategy' ) ; example inject export const AUTH_ACTION = BindingKey . create < AuthenticateFn > ( 'authentication.actions.authenticate' ) ; /**
     * Binding key for AUTHENTICATION_MIDDLEWARE
     */ export const AUTHENTICATION_MIDDLEWARE = BindingKey . create < Middleware > ( 'middleware.authentication' ) ; example inject export const METADATA = BindingKey . create < AuthenticationMetadata [ ] | undefined > ( 'authentication.operationMetadata' ) ; export const AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME = 'authentication.strategies' ; export const CURRENT_USER = SecurityBindings . USER ; export const AUTHENTICATION_REDIRECT_URL = BindingKey . create < string > ( 'authentication.redirect.url' ) ; export const AUTHENTICATION_REDIRECT_STATUS = BindingKey . create < number > ( 'authentication.redirect.status' ) ; } /**
 * The key used to store method-level metadata for `@authenticate`
 */ export const AUTHENTICATION_METADATA_METHOD_KEY = MetadataAccessor . create < AuthenticationMetadata , MethodDecorator > ( 'authentication:method' ) ; /**
 * Alias for AUTHENTICATION_METADATA_METHOD_KEY to keep it backward compatible
 */ export const AUTHENTICATION_METADATA_KEY = AUTHENTICATION_METADATA_METHOD_KEY ; /**
 * The key used to store class-level metadata for `@authenticate`
 */ export const AUTHENTICATION_METADATA_CLASS_KEY = MetadataAccessor . create < AuthenticationMetadata , ClassDecorator > ( 'authentication:class' ) ;