"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CredentialService = void 0;
const AWSSTSProvider_1 = require("./providers/AWSSTSProvider");
const AzureManagementProvider_1 = require("./providers/AzureManagementProvider");
class CredentialService {
    constructor(credentialProviderConfig) {
        this.verify = async () => this.credentialProvider.verify();
        this.cloudProvider = credentialProviderConfig?.cloudProvider || process.env.CLOUD_PROVIDER || 'azure';
        if (this.cloudProvider === 'azure') {
            this.credentialProvider = new AzureManagementProvider_1.AzureManagementProvider(credentialProviderConfig);
        }
        else if (this.cloudProvider === 'aws') {
            this.credentialProvider = new AWSSTSProvider_1.AWSSTSProvider(credentialProviderConfig);
        }
        else {
            throw new Error(`Cloud provider ${this.cloudProvider} is not supported.`);
        }
    }
}
exports.CredentialService = CredentialService;
//# sourceMappingURL=CredentialsProviderService.js.map