Browse Source

Reading idcs client secret from mounted vault volume

bodicsek 3 years ago
parent
commit
d6eefeb874
4 changed files with 6 additions and 3 deletions
  1. 1 0
      .gitignore
  2. 1 1
      deployment/helm-chart/values.yaml
  3. 1 1
      package.json
  4. 3 1
      src/auth/auth.service.ts

+ 1 - 0
.gitignore

@@ -2,3 +2,4 @@
 /exchange_components
 /dist
 .DS_Store
+/vault

+ 1 - 1
deployment/helm-chart/values.yaml

@@ -7,7 +7,7 @@ appVersion: 1.0.0
 imageRegistry: iad.ocir.io/cesdev
 imagePullSecret: ocirsecret
 vaultImage: iad.ocir.io/cesdev/occ-fw-vault-init:1.0.0
-vaultMountPath: /vault
+vaultMountPath: /app/vault
 vaultSecretName: idcs-client
 host: customercentral-poc.oracle.com
 pathPrefix: /occ/api/

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "occ-fw-backend",
-  "version": "0.0.3",
+  "version": "0.0.4",
   "description": "",
   "author": "",
   "private": true,

+ 3 - 1
src/auth/auth.service.ts

@@ -1,5 +1,6 @@
 import { HttpService } from '@nestjs/axios';
 import { BadRequestException, Injectable } from '@nestjs/common';
+import { readFileSync } from 'fs';
 import { catchError, map, throwError } from 'rxjs';
 
 @Injectable()
@@ -10,9 +11,10 @@ export class AuthService {
   // private clientId = '4e728d65cf5b482ea81e56bf23a9ad8a';
   private clientId = '754db2d1964d4f12ab312a2ab6f025ed';
   // private clientSecret = 'dc547dbe-8d4b-4155-a378-f3a03d56a654';
-  private clientSecret = '510c4b34-fd47-4f2d-ab89-9bc6db94e183';
+  private clientSecret = '';
 
   constructor(private httpService: HttpService) {
+    this.clientSecret = JSON.parse(readFileSync("vault/idcs-client").toString()).clientSecret;
     this.httpService.axiosRef.interceptors.request.use((config) => {
       console.log('Request:', config);
       return config;