Skip to main content
Version: Next

Class: Config

Coordinates the application configuration

Implements

  • Config

Constructors

constructor

new Config(config, configOverrideOptions?)

Parameters

NameTypeDefault value
configConfigYaml & { config_path: string }undefined
configOverrideOptionsObjectundefined
configOverrideOptions.forceMigrateToSecureLegacySignaturebooleantrue

Defined in

config.ts:71

Properties

auth

auth: any

Implementation of

AppConfig.auth

Defined in

config.ts:54


configOverrideOptions

Private configOverrideOptions: Object

Type declaration

NameType
forceMigrateToSecureLegacySignatureboolean

Defined in

config.ts:66


configPath

configPath: string

Implementation of

AppConfig.configPath

Defined in

config.ts:56


flags

flags: FlagsConfig

Implementation of

AppConfig.flags

Defined in

config.ts:69


packages

packages: PackageList

Implementation of

AppConfig.packages

Defined in

config.ts:52


plugins

plugins: null | string | void

Implementation of

AppConfig.plugins

Defined in

config.ts:63


secret

secret: string

Implementation of

AppConfig.secret

Defined in

config.ts:68


security

security: Security

Implementation of

AppConfig.security

Defined in

config.ts:64


self_path

self_path: string

Deprecated

use configPath or config.getConfigPath();

Implementation of

AppConfig.self_path

Defined in

config.ts:60


serverSettings

serverSettings: ServerSettingsConf

Defined in

config.ts:65


server_id

server_id: string

Implementation of

AppConfig.server_id

Defined in

config.ts:55


storage

storage: string | void

Implementation of

AppConfig.storage

Defined in

config.ts:61


uplinks: any

Implementation of

AppConfig.uplinks

Defined in

config.ts:51


userRateLimit

userRateLimit: RateLimit

Implementation of

AppConfig.userRateLimit

Defined in

config.ts:70


user_agent

user_agent: undefined | string

Implementation of

AppConfig.user_agent

Defined in

config.ts:50


users

users: any

Defined in

config.ts:53

Methods

checkSecretKey

checkSecretKey(secret?): string

Verify if the secret complies with the required structure

  • If the secret is not provided, it will generate a new one
    • For any Node.js version the new secret will be 32 characters long (to allow compatibility with modern Node.js versions)
  • If the secret is provided:
    • If Node.js 22 or higher, the secret must be 32 characters long thus the application will fail on startup
    • If Node.js 21 or lower, the secret will be used as is but will display a deprecation warning
    • If the property security.api.migrateToSecureLegacySignature is provided and set to true, the secret will be generated with the new signature model

Secret

external secret key

Parameters

NameType
secret?string

Returns

string

Implementation of

AppConfig.checkSecretKey

Defined in

config.ts:181


getConfigPath

getConfigPath(): string

Returns

string

Defined in

config.ts:158


getMatchedPackagesSpec

getMatchedPackagesSpec(pkgName): void | PackageAccess

Check for package spec

Parameters

NameType
pkgNamestring

Returns

void | PackageAccess

Implementation of

AppConfig.getMatchedPackagesSpec

Defined in

config.ts:165


getMigrateToSecureLegacySignature

getMigrateToSecureLegacySignature(): boolean

Returns

boolean

Defined in

config.ts:154