UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

12 lines 826 B
export const userTokenClientApiLogger = ({ getLogger, flagResolver, }) => { return async (req, res, next) => { const logger = getLogger('/middleware/user-token-client-api-logger-middleware.ts'); const apiToken = req.header('authorization'); if ((apiToken?.startsWith('user:') || apiToken?.startsWith('*:*.')) && !flagResolver.isEnabled('userTokenWithClientApiLoggingKillSwitch')) { logger.info('In the next version update, calling API endpoints under /api/client/ using Personal Access Tokens and Service Accounts will no longer be supported. Please update your integrations to use the new supported authentication method before upgrading to avoid service disruption.'); } next(); }; }; //# sourceMappingURL=user-token-client-api-logger-middleware.js.map