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/08/01 08:34:40 UTC

[incubator-dlab] 02/05: [DLAB-758]: added aditional parameter code to authentication

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch dlab_refactored
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 7a9b03d5bf8ae71990eccaa4b342859936098126
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Wed Jul 31 16:27:31 2019 +0300

    [DLAB-758]: added aditional parameter code to authentication
---
 .../services/applicationServiceFacade.service.ts   | 63 ++++++++++++----------
 1 file changed, 34 insertions(+), 29 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 79ae239..531760e 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
@@ -31,7 +31,7 @@ export class ApplicationServiceFacade {
   private static readonly LOGIN = 'login';
   private static readonly LOGOUT = 'logout';
   private static readonly AUTHORIZE = 'authorize';
-  private static readonly OAUTH = 'oauth';
+  private static readonly AUTHENTICATION = 'authentification';
   private static readonly ACCESS_KEY = 'access_key';
   private static readonly ACTIVE_LIST = 'active_list';
   private static readonly FULL_ACTIVE_LIST = 'full_active_list';
@@ -80,7 +80,7 @@ export class ApplicationServiceFacade {
       this.requestRegistry.Item(ApplicationServiceFacade.LOGIN),
       body,
       { responseType: 'text', observe: 'response' }
-      );
+    );
   }
 
   public buildLogoutRequest(): Observable<any> {
@@ -94,16 +94,17 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.AUTHORIZE),
       body,
-      { responseType: 'text',
-        headers: { 'Content-Type': 'text/plain'},
+      {
+        responseType: 'text',
+        headers: { 'Content-Type': 'text/plain' },
         observe: 'response'
       });
   }
 
   public buildGetAuthToken(body: any): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
-      this.requestRegistry.Item(ApplicationServiceFacade.OAUTH),
-      body,
+    return this.buildRequest(RequestMethod.Get,
+      this.requestRegistry.Item(ApplicationServiceFacade.AUTHENTICATION) + body,
+      null,
       { observe: 'response' });
   }
 
@@ -111,7 +112,7 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Get,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY),
       null,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildGenerateAccessKey(): Observable<any> {
@@ -132,8 +133,9 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY),
       body,
-      { observe: 'response',
-        headers: { 'Upload': 'true'}
+      {
+        observe: 'response',
+        headers: { 'Upload': 'true' }
       });
   }
 
@@ -141,8 +143,9 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY) + option,
       body,
-      { observe: 'response',
-        headers: { 'Upload': 'true'}
+      {
+        observe: 'response',
+        headers: { 'Upload': 'true' }
       });
   }
 
@@ -188,14 +191,14 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Put,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES_DATAENGINESERVICE),
       data,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildCreateComputationalResources_DataengineRequest(data): Observable<any> {
     return this.buildRequest(RequestMethod.Put,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES_DATAENGINE),
       data,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildDeleteComputationalResourcesRequest(data): Observable<any> {
@@ -241,21 +244,21 @@ export class ApplicationServiceFacade {
       data);
   }
 
-  public buildRunEdgeNodeRequest(): Observable<any>  {
+  public buildRunEdgeNodeRequest(): Observable<any> {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_START),
       null,
       { responseType: 'text' });
   }
 
-  public buildSuspendEdgeNodeRequest(): Observable<any>  {
+  public buildSuspendEdgeNodeRequest(): Observable<any> {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_STOP),
       null,
       { responseType: 'text', observe: 'response' });
   }
 
-  public buildRecreateEdgeNodeRequest(): Observable<any>  {
+  public buildRecreateEdgeNodeRequest(): Observable<any> {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_RECREATE),
       null,
@@ -284,7 +287,7 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.LIB_INSTALL),
       data,
-      { observe: 'response', responseType: 'text'});
+      { observe: 'response', responseType: 'text' });
   }
 
   public buildGetInstalledLibrariesList(data): Observable<any> {
@@ -365,7 +368,7 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.SCHEDULER) + param,
       data,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildResetScheduleSettings(data): Observable<any> {
@@ -384,29 +387,31 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Get,
       this.requestRegistry.Item(ApplicationServiceFacade.ACTIVE_LIST),
       null);
-    }
+  }
 
   public buildManageEnvironment(action, data): Observable<any> {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.ENV) + action,
       data,
-      { observe: 'response',
-        headers: { 'Content-Type': 'text/plain'}
+      {
+        observe: 'response',
+        headers: { 'Content-Type': 'text/plain' }
       });
-    }
+  }
 
   public buildGetAllEnvironmentData(): Observable<any> {
     return this.buildRequest(RequestMethod.Get,
       this.requestRegistry.Item(ApplicationServiceFacade.FULL_ACTIVE_LIST),
       null);
-    }
+  }
 
   public buildEnvironmentManagement(param, data): Observable<any> {
     return this.buildRequest(RequestMethod.Post,
       this.requestRegistry.Item(ApplicationServiceFacade.ENV) + param,
       data,
-      { observe: 'response',
-        headers: { 'Content-Type': 'text/plain'}
+      {
+        observe: 'response',
+        headers: { 'Content-Type': 'text/plain' }
       });
   }
 
@@ -414,7 +419,7 @@ export class ApplicationServiceFacade {
     return this.buildRequest(RequestMethod.Put,
       this.requestRegistry.Item(ApplicationServiceFacade.BUDGET),
       data,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildGetSsnMonitorData(): Observable<any> {
@@ -434,7 +439,7 @@ export class ApplicationServiceFacade {
     return this.buildRequest(method,
       this.requestRegistry.Item(ApplicationServiceFacade.SETTINGS) + param,
       null,
-      { observe: 'response'});
+      { observe: 'response' });
   }
 
   public buildGetGroupsData(): Observable<any> {
@@ -532,7 +537,7 @@ export class ApplicationServiceFacade {
     this.requestRegistry.Add(ApplicationServiceFacade.FULL_ACTIVE_LIST, '/api/environment/all');
     this.requestRegistry.Add(ApplicationServiceFacade.ENV, '/api/environment');
 
-    this.requestRegistry.Add(ApplicationServiceFacade.OAUTH, '/api/user/azure/oauth');
+    this.requestRegistry.Add(ApplicationServiceFacade.AUTHENTICATION, '/api/oauth');
     this.requestRegistry.Add(ApplicationServiceFacade.ACCESS_KEY, '/api/user/access_key');
     this.requestRegistry.Add(ApplicationServiceFacade.ACCESS_KEY_GENERATE, '/api/user/access_key/generate');
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org