@cloud-copilot/iam-collect
Version:
Collect IAM information from AWS Accounts
49 lines • 1.98 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AwsConfigSecretsManagerClient = void 0;
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
const AbstractClient_js_1 = require("../../customClients/AbstractClient.js");
const AwsConfigClientContext_js_1 = require("../AwsConfigClientContext.js");
/**
* Secrets Manager client implementation using AWS Config as data source
*
* Since policies are not available in AWS Config, this client provides limited functionality
* and returns empty results for all operations.
*/
class AwsConfigSecretsManagerClient extends AbstractClient_js_1.AbstractClient {
static clientName = client_secrets_manager_1.SecretsManagerClient.name;
constructor(options, customContext) {
super(options, customContext);
}
/**
* Register all Secrets Manager command implementations
*/
registerCommands() {
this.registerCommand(AwsConfigListSecretsCommand);
this.registerCommand(AwsConfigGetResourcePolicyCommand);
}
}
exports.AwsConfigSecretsManagerClient = AwsConfigSecretsManagerClient;
/**
* Config-based implementation of Secrets Manager ListSecretsCommand
*/
const AwsConfigListSecretsCommand = (0, AwsConfigClientContext_js_1.awsConfigCommand)({
command: client_secrets_manager_1.ListSecretsCommand,
execute: async (input, context) => {
// Policy not available in Config, so return an empty list
return {
SecretList: []
};
}
});
/**
* Config-based implementation of Secrets Manager GetResourcePolicyCommand
*/
const AwsConfigGetResourcePolicyCommand = (0, AwsConfigClientContext_js_1.awsConfigCommand)({
command: client_secrets_manager_1.GetResourcePolicyCommand,
execute: async (input, context) => {
// Policy not available in Config, so fetch directly from Secrets Manager
return {};
}
});
//# sourceMappingURL=AwsConfigSecretsManagerClient.js.map