Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
},
];
};
Expand Down
4 changes: 4 additions & 0 deletions src/containers/Tenant/Info/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
25 changes: 25 additions & 0 deletions src/types/api/schema/externalDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export interface TExternalDataSourceDescription {
interface TAuth {
None?: NoneAuth;
ServiceAccount?: ServiceAccountAuth;
Aws?: AwsAuth;
Token?: Token;
MdbBasic?: MdbBasic;
Basic?: Basic;
}

interface NoneAuth {}
Expand All @@ -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;
}
Loading