diff --git a/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.tsx b/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.tsx index d4aab238f..24775aea8 100644 --- a/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.tsx +++ b/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.tsx @@ -28,8 +28,28 @@ const prepareExternalDataSourceSummary = (data: TEvDescribeSchemeResult) => { return info; }; +function getAuthMethodValue(data: TEvDescribeSchemeResult) { + const {Auth} = data.PathDescription?.ExternalDataSourceDescription || {}; + if (Auth?.ServiceAccount) { + return i18n('external-objects.auth-method.service-account'); + } + if (Auth?.Aws) { + return i18n('external-objects.auth-method.aws'); + } + if (Auth?.Token) { + return i18n('external-objects.auth-method.token'); + } + if (Auth?.Basic) { + return i18n('external-objects.auth-method.basic'); + } + if (Auth?.MdbBasic) { + return i18n('external-objects.auth-method.mdb-basic'); + } + return i18n('external-objects.auth-method.none'); +} + const prepareExternalDataSourceInfo = (data: TEvDescribeSchemeResult): InfoViewerItem[] => { - const {Location, Auth} = data.PathDescription?.ExternalDataSourceDescription || {}; + const {Location} = data.PathDescription?.ExternalDataSourceDescription || {}; return [ ...prepareExternalDataSourceSummary(data), @@ -47,9 +67,7 @@ const prepareExternalDataSourceInfo = (data: TEvDescribeSchemeResult): InfoViewe }, { label: i18n('external-objects.auth-method'), - value: Auth?.ServiceAccount - ? i18n('external-objects.auth-method.service-account') - : i18n('external-objects.auth-method.none'), + value: getAuthMethodValue(data), }, ]; }; diff --git a/src/containers/Tenant/Info/i18n/en.json b/src/containers/Tenant/Info/i18n/en.json index 2b0392ced..a96d0e34e 100644 --- a/src/containers/Tenant/Info/i18n/en.json +++ b/src/containers/Tenant/Info/i18n/en.json @@ -5,6 +5,10 @@ "external-objects.auth-method": "Auth Method", "external-objects.auth-method.none": "None", "external-objects.auth-method.service-account": "Service Account", + "external-objects.auth-method.aws": "AWS", + "external-objects.auth-method.token": "Token", + "external-objects.auth-method.basic": "Basic", + "external-objects.auth-method.mdb-basic": "MDB Basic", "view.query-text": "Query Text", diff --git a/src/types/api/schema/externalDataSource.ts b/src/types/api/schema/externalDataSource.ts index 7eaaadc13..37b07fd5f 100644 --- a/src/types/api/schema/externalDataSource.ts +++ b/src/types/api/schema/externalDataSource.ts @@ -14,6 +14,10 @@ export interface TExternalDataSourceDescription { interface TAuth { None?: NoneAuth; ServiceAccount?: ServiceAccountAuth; + Aws?: AwsAuth; + Token?: Token; + MdbBasic?: MdbBasic; + Basic?: Basic; } interface NoneAuth {} @@ -22,3 +26,24 @@ interface ServiceAccountAuth { Id?: string; SecretName?: string; } +interface AwsAuth { + AwsSecretAccessKeySecretName?: string; + AwsRegion?: string; + AwsAccessKeyIdSecretName?: string; +} + +interface Basic { + Login?: string; + PasswordSecretName?: string; +} + +interface MdbBasic { + ServiceAccountId?: string; + ServiceAccountSecretName?: string; + Login?: string; + PasswordSecretName?: string; +} + +interface Token { + TokenSecretName?: string; +}