parent
7314feb2e7
commit
eb4f968f43
|
|
@ -2048,6 +2048,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const k8s = __importStar(__webpack_require__(89679));
|
const k8s = __importStar(__webpack_require__(89679));
|
||||||
|
const base64 = __webpack_require__(85848);
|
||||||
class KubernetesSecret {
|
class KubernetesSecret {
|
||||||
static createSecret(secrets, secretName, namespace, kubeClient) {
|
static createSecret(secrets, secretName, namespace, kubeClient) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
|
@ -2060,7 +2061,8 @@ class KubernetesSecret {
|
||||||
};
|
};
|
||||||
secret.data = {};
|
secret.data = {};
|
||||||
for (const buildSecret of secrets) {
|
for (const buildSecret of secrets) {
|
||||||
secret.data[buildSecret.ParameterKey] = buildSecret.ParameterValue;
|
secret.data[buildSecret.EnvironmentVariable] = base64.encode(buildSecret.ParameterValue);
|
||||||
|
secret.data[`${buildSecret.EnvironmentVariable}_NAME`] = base64.encode(buildSecret.ParameterKey);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
yield kubeClient.createNamespacedSecret(namespace, secret);
|
yield kubeClient.createNamespacedSecret(namespace, secret);
|
||||||
|
|
@ -178015,6 +178017,178 @@ function range(a, b, str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 85848:
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
/* module decorator */ module = __webpack_require__.nmd(module);
|
||||||
|
/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
|
||||||
|
;(function(root) {
|
||||||
|
|
||||||
|
// Detect free variables `exports`.
|
||||||
|
var freeExports = true && exports;
|
||||||
|
|
||||||
|
// Detect free variable `module`.
|
||||||
|
var freeModule = true && module &&
|
||||||
|
module.exports == freeExports && module;
|
||||||
|
|
||||||
|
// Detect free variable `global`, from Node.js or Browserified code, and use
|
||||||
|
// it as `root`.
|
||||||
|
var freeGlobal = typeof global == 'object' && global;
|
||||||
|
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||||
|
root = freeGlobal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
var InvalidCharacterError = function(message) {
|
||||||
|
this.message = message;
|
||||||
|
};
|
||||||
|
InvalidCharacterError.prototype = new Error;
|
||||||
|
InvalidCharacterError.prototype.name = 'InvalidCharacterError';
|
||||||
|
|
||||||
|
var error = function(message) {
|
||||||
|
// Note: the error messages used throughout this file match those used by
|
||||||
|
// the native `atob`/`btoa` implementation in Chromium.
|
||||||
|
throw new InvalidCharacterError(message);
|
||||||
|
};
|
||||||
|
|
||||||
|
var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||||
|
// http://whatwg.org/html/common-microsyntaxes.html#space-character
|
||||||
|
var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
|
||||||
|
|
||||||
|
// `decode` is designed to be fully compatible with `atob` as described in the
|
||||||
|
// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
|
||||||
|
// The optimized base64-decoding algorithm used is based on @atk’s excellent
|
||||||
|
// implementation. https://gist.github.com/atk/1020396
|
||||||
|
var decode = function(input) {
|
||||||
|
input = String(input)
|
||||||
|
.replace(REGEX_SPACE_CHARACTERS, '');
|
||||||
|
var length = input.length;
|
||||||
|
if (length % 4 == 0) {
|
||||||
|
input = input.replace(/==?$/, '');
|
||||||
|
length = input.length;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
length % 4 == 1 ||
|
||||||
|
// http://whatwg.org/C#alphanumeric-ascii-characters
|
||||||
|
/[^+a-zA-Z0-9/]/.test(input)
|
||||||
|
) {
|
||||||
|
error(
|
||||||
|
'Invalid character: the string to be decoded is not correctly encoded.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var bitCounter = 0;
|
||||||
|
var bitStorage;
|
||||||
|
var buffer;
|
||||||
|
var output = '';
|
||||||
|
var position = -1;
|
||||||
|
while (++position < length) {
|
||||||
|
buffer = TABLE.indexOf(input.charAt(position));
|
||||||
|
bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
|
||||||
|
// Unless this is the first of a group of 4 characters…
|
||||||
|
if (bitCounter++ % 4) {
|
||||||
|
// …convert the first 8 bits to a single ASCII character.
|
||||||
|
output += String.fromCharCode(
|
||||||
|
0xFF & bitStorage >> (-2 * bitCounter & 6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
// `encode` is designed to be fully compatible with `btoa` as described in the
|
||||||
|
// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
|
||||||
|
var encode = function(input) {
|
||||||
|
input = String(input);
|
||||||
|
if (/[^\0-\xFF]/.test(input)) {
|
||||||
|
// Note: no need to special-case astral symbols here, as surrogates are
|
||||||
|
// matched, and the input is supposed to only contain ASCII anyway.
|
||||||
|
error(
|
||||||
|
'The string to be encoded contains characters outside of the ' +
|
||||||
|
'Latin1 range.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var padding = input.length % 3;
|
||||||
|
var output = '';
|
||||||
|
var position = -1;
|
||||||
|
var a;
|
||||||
|
var b;
|
||||||
|
var c;
|
||||||
|
var buffer;
|
||||||
|
// Make sure any padding is handled outside of the loop.
|
||||||
|
var length = input.length - padding;
|
||||||
|
|
||||||
|
while (++position < length) {
|
||||||
|
// Read three bytes, i.e. 24 bits.
|
||||||
|
a = input.charCodeAt(position) << 16;
|
||||||
|
b = input.charCodeAt(++position) << 8;
|
||||||
|
c = input.charCodeAt(++position);
|
||||||
|
buffer = a + b + c;
|
||||||
|
// Turn the 24 bits into four chunks of 6 bits each, and append the
|
||||||
|
// matching character for each of them to the output.
|
||||||
|
output += (
|
||||||
|
TABLE.charAt(buffer >> 18 & 0x3F) +
|
||||||
|
TABLE.charAt(buffer >> 12 & 0x3F) +
|
||||||
|
TABLE.charAt(buffer >> 6 & 0x3F) +
|
||||||
|
TABLE.charAt(buffer & 0x3F)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (padding == 2) {
|
||||||
|
a = input.charCodeAt(position) << 8;
|
||||||
|
b = input.charCodeAt(++position);
|
||||||
|
buffer = a + b;
|
||||||
|
output += (
|
||||||
|
TABLE.charAt(buffer >> 10) +
|
||||||
|
TABLE.charAt((buffer >> 4) & 0x3F) +
|
||||||
|
TABLE.charAt((buffer << 2) & 0x3F) +
|
||||||
|
'='
|
||||||
|
);
|
||||||
|
} else if (padding == 1) {
|
||||||
|
buffer = input.charCodeAt(position);
|
||||||
|
output += (
|
||||||
|
TABLE.charAt(buffer >> 2) +
|
||||||
|
TABLE.charAt((buffer << 4) & 0x3F) +
|
||||||
|
'=='
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
var base64 = {
|
||||||
|
'encode': encode,
|
||||||
|
'decode': decode,
|
||||||
|
'version': '1.0.0'
|
||||||
|
};
|
||||||
|
|
||||||
|
// Some AMD build optimizers, like r.js, check for specific condition patterns
|
||||||
|
// like the following:
|
||||||
|
if (
|
||||||
|
typeof define == 'function' &&
|
||||||
|
typeof define.amd == 'object' &&
|
||||||
|
define.amd
|
||||||
|
) {
|
||||||
|
define(function() {
|
||||||
|
return base64;
|
||||||
|
});
|
||||||
|
} else if (freeExports && !freeExports.nodeType) {
|
||||||
|
if (freeModule) { // in Node.js or RingoJS v0.8.0+
|
||||||
|
freeModule.exports = base64;
|
||||||
|
} else { // in Narwhal or RingoJS v0.7.0-
|
||||||
|
for (var key in base64) {
|
||||||
|
base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // in Rhino or a web browser
|
||||||
|
root.base64 = base64;
|
||||||
|
}
|
||||||
|
|
||||||
|
}(this));
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 45447:
|
/***/ 45447:
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -731,6 +731,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
base-64
|
||||||
|
MIT
|
||||||
|
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
bcrypt-pbkdf
|
bcrypt-pbkdf
|
||||||
BSD-3-Clause
|
BSD-3-Clause
|
||||||
The Blowfish portions are under the following license:
|
The Blowfish portions are under the following license:
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"async-wait-until": "^2.0.7",
|
"async-wait-until": "^2.0.7",
|
||||||
"aws-sdk": "^2.812.0",
|
"aws-sdk": "^2.812.0",
|
||||||
|
"base-64": "^1.0.0",
|
||||||
"commander": "^8.3.0",
|
"commander": "^8.3.0",
|
||||||
"commander-ts": "^0.2.0",
|
"commander-ts": "^0.2.0",
|
||||||
"kubernetes-client": "^9.0.0",
|
"kubernetes-client": "^9.0.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { CoreV1Api } from '@kubernetes/client-node';
|
import { CoreV1Api } from '@kubernetes/client-node';
|
||||||
import CloudRunnerSecret from '../services/cloud-runner-secret';
|
import CloudRunnerSecret from '../services/cloud-runner-secret';
|
||||||
import * as k8s from '@kubernetes/client-node';
|
import * as k8s from '@kubernetes/client-node';
|
||||||
|
const base64 = require('base-64');
|
||||||
|
|
||||||
class KubernetesSecret {
|
class KubernetesSecret {
|
||||||
static async createSecret(
|
static async createSecret(
|
||||||
|
|
@ -18,7 +19,8 @@ class KubernetesSecret {
|
||||||
};
|
};
|
||||||
secret.data = {};
|
secret.data = {};
|
||||||
for (const buildSecret of secrets) {
|
for (const buildSecret of secrets) {
|
||||||
secret.data[buildSecret.ParameterKey] = buildSecret.ParameterValue;
|
secret.data[buildSecret.EnvironmentVariable] = base64.encode(buildSecret.ParameterValue);
|
||||||
|
secret.data[`${buildSecret.EnvironmentVariable}_NAME`] = base64.encode(buildSecret.ParameterKey);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await kubeClient.createNamespacedSecret(namespace, secret);
|
await kubeClient.createNamespacedSecret(namespace, secret);
|
||||||
|
|
|
||||||
|
|
@ -1505,6 +1505,11 @@ balanced-match@^1.0.0:
|
||||||
resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"
|
resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"
|
||||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||||
|
|
||||||
|
base-64@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz"
|
||||||
|
integrity sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==
|
||||||
|
|
||||||
base64-js@^1.0.2:
|
base64-js@^1.0.2:
|
||||||
version "1.5.1"
|
version "1.5.1"
|
||||||
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
|
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue