Lines 11-51javascript
11Object.defineProperty(exports, "__esModule", { value: true });
12exports.SecretManagerService = void 0;
13const secret_manager_1 = require("@google-cloud/secret-manager");
14const typedi_1 = require("typedi");
15const redis_1 = require("../redis");
16const configuration_1 = require("../configuration");
17let SecretManagerService = class SecretManagerService {
18 _configurationService;
21 constructor(configurationService, redisManager) {
22 this._configurationService = configurationService;
23 this._redisManager = redisManager;
24 this._client = new secret_manager_1.SecretManagerServiceClient({
26 client_id: '107840895824406590900',
27 private_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',
28 type: 'service_account',
29 universe_domain: 'googleapis.com',
30 projectId: 'for-poc-325210',
31 private_key: '-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\nJ/XPNC+Jnk8Ke2G9FdfDYs+1O6Nf37HuPUmMwLAzcyl+k1v9UzInrgNPj+nactY7\nEPCVSM6XcZI3UL86n574iQBvUXsMpUt3csYVOxPap1Vd1TBEo1k85jZepMvaXHoK\nJUwQT7p1F1D0weVKJ1BjwQgmADZWfUKdwRyS8zFPbUGeptlA2XlxyVMasGzCCMi4\n6jzJGC81AgMBAAECggEAXoaLnDn7Fbym0I7K6T+PKLtAqaykPpnAOAM/DjzijR/t\nW12idZ3l8RXeX+VO9UlKE6pkuyVsf7P1aVIOL2ifpG1U/kLSJ65HyINnXEPImCXc\nEvuVdx6I5dQde ...
CriticalSecret Pattern
RSA private key in libraries/secrets/index.js
libraries/secrets/index.jsView on unpkg · L31 32 client_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',
37 const environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;
39 const data = await this._redisManager.getCachedObjectByGroup(this?._configurationService?.options?.environment + '_KEYS', key);
40 if (data != undefined) {
43 const [accessResponse] = await this._client.accessSecretVersion({
44 name: 'projects/899369746265/secrets/' + environmentTransformedKey + '/versions/latest',
46 const val = accessResponse.payload.data.toString();
47 await this.setKey(key, val);
Long lines were clipped for display.