From e449a6c4369e4ebaf39ed08d41ae82e99e025c9e Mon Sep 17 00:00:00 2001
From: annaelee <130700951+annaelee@users.noreply.github.com>
Date: Wed, 24 May 2023 01:38:58 -0500
Subject: [PATCH] Allow the use of tokens for s3 access (#53)
Co-authored-by: @annaelee
---
src/app/webapp-common/core/reducers/common-auth-reducer.ts | 1 +
.../layout/s3-access-dialog/s3-access-dialog.component.html | 5 +++++
.../layout/s3-access-dialog/s3-access-dialog.component.ts | 2 ++
.../s3-access-resolver/s3-access-resolver.component.html | 1 +
.../s3-access-resolver/s3-access-resolver.component.ts | 2 ++
src/app/webapp-common/settings/admin/base-admin.service.ts | 3 ++-
.../settings/admin/s3-access/s3-access.component.html | 4 ++++
.../settings/admin/s3-access/s3-access.component.ts | 3 ++-
8 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/app/webapp-common/core/reducers/common-auth-reducer.ts b/src/app/webapp-common/core/reducers/common-auth-reducer.ts
index e96ed956..63c8a2f4 100755
--- a/src/app/webapp-common/core/reducers/common-auth-reducer.ts
+++ b/src/app/webapp-common/core/reducers/common-auth-reducer.ts
@@ -19,6 +19,7 @@ export interface Credentials {
Endpoint?: string;
Key?: string;
Secret?: string;
+ Token?: string;
Region?: string;
}
diff --git a/src/app/webapp-common/layout/s3-access-dialog/s3-access-dialog.component.html b/src/app/webapp-common/layout/s3-access-dialog/s3-access-dialog.component.html
index 957749b5..1142aa51 100755
--- a/src/app/webapp-common/layout/s3-access-dialog/s3-access-dialog.component.html
+++ b/src/app/webapp-common/layout/s3-access-dialog/s3-access-dialog.component.html
@@ -16,6 +16,11 @@
[placeholder]="isAzure ? 'Shared access signature (SAS)' : 'Secret'">
*Required
+
+ Token
+
+
Region
Bucket
Key
Secret / SAS
+ Token
AWS Region
Host (Endpoint)
@@ -18,6 +19,9 @@
+
+
+
diff --git a/src/app/webapp-common/settings/admin/s3-access/s3-access.component.ts b/src/app/webapp-common/settings/admin/s3-access/s3-access.component.ts
index 3aa3d418..a447cdf8 100755
--- a/src/app/webapp-common/settings/admin/s3-access/s3-access.component.ts
+++ b/src/app/webapp-common/settings/admin/s3-access/s3-access.component.ts
@@ -37,10 +37,11 @@ export class S3AccessComponent implements OnDestroy, OnInit {
return this.S3Form.get(this.BUCKET_CREDENTIALS) as UntypedFormArray;
}
- addBucket({Key = '', Secret = '', Region = '', Bucket = '', Endpoint = null} = {}) {
+ addBucket({Key = '', Secret = '', Token='', Region = '', Bucket = '', Endpoint = null} = {}) {
this.bucketCredentials.push(this.formBuilder.group({
Key,
Secret,
+ Token,
Region,
Bucket,
Endpoint: (Endpoint?.startsWith('http') || Endpoint === null)? Endpoint : `http${Endpoint?.endsWith('443') ? 's' : ''}://${Endpoint}`