You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/09/20 10:54:27 UTC
[incubator-dlab] branch DLAB-1056 updated (097fe95 -> 4c0bdae)
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a change to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.
from 097fe95 added default api url key to production env variables
add 25aaa99 [DLAB-997] Added user tag to role creation on AWS
add a8d2f09 [DLAB-997] bugfix
add b4bfca3 Merge pull request #313 from apache/DLAB-997
add 222d2ce [DLAB-1078]: Added endpoint to generate key pairs
add 6c26043 Code review
add cc6ecf9 Merge pull request #309 from ofuks/DLAB-1078
new 957a333 Merge branch 'develop' of github.com:apache/incubator-dlab into DLAB-1056
add 6d72270 [DLAB-1079]: added key generation on project creation
new 941dc21 Merge branch 'DLAB-1079' of github.com:apache/incubator-dlab into DLAB-1056
new e680da2 [DLAB-1079]: generate key service fixes
new 48a04ad [DLAB-1079]: download key parameters fixes; util options added
add 3f36c59 [DLAB-1110]: Added possibility to turn on/off of using shared image in project
add a47482e Merge pull request #315 from ofuks/DLAB-1110
add 625f2c5 DLAB-000 added new parameter for generate key endpoint
new a3ad97a Merge branch 'develop' of github.com:apache/incubator-dlab into DLAB-1056
new 4c0bdae [DLAB-1079]: key format for saving added
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/general/lib/aws/actions_lib.py | 72 +++++++++++----------
.../scripts/aws/common_create_role_policy.py | 4 +-
.../src/general/scripts/aws/project_prepare.py | 10 +--
.../src/general/scripts/aws/ssn_prepare.py | 5 +-
.../epam/dlab/dto/project/ProjectCreateDTO.java | 1 +
.../epam/dlab/backendapi/domain/ProjectDTO.java | 1 +
.../dlab/backendapi/resources/ProjectResource.java | 20 +++++-
.../dlab/backendapi/resources/dto/KeysDTO.java | 12 ++++
.../dlab/backendapi/service/AccessKeyService.java | 2 +
.../service/impl/AccessKeyServiceImpl.java | 17 +++++
.../epam/dlab/backendapi/util/RequestBuilder.java | 1 +
.../project-form/project-form.component.html | 4 ++
.../project-form/project-form.component.scss | 7 ++
.../project/project-form/project-form.component.ts | 19 +++++-
.../resources/webapp/src/app/core/core.module.ts | 2 +
.../services/applicationServiceFacade.service.ts | 8 +--
.../src/app/core/services/userAccessKey.service.ts | 8 +--
.../webapp/src/app/core/util/fileUtils.ts | 21 +++---
.../backendapi/resources/ProjectResourceTest.java | 74 ++++++++++++++++++++++
19 files changed, 228 insertions(+), 60 deletions(-)
create mode 100644 services/self-service/src/main/java/com/epam/dlab/backendapi/resources/dto/KeysDTO.java
create mode 100644 services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 06/06: [DLAB-1079]: key format for saving added
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 4c0bdaea264c10f8dd8e192b9cc813ff8ff4e315
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 13:53:20 2019 +0300
[DLAB-1079]: key format for saving added
---
.../administration/project/project-form/project-form.component.ts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
index f8d3320..c4ad550 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
@@ -128,10 +128,11 @@ export class ProjectFormComponent implements OnInit {
public generateUserAccessKey() {
this.userAccessKeyService.generateAccessKey().subscribe((data: any) => {
const parsedData = JSON.parse(data.body);
- FileUtils.downloadFile(data, parsedData.privateKey, 'private');
+ const keyName = `${parsedData.username}.pem`;
+ FileUtils.downloadFile(data, parsedData.privateKey, keyName);
this.projectForm.controls.key.setValue(parsedData.publicKey);
- this.keyLabel = 'Key is generated';
+ this.keyLabel = keyName;
this.accessKeyValid = true;
});
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 01/06: Merge branch 'develop' of
github.com:apache/incubator-dlab into DLAB-1056
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 957a3332ede5b0645e52a117a84baeb3d7904ec5
Merge: 097fe95 cc6ecf9
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 11:35:42 2019 +0300
Merge branch 'develop' of github.com:apache/incubator-dlab into DLAB-1056
.../src/general/lib/aws/actions_lib.py | 72 +++++++++++----------
.../scripts/aws/common_create_role_policy.py | 4 +-
.../src/general/scripts/aws/project_prepare.py | 10 +--
.../src/general/scripts/aws/ssn_prepare.py | 5 +-
.../dlab/backendapi/resources/ProjectResource.java | 20 +++++-
.../dlab/backendapi/resources/dto/KeysDTO.java | 11 ++++
.../dlab/backendapi/service/AccessKeyService.java | 2 +
.../service/impl/AccessKeyServiceImpl.java | 17 +++++
.../backendapi/resources/ProjectResourceTest.java | 73 ++++++++++++++++++++++
9 files changed, 174 insertions(+), 40 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 02/06: Merge branch 'DLAB-1079' of
github.com:apache/incubator-dlab into DLAB-1056
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 941dc21a04e914ffb67bfb6feb6783595b689d94
Merge: 957a333 6d72270
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 11:43:53 2019 +0300
Merge branch 'DLAB-1079' of github.com:apache/incubator-dlab into DLAB-1056
.../project/project-form/project-form.component.html | 4 ++++
.../project/project-form/project-form.component.scss | 7 +++++++
.../project/project-form/project-form.component.ts | 13 +++++++++++--
.../src/main/resources/webapp/src/app/core/core.module.ts | 2 ++
4 files changed, 24 insertions(+), 2 deletions(-)
diff --cc services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
index a847ef4,3173e94..9e3baba
--- a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
@@@ -41,11 -39,8 +41,12 @@@ import { DataengineConfigurationServic
import { StorageService } from './services/storage.service';
import { ProjectService } from './services/project.service';
import { EndpointService } from './services/endpoint.service';
+ import { UserAccessKeyService } from './services/userAccessKey.service';
+import { HttpTokenInterceptor } from './interceptors/http.token.interceptor';
+import { NoCacheInterceptor } from './interceptors/nocache.interceptor';
+import { ErrorInterceptor } from './interceptors/error.interceptor';
+
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
@NgModule({
@@@ -81,23 -76,10 +82,24 @@@ export class CoreModule
StorageService,
ProjectService,
EndpointService,
+ UserAccessKeyService,
{ provide: MatDialogRef, useValue: {} },
- { provide: MAT_DIALOG_DATA, useValue: [] }
+ { provide: MAT_DIALOG_DATA, useValue: [] },
+
+ {
+ provide: HTTP_INTERCEPTORS,
+ useClass: HttpTokenInterceptor,
+ multi: true
+ }, {
+ provide: HTTP_INTERCEPTORS,
+ useClass: NoCacheInterceptor,
+ multi: true,
+ }, {
+ provide: HTTP_INTERCEPTORS,
+ useClass: ErrorInterceptor,
+ multi: true,
+ }
]
};
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 05/06: Merge branch 'develop' of
github.com:apache/incubator-dlab into DLAB-1056
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit a3ad97a83090948144c29cb0c0bd169cf9cc3cb2
Merge: 48a04ad 625f2c5
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 12:46:05 2019 +0300
Merge branch 'develop' of github.com:apache/incubator-dlab into DLAB-1056
.../src/main/java/com/epam/dlab/dto/project/ProjectCreateDTO.java | 1 +
.../src/main/java/com/epam/dlab/backendapi/domain/ProjectDTO.java | 1 +
.../src/main/java/com/epam/dlab/backendapi/resources/dto/KeysDTO.java | 1 +
.../com/epam/dlab/backendapi/service/impl/AccessKeyServiceImpl.java | 2 +-
.../src/main/java/com/epam/dlab/backendapi/util/RequestBuilder.java | 1 +
.../java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java | 3 ++-
6 files changed, 7 insertions(+), 2 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 03/06: [DLAB-1079]: generate key service fixes
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit e680da21a66f4f89b1571f172bb24cdb1aeea6ee
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 12:44:23 2019 +0300
[DLAB-1079]: generate key service fixes
---
.../src/app/core/services/applicationServiceFacade.service.ts | 8 ++++----
.../webapp/src/app/core/services/userAccessKey.service.ts | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index 6c94e94..addc5c5 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -40,7 +40,7 @@ export class ApplicationServiceFacade {
private static readonly ACTIVE_LIST = 'active_list';
private static readonly FULL_ACTIVE_LIST = 'full_active_list';
private static readonly ENV = 'environment';
- private static readonly ACCESS_KEY_GENERATE = 'access_key_generate';
+ private static readonly PROJECT_KEY_GENERATE = 'access_key_generate';
private static readonly PROVISIONED_RESOURCES = 'provisioned_resources';
private static readonly EXPLORATORY_ENVIRONMENT = 'exploratory_environment';
private static readonly IMAGE = 'image';
@@ -123,14 +123,14 @@ export class ApplicationServiceFacade {
public buildGenerateAccessKey(): Observable<any> {
return this.buildRequest(RequestMethod.Post,
- this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY_GENERATE),
+ this.requestRegistry.Item(ApplicationServiceFacade.PROJECT_KEY_GENERATE),
null,
{ observe: 'response', responseType: 'text' });
}
public buildRegenerateAccessKey(option): Observable<any> {
return this.buildRequest(RequestMethod.Post,
- this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY_GENERATE) + option,
+ this.requestRegistry.Item(ApplicationServiceFacade.PROJECT_KEY_GENERATE) + option,
null,
{ observe: 'response', responseType: 'text' });
}
@@ -587,7 +587,7 @@ export class ApplicationServiceFacade {
this.requestRegistry.Add(ApplicationServiceFacade.OAUTH, '/api/user/azure/oauth');
this.requestRegistry.Add(ApplicationServiceFacade.ACCESS_KEY, '/api/user/access_key');
- this.requestRegistry.Add(ApplicationServiceFacade.ACCESS_KEY_GENERATE, '/api/user/access_key/generate');
+ this.requestRegistry.Add(ApplicationServiceFacade.PROJECT_KEY_GENERATE, '/api/project/keys');
// Exploratory Environment
this.requestRegistry.Add(ApplicationServiceFacade.PROVISIONED_RESOURCES,
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/userAccessKey.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/userAccessKey.service.ts
index 51ce115..81e8008 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/userAccessKey.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/userAccessKey.service.ts
@@ -42,10 +42,10 @@ export class UserAccessKeyService {
public initialUserAccessKeyCheck() {
this.checkUserAccessKey().subscribe(
response => {
- this._accessKeyEmitter.next(response);
- }, error => {
- this._accessKeyEmitter.next(error);
- });
+ this._accessKeyEmitter.next(response);
+ }, error => {
+ this._accessKeyEmitter.next(error);
+ });
}
public checkUserAccessKey(): Observable<{}> {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org
[incubator-dlab] 04/06: [DLAB-1079]: download key parameters fixes;
util options added
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 48a04adbbf0c747c1233a18f28d612f39eda163c
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Sep 20 12:45:50 2019 +0300
[DLAB-1079]: download key parameters fixes; util options added
---
.../project/project-form/project-form.component.ts | 9 +++++++--
.../resources/webapp/src/app/core/util/fileUtils.ts | 21 +++++++++++----------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
index 8a32f00..f8d3320 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
@@ -29,6 +29,8 @@ import { CheckUtils, FileUtils, PATTERNS } from '../../../core/util';
import { Project } from '../project.component';
import { DICTIONARY } from '../../../../dictionary/global.dictionary';
+export interface GenerateKey { privateKey: string, publicKey: string };
+
@Component({
selector: 'project-form',
templateUrl: './project-form.component.html',
@@ -124,8 +126,11 @@ export class ProjectFormComponent implements OnInit {
}
public generateUserAccessKey() {
- this.userAccessKeyService.generateAccessKey().subscribe(data => {
- FileUtils.downloadFile(data);
+ this.userAccessKeyService.generateAccessKey().subscribe((data: any) => {
+ const parsedData = JSON.parse(data.body);
+ FileUtils.downloadFile(data, parsedData.privateKey, 'private');
+
+ this.projectForm.controls.key.setValue(parsedData.publicKey);
this.keyLabel = 'Key is generated';
this.accessKeyValid = true;
});
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/fileUtils.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/fileUtils.ts
index edd6d0a..0a3a32c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/fileUtils.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/fileUtils.ts
@@ -18,20 +18,21 @@
*/
export class FileUtils {
- public static downloadFile(data: any) {
- const fileName = data.headers.get('content-disposition').match(/filename="(.+)"/)[1];
- const blob = new Blob([ data.body]);
+ public static downloadFile(data: any, options?: string, name?: string) {
+ const fileName = name || data.headers.get('content-disposition').match(/filename="(.+)"/)[1];
+ const body = options || data.body;
+ const blob = new Blob([body]);
const url = window.URL.createObjectURL(blob);
if (navigator.msSaveOrOpenBlob) {
- navigator.msSaveBlob(blob, fileName);
+ navigator.msSaveBlob(blob, fileName);
} else {
- const a = document.createElement('a');
- a.href = url;
- a.download = fileName;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = fileName;
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
}
window.URL.revokeObjectURL(url);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org