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:
parent
bf566cb6f5
commit
1f25d5f5e8
2 changed files with 9 additions and 2 deletions
5
.changeset/large-turkeys-change.md
Normal file
5
.changeset/large-turkeys-change.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@verdaccio/auth': patch
|
||||
---
|
||||
|
||||
feat: add legacyMergeConfigs as option
|
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue