This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage.prototype._setItem = Storage.prototype.setItem | |
Storage.prototype._getItem = Storage.prototype.getItem | |
Storage.prototype.setItem = function(key, value) { | |
this._setItem(key, CryptoJS.AES.encrypt(value, 'privatekey').toString()) | |
} | |
Storage.prototype.getItem = function(key) { | |
let value = this._getItem(key) | |
if (value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class SingletonSecureStorageService { | |
constructor() { | |
} | |
init() { | |
// overriding window function here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {APP_INITIALIZER} from '@angular/core' | |
import {SingletonSecureStorageService} from './services/.... ' | |
@NgModule({ | |
declarations: [ /*.. components...*/ ], | |
imports: [ /*.. modules .. */], | |
providers: [ | |
SingletonSecureStorageService, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// ..... | |
"production": { | |
"fileReplacements": [ | |
{ | |
"replace": "src/environments/environment.ts", | |
"with": "src/environments/environment.prod.ts" | |
} | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
data: | |
ENV_API_BACKEND_URL: http://localhost:8080/bananas | |
ENV_EXTERNAL_INTEGRATION_URL: http://www.integration.com/easy | |
kind: ConfigMap | |
metadata: | |
name: the_configmap_name_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... containers: | |
- name: test-container | |
image: k8s.gcr.io/busybox | |
command: [ "/bin/sh", "-c", "env" ] | |
env: | |
- name: ENV_API_BACKEND_URL | |
valueFrom: | |
configMapKeyRef: | |
name: the_configmap_name_id | |
key: ENV_API_BACKEND_URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . containers: | |
- name: test-container | |
image: k8s.gcr.io/busybox | |
command: [ "/bin/sh", "-c", "env" ] | |
envFrom: | |
- configMapRef: | |
name: the_configmap_name_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (window) { | |
window["env"] = window["env"] || {}; | |
window["env"].API_BACKEND_URL = 'http://localhost:8080/bananas'; // not actualized, for local testing | |
window["env"].EXTERNAL_INTEGRATION_URL = 'http://www.integration.com/easy'; // not actualized, for local testing | |
})(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<base href="/"> | |
<script src="assets/env.js" ></script> | |
</head> | |
<body> | |
</body> |