import { Authentication , authenticationSchema } from '@mia-platform/core' ; import { DecoratedFastify , Handler } from '@mia-platform/custom-plugin-lib' ; import { readValidateConfiguration } from '../utils/configurationManager' ; const readAuthenticationConfiguration = async ( fastifyInstance ) => { const configurationPath = fastifyInstance . config . AUTHENTICATION_CONFIGURATION_PATH || '' ; const validateConfiguration = await readValidateConfiguration ( configurationPath , authenticationSchema ) ; return validateConfiguration as Authentication ; } ; export const authenticationApiHandlerBuilder = async ( fastifyInstance ) => { const configuration = await readAuthenticationConfiguration ( fastifyInstance ) ; return ( _ , reply ) => { reply . send ( configuration ) ; } ; } ; export const authenticationApiSchema = { summary : 'Expose the authentication configuration for micro-lc' , response : { 200 : authenticationSchema , } , } as const ;