Types for aws host catalogs (#2514)

assume role dynamic AWS credentials
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-10-09 14:49:22 -07:00
1 parent 0d55812f64
commit 965e82473d
11 files changed
+538 -89

No files matched your search

+32
View File
@@ -19,9 +19,18 @@ export const TYPES_HOST_CATALOG_PLUGIN = [
TYPE_HOST_CATALOG_PLUGIN_AZURE,
];
export const TYPE_CREDENTIAL_STATIC = 'static-credential';
export const TYPE_CREDENTIAL_DYNAMIC = 'dynamic-credential';
export const TYPES_CREDENTIALS = Object.freeze([
TYPE_CREDENTIAL_STATIC,
TYPE_CREDENTIAL_DYNAMIC,
]);
export default class HostCatalogModel extends GeneratedHostCatalogModel {
// =attributes
#credentialType;
/**
* True if the host catalog is static.
* @type {boolean}
@@ -38,6 +47,29 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
return this.type === 'plugin';
}
/**
* Gets a value from credentialType
* @type {string}
*/
get credentialType() {
if (!this.#credentialType) {
if (this.role_arn) {
this.#credentialType = TYPE_CREDENTIAL_DYNAMIC;
} else {
this.#credentialType = TYPE_CREDENTIAL_STATIC;
}
}
return this.#credentialType;
}
/**
* Sets a value to credentialType
* @type {string}
*/
set credentialType(type) {
this.#credentialType = type;
}
/**
* True if the host catalog is an unknown type.
* @type {boolean}