()
| 622 | */ |
| 623 | class Config extends EventEmitter { |
| 624 | constructor() { |
| 625 | super(); |
| 626 | /* |
| 627 | * Config files will be looked up under the directories: |
| 628 | * <project-root>/conf |
| 629 | * <project-root> |
| 630 | * |
| 631 | * An error will be thrown if the config files cannot be found |
| 632 | * |
| 633 | * The path to the "config.json" config can be overridden using the |
| 634 | * S3_CONFIG_FILE environment var |
| 635 | * |
| 636 | * The path to the "locationConfig.json" config can be overridden using |
| 637 | * the S3_LOCATION_FILE environment var. |
| 638 | */ |
| 639 | this._basePath = path.join(__dirname, '..'); |
| 640 | this.configPath = findConfigFile(process.env.S3_CONFIG_FILE || |
| 641 | 'config.json'); |
| 642 | |
| 643 | let locationConfigFileName = 'locationConfig.json'; |
| 644 | if (process.env.CI === 'true' && !process.env.S3_END_TO_END) { |
| 645 | locationConfigFileName = |
| 646 | 'tests/locationConfig/locationConfigTests.json'; |
| 647 | } |
| 648 | this.locationConfigPath = findConfigFile(process.env.S3_LOCATION_FILE || |
| 649 | locationConfigFileName); |
| 650 | |
| 651 | if (process.env.S3_REPLICATION_FILE !== undefined) { |
| 652 | this.replicationConfigPath = process.env.S3_REPLICATION_FILE; |
| 653 | } |
| 654 | |
| 655 | // Read config automatically |
| 656 | this._getLocationConfig(); |
| 657 | const config = this._getConfig(); |
| 658 | this._configureBackends(); |
| 659 | this._sseMigration(config); |
| 660 | } |
| 661 | |
| 662 | _parseKmsAWS(config) { |
| 663 | if (!config.kmsAWS) { |
nothing calls this directly
no test coverage detected