0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-08 02:54:13 -05:00

feat: add legacyMergeConfigs as option (#5177)

This commit is contained in:
Juan Picado 2025-03-31 22:19:53 +02:00 committed by GitHub
parent bf566cb6f5
commit 1f25d5f5e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/auth': patch
---
feat: add legacyMergeConfigs as option

View file

@ -59,12 +59,14 @@ class Auth implements IAuthMiddleware, TokenEncryption, pluginUtils.IBasicAuth {
public secret: string;
public logger: Logger;
public plugins: pluginUtils.Auth<Config>[];
public options: { legacyMergeConfigs: boolean };
public constructor(config: Config, logger: Logger) {
public constructor(config: Config, logger: Logger, options = { legacyMergeConfigs: false }) {
this.config = config;
this.secret = config.secret;
this.logger = logger;
this.plugins = [];
this.options = options;
if (!this.secret) {
throw new TypeError('secret it is required value on initialize the auth class');
}
@ -123,7 +125,7 @@ class Auth implements IAuthMiddleware, TokenEncryption, pluginUtils.IBasicAuth {
typeof allow_publish !== 'undefined'
);
},
false,
this.options.legacyMergeConfigs,
this.config?.serverSettings?.pluginPrefix,
PLUGIN_CATEGORY.AUTHENTICATION
);