@firestartr/cli 2.10.0-snapshot-org-secrets-fix-1 → 2.10.0-snapshot-fix-renderer-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +20 -1649
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +0 -719
- package/build/packages/cdk8s_renderer/src/charts/github/index.d.ts +0 -2
- package/build/packages/cdk8s_renderer/src/charts/index.d.ts +1 -3
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +0 -135
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +0 -135
- package/build/packages/cdk8s_renderer/src/claims/github/orgSettings.d.ts +0 -26
- package/build/packages/cdk8s_renderer/src/claims/github/orgsettings.schema.d.ts +0 -70
- package/build/packages/cdk8s_renderer/src/renderer/claims-render.d.ts +1 -1
- package/build/packages/cdk8s_renderer/src/renderer/previous-crs-extractor.d.ts +1 -1
- package/build/packages/github/index.d.ts +1 -8
- package/build/packages/github/src/organization.d.ts +0 -2
- package/build/packages/github/src/with_profile.d.ts +0 -1
- package/package.json +2 -3
- package/build/packages/cdk8s_renderer/src/charts/github/orgSecretSectionChart.d.ts +0 -8
- package/build/packages/cdk8s_renderer/src/charts/github/orgVariableSectionChart.d.ts +0 -8
- package/build/packages/cdk8s_renderer/src/claims/github/orgSecrets.schema.d.ts +0 -67
- package/build/packages/cdk8s_renderer/src/validations/githubOrgSecretSection.d.ts +0 -4
- package/build/packages/cdk8s_renderer/src/validations/githubOrgVariableSection.d.ts +0 -3
- package/build/packages/gh_provisioner/src/entities/ghorgsecretsection/index.d.ts +0 -7
- package/build/packages/gh_provisioner/src/entities/ghorgsecretsection/secrets.d.ts +0 -16
- package/build/packages/gh_provisioner/src/entities/ghorgvarsection/index.d.ts +0 -8
- package/build/packages/github/src/orgSecrets.d.ts +0 -10
package/build/index.js
CHANGED
|
@@ -280314,7 +280314,7 @@ function getCronNextInterval(cronLine, tz) {
|
|
|
280314
280314
|
|
|
280315
280315
|
/***/ }),
|
|
280316
280316
|
|
|
280317
|
-
/***/
|
|
280317
|
+
/***/ 99029:
|
|
280318
280318
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
|
280319
280319
|
|
|
280320
280320
|
// ESM COMPAT FLAG
|
|
@@ -284613,17 +284613,6 @@ async function doPaginatedRequest(options) {
|
|
|
284613
284613
|
'Cache-Control': 'no-cache',
|
|
284614
284614
|
});
|
|
284615
284615
|
}
|
|
284616
|
-
async function getOrgVariable(org, variableName, octokit) {
|
|
284617
|
-
logger.info(`Getting org variable ${variableName} for org ${org}`);
|
|
284618
|
-
if (!octokit) {
|
|
284619
|
-
octokit = await getOctokitForOrg(org);
|
|
284620
|
-
}
|
|
284621
|
-
const response = await octokit.rest.actions.getOrgVariable({
|
|
284622
|
-
org,
|
|
284623
|
-
name: variableName,
|
|
284624
|
-
});
|
|
284625
|
-
return response.data;
|
|
284626
|
-
}
|
|
284627
284616
|
/* harmony default export */ const organization = ({
|
|
284628
284617
|
getRepositoryList,
|
|
284629
284618
|
getTeamList,
|
|
@@ -284634,7 +284623,6 @@ async function getOrgVariable(org, variableName, octokit) {
|
|
|
284634
284623
|
getOrgTeamsDirectAccess,
|
|
284635
284624
|
getOrgPlanName,
|
|
284636
284625
|
getWebhookList,
|
|
284637
|
-
getOrgVariable,
|
|
284638
284626
|
});
|
|
284639
284627
|
|
|
284640
284628
|
// EXTERNAL MODULE: external "fs"
|
|
@@ -285979,66 +285967,6 @@ async function encryptRepoSecret(owner, repo, section, plaintextValue, octokit)
|
|
|
285979
285967
|
}
|
|
285980
285968
|
}
|
|
285981
285969
|
|
|
285982
|
-
;// CONCATENATED MODULE: ../github/src/orgSecrets.ts
|
|
285983
|
-
|
|
285984
|
-
|
|
285985
|
-
|
|
285986
|
-
async function getOrgPublicKey(org, section, octokit) {
|
|
285987
|
-
logger.info(`Retrieving org public key for ${org} (${section})`);
|
|
285988
|
-
try {
|
|
285989
|
-
if (!octokit) {
|
|
285990
|
-
octokit = await getOctokitForOrg(org);
|
|
285991
|
-
}
|
|
285992
|
-
const { data } = await octokit.rest[`${section}`].getOrgPublicKey({
|
|
285993
|
-
org,
|
|
285994
|
-
});
|
|
285995
|
-
return data;
|
|
285996
|
-
}
|
|
285997
|
-
catch (error) {
|
|
285998
|
-
logger.error(`Error retrieving org public key (${section}) for ${org}: ${error}`);
|
|
285999
|
-
throw error;
|
|
286000
|
-
}
|
|
286001
|
-
}
|
|
286002
|
-
async function encryptOrgSecret(org, section, plaintextValue, preFetchedKey, octokit) {
|
|
286003
|
-
try {
|
|
286004
|
-
const { key_id, key } = preFetchedKey
|
|
286005
|
-
? preFetchedKey
|
|
286006
|
-
: await getOrgPublicKey(org, section, octokit);
|
|
286007
|
-
await libsodium_wrappers.ready;
|
|
286008
|
-
const publicKey = libsodium_wrappers.from_base64(key, libsodium_wrappers.base64_variants.ORIGINAL);
|
|
286009
|
-
const secretBytes = libsodium_wrappers.from_string(plaintextValue);
|
|
286010
|
-
const encryptedBytes = libsodium_wrappers.crypto_box_seal(secretBytes, publicKey);
|
|
286011
|
-
const encryptedValue = libsodium_wrappers.to_base64(encryptedBytes, libsodium_wrappers.base64_variants.ORIGINAL);
|
|
286012
|
-
return {
|
|
286013
|
-
key_id,
|
|
286014
|
-
encrypted_value: encryptedValue,
|
|
286015
|
-
};
|
|
286016
|
-
}
|
|
286017
|
-
catch (err) {
|
|
286018
|
-
logger.error(`Error encrypting org secret (${section}) for ${org}: ${err}`);
|
|
286019
|
-
throw err;
|
|
286020
|
-
}
|
|
286021
|
-
}
|
|
286022
|
-
async function getOrgSecret(org, section, name, octokit) {
|
|
286023
|
-
logger.info(`Checking org secret ${name} (${section}) for ${org}`);
|
|
286024
|
-
try {
|
|
286025
|
-
if (!octokit) {
|
|
286026
|
-
octokit = await getOctokitForOrg(org);
|
|
286027
|
-
}
|
|
286028
|
-
const response = await octokit.rest[`${section}`].getOrgSecret({
|
|
286029
|
-
org,
|
|
286030
|
-
secret_name: name,
|
|
286031
|
-
});
|
|
286032
|
-
return response.data;
|
|
286033
|
-
}
|
|
286034
|
-
catch (err) {
|
|
286035
|
-
if (err && err.status === 404) {
|
|
286036
|
-
return null;
|
|
286037
|
-
}
|
|
286038
|
-
throw err;
|
|
286039
|
-
}
|
|
286040
|
-
}
|
|
286041
|
-
|
|
286042
285970
|
;// CONCATENATED MODULE: ../github/src/profile.ts
|
|
286043
285971
|
// Profile definitions and store for github package (immutable and ambient profiles)
|
|
286044
285972
|
const profileStore = new Map();
|
|
@@ -286187,10 +286115,6 @@ function createFacade(profileName) {
|
|
|
286187
286115
|
const octokit = await getOctokitForOrg(orgName);
|
|
286188
286116
|
return getOrgPlanName(orgName, octokit);
|
|
286189
286117
|
},
|
|
286190
|
-
getOrgVariable: async (orgName, variableName) => {
|
|
286191
|
-
const octokit = await getOctokitForOrg(orgName);
|
|
286192
|
-
return getOrgVariable(orgName, variableName, octokit);
|
|
286193
|
-
},
|
|
286194
286118
|
},
|
|
286195
286119
|
repo: {
|
|
286196
286120
|
addStatusCheck: async (output, isFailure, headSha, name, status, repoName, owner) => {
|
|
@@ -286472,7 +286396,6 @@ function withProfile(profileName) {
|
|
|
286472
286396
|
|
|
286473
286397
|
|
|
286474
286398
|
|
|
286475
|
-
|
|
286476
286399
|
/* harmony default export */ const github = ({
|
|
286477
286400
|
org: organization,
|
|
286478
286401
|
repo: repository,
|
|
@@ -286495,9 +286418,6 @@ function withProfile(profileName) {
|
|
|
286495
286418
|
encryption: {
|
|
286496
286419
|
encryptRepoSecret: encryptRepoSecret,
|
|
286497
286420
|
getRepoPublicKey: getRepoPublicKey,
|
|
286498
|
-
getOrgPublicKey: getOrgPublicKey,
|
|
286499
|
-
encryptOrgSecret: encryptOrgSecret,
|
|
286500
|
-
getOrgSecret: getOrgSecret,
|
|
286501
286421
|
},
|
|
286502
286422
|
withProfile: withProfile,
|
|
286503
286423
|
createProfile: createProfile,
|
|
@@ -319398,8 +319318,8 @@ var dist = __nccwpck_require__(44516);
|
|
|
319398
319318
|
var dist_default = /*#__PURE__*/__nccwpck_require__.n(dist);
|
|
319399
319319
|
// EXTERNAL MODULE: ../catalog_common/index.ts + 44 modules
|
|
319400
319320
|
var catalog_common = __nccwpck_require__(78542);
|
|
319401
|
-
// EXTERNAL MODULE: ../github/index.ts +
|
|
319402
|
-
var github = __nccwpck_require__(
|
|
319321
|
+
// EXTERNAL MODULE: ../github/index.ts + 37 modules
|
|
319322
|
+
var github = __nccwpck_require__(99029);
|
|
319403
319323
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/patches/base.ts
|
|
319404
319324
|
class BasePatches {
|
|
319405
319325
|
constructor() { }
|
|
@@ -319602,14 +319522,9 @@ class UUIDInitializer extends InitializerPatches {
|
|
|
319602
319522
|
},
|
|
319603
319523
|
apply(cr) {
|
|
319604
319524
|
const ctx = helperCTX(this);
|
|
319605
|
-
const
|
|
319606
|
-
|
|
319607
|
-
|
|
319608
|
-
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319609
|
-
(0,wrapper.v4)()
|
|
319610
|
-
: cr.spec?.firestartr?.tfStateKey ||
|
|
319611
|
-
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319612
|
-
(0,wrapper.v4)();
|
|
319525
|
+
const uuid = previousCR?.spec?.firestartr?.tfStateKey ||
|
|
319526
|
+
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319527
|
+
(0,wrapper.v4)();
|
|
319613
319528
|
if (!cr.spec)
|
|
319614
319529
|
cr.spec = {};
|
|
319615
319530
|
if (!cr.spec.firestartr)
|
|
@@ -319985,23 +319900,25 @@ class DefaultSection extends BasePatches {
|
|
|
319985
319900
|
return [
|
|
319986
319901
|
{
|
|
319987
319902
|
async apply(cr) {
|
|
319903
|
+
let currentPatchData = patchData;
|
|
319988
319904
|
// Merge object arrays
|
|
319989
|
-
const mergeResult = await __self._mergeObjectArrays(cr,
|
|
319905
|
+
const mergeResult = await __self._mergeObjectArrays(cr, currentPatchData, mergeFilterFn, arrayPaths);
|
|
319990
319906
|
cr = mergeResult.cr;
|
|
319991
|
-
|
|
319907
|
+
currentPatchData = mergeResult.patchData;
|
|
319992
319908
|
// Get the patch list
|
|
319993
|
-
const patchList = getPatchesFn(cr,
|
|
319909
|
+
const patchList = getPatchesFn(cr, currentPatchData);
|
|
319994
319910
|
// We apply the patches, update the cr.spec field and return the CR
|
|
319995
319911
|
cr.spec = fast_json_patch_default().applyPatch(cr.spec, patchList).newDocument;
|
|
319996
319912
|
return cr;
|
|
319997
319913
|
},
|
|
319998
319914
|
async validate(cr) {
|
|
319915
|
+
let currentPatchData = patchData;
|
|
319999
319916
|
// Merge object arrays
|
|
320000
|
-
const mergeResult = await __self._mergeObjectArrays(cr,
|
|
319917
|
+
const mergeResult = await __self._mergeObjectArrays(cr, currentPatchData, mergeFilterFn, arrayPaths);
|
|
320001
319918
|
cr = mergeResult.cr;
|
|
320002
|
-
|
|
319919
|
+
currentPatchData = mergeResult.patchData;
|
|
320003
319920
|
// Get the patch list
|
|
320004
|
-
const patchList = getPatchesFn(cr,
|
|
319921
|
+
const patchList = getPatchesFn(cr, currentPatchData);
|
|
320005
319922
|
// If the patchList array has length greater than 0,
|
|
320006
319923
|
// that must mean some operation was either overriden or not
|
|
320007
319924
|
// done at all. That would make our CR invalid
|
|
@@ -320151,7 +320068,6 @@ const ONE_WAY_DEFINITIONS = [
|
|
|
320151
320068
|
'/spec/vars',
|
|
320152
320069
|
'/spec/actions/oidc',
|
|
320153
320070
|
'/spec/repo/labels',
|
|
320154
|
-
'/spec/actionsVariables',
|
|
320155
320071
|
];
|
|
320156
320072
|
function applyOneWayDefs(crSpecs) {
|
|
320157
320073
|
const crSpecsClone = JSON.parse(JSON.stringify(crSpecs));
|
|
@@ -322147,50 +322063,6 @@ function extractAllRefs(claimData) {
|
|
|
322147
322063
|
refs.push(...secretsRefs);
|
|
322148
322064
|
break;
|
|
322149
322065
|
}
|
|
322150
|
-
case 'OrgSettingsClaim': {
|
|
322151
|
-
const actionsVariables = parsedClaim.providers?.github?.actions_variables;
|
|
322152
|
-
if (Array.isArray(actionsVariables)) {
|
|
322153
|
-
for (const variable of actionsVariables) {
|
|
322154
|
-
if (variable.visibility !== 'selected')
|
|
322155
|
-
continue;
|
|
322156
|
-
const selectedRepos = variable.selected_repositories;
|
|
322157
|
-
if (!Array.isArray(selectedRepos))
|
|
322158
|
-
continue;
|
|
322159
|
-
for (const repoRef of selectedRepos) {
|
|
322160
|
-
const match = repoRef.match(/^component:(.+)$/);
|
|
322161
|
-
if (match) {
|
|
322162
|
-
refs.push(`ComponentClaim-${match[1]}`);
|
|
322163
|
-
}
|
|
322164
|
-
}
|
|
322165
|
-
}
|
|
322166
|
-
}
|
|
322167
|
-
const orgSecrets = parsedClaim.providers?.github?.org_secrets;
|
|
322168
|
-
if (orgSecrets && typeof orgSecrets === 'object') {
|
|
322169
|
-
const secretRefRegex = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
322170
|
-
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
322171
|
-
const secrets = orgSecrets[section];
|
|
322172
|
-
if (!Array.isArray(secrets))
|
|
322173
|
-
continue;
|
|
322174
|
-
for (const secret of secrets) {
|
|
322175
|
-
if (secret.value) {
|
|
322176
|
-
const match = secret.value.match(secretRefRegex);
|
|
322177
|
-
if (match) {
|
|
322178
|
-
refs.push(`SecretsClaim-${match[1]}`);
|
|
322179
|
-
}
|
|
322180
|
-
}
|
|
322181
|
-
if (Array.isArray(secret.selected_repositories)) {
|
|
322182
|
-
for (const repoRef of secret.selected_repositories) {
|
|
322183
|
-
const compMatch = repoRef.match(/^component:(.+)$/);
|
|
322184
|
-
if (compMatch) {
|
|
322185
|
-
refs.push(`ComponentClaim-${compMatch[1]}`);
|
|
322186
|
-
}
|
|
322187
|
-
}
|
|
322188
|
-
}
|
|
322189
|
-
}
|
|
322190
|
-
}
|
|
322191
|
-
}
|
|
322192
|
-
break;
|
|
322193
|
-
}
|
|
322194
322066
|
}
|
|
322195
322067
|
logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
|
|
322196
322068
|
return [...new Set(refs)];
|
|
@@ -323317,73 +323189,6 @@ const organizationSettingsProperties = {
|
|
|
323317
323189
|
secret_scanning_push_protection_enabled_for_new_repositories: {
|
|
323318
323190
|
type: 'boolean',
|
|
323319
323191
|
},
|
|
323320
|
-
actions_variables: {
|
|
323321
|
-
type: 'array',
|
|
323322
|
-
items: {
|
|
323323
|
-
type: 'object',
|
|
323324
|
-
properties: {
|
|
323325
|
-
name: {
|
|
323326
|
-
type: 'string',
|
|
323327
|
-
pattern: '^[A-Za-z0-9_]+$',
|
|
323328
|
-
},
|
|
323329
|
-
value: {
|
|
323330
|
-
type: 'string',
|
|
323331
|
-
},
|
|
323332
|
-
visibility: {
|
|
323333
|
-
type: 'string',
|
|
323334
|
-
enum: ['all', 'private', 'selected'],
|
|
323335
|
-
},
|
|
323336
|
-
selected_repositories: {
|
|
323337
|
-
type: 'array',
|
|
323338
|
-
items: {
|
|
323339
|
-
$ref: 'firestartr.dev://common/FirestartrComponentRef',
|
|
323340
|
-
},
|
|
323341
|
-
},
|
|
323342
|
-
},
|
|
323343
|
-
required: ['name', 'value', 'visibility'],
|
|
323344
|
-
additionalProperties: false,
|
|
323345
|
-
allOf: [
|
|
323346
|
-
{
|
|
323347
|
-
if: {
|
|
323348
|
-
properties: {
|
|
323349
|
-
visibility: { const: 'selected' },
|
|
323350
|
-
},
|
|
323351
|
-
required: ['visibility'],
|
|
323352
|
-
},
|
|
323353
|
-
then: {},
|
|
323354
|
-
else: {
|
|
323355
|
-
properties: {
|
|
323356
|
-
selected_repositories: { type: 'array', maxItems: 0 },
|
|
323357
|
-
},
|
|
323358
|
-
},
|
|
323359
|
-
},
|
|
323360
|
-
],
|
|
323361
|
-
},
|
|
323362
|
-
},
|
|
323363
|
-
org_secrets: {
|
|
323364
|
-
type: 'object',
|
|
323365
|
-
properties: {
|
|
323366
|
-
actions: {
|
|
323367
|
-
type: 'array',
|
|
323368
|
-
items: {
|
|
323369
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323370
|
-
},
|
|
323371
|
-
},
|
|
323372
|
-
codespaces: {
|
|
323373
|
-
type: 'array',
|
|
323374
|
-
items: {
|
|
323375
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323376
|
-
},
|
|
323377
|
-
},
|
|
323378
|
-
dependabot: {
|
|
323379
|
-
type: 'array',
|
|
323380
|
-
items: {
|
|
323381
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323382
|
-
},
|
|
323383
|
-
},
|
|
323384
|
-
},
|
|
323385
|
-
additionalProperties: false,
|
|
323386
|
-
},
|
|
323387
323192
|
};
|
|
323388
323193
|
/* harmony default export */ const github_orgsettings_schema = ({
|
|
323389
323194
|
$schema: SCHEMA,
|
|
@@ -323571,75 +323376,6 @@ const organizationSettingsProperties = {
|
|
|
323571
323376
|
},
|
|
323572
323377
|
});
|
|
323573
323378
|
|
|
323574
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/orgSecrets.schema.ts
|
|
323575
|
-
|
|
323576
|
-
/* harmony default export */ const orgSecrets_schema = ({
|
|
323577
|
-
$schema: SCHEMA,
|
|
323578
|
-
$id: 'GithubOrgClaimSecrets',
|
|
323579
|
-
definitions: {
|
|
323580
|
-
GithubOrgClaimSecrets: {
|
|
323581
|
-
$id: 'firestartr.dev://github/GithubOrgClaimSecrets',
|
|
323582
|
-
type: 'object',
|
|
323583
|
-
description: 'Organization-level GitHub Actions secrets',
|
|
323584
|
-
properties: {
|
|
323585
|
-
actions: {
|
|
323586
|
-
type: 'array',
|
|
323587
|
-
items: {
|
|
323588
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323589
|
-
},
|
|
323590
|
-
},
|
|
323591
|
-
codespaces: {
|
|
323592
|
-
type: 'array',
|
|
323593
|
-
items: {
|
|
323594
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323595
|
-
},
|
|
323596
|
-
},
|
|
323597
|
-
dependabot: {
|
|
323598
|
-
type: 'array',
|
|
323599
|
-
items: {
|
|
323600
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323601
|
-
},
|
|
323602
|
-
},
|
|
323603
|
-
},
|
|
323604
|
-
additionalProperties: false,
|
|
323605
|
-
},
|
|
323606
|
-
GithubOrgClaimSecretRef: {
|
|
323607
|
-
$id: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323608
|
-
type: 'string',
|
|
323609
|
-
description: 'the reference of the secret',
|
|
323610
|
-
pattern: '^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
|
|
323611
|
-
},
|
|
323612
|
-
GithubOrgClaimSecret: {
|
|
323613
|
-
$id: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323614
|
-
type: 'object',
|
|
323615
|
-
description: 'An organization-level secret for GitHub Actions',
|
|
323616
|
-
properties: {
|
|
323617
|
-
name: {
|
|
323618
|
-
type: 'string',
|
|
323619
|
-
description: 'the name of the secret',
|
|
323620
|
-
},
|
|
323621
|
-
value: {
|
|
323622
|
-
$ref: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323623
|
-
},
|
|
323624
|
-
visibility: {
|
|
323625
|
-
type: 'string',
|
|
323626
|
-
enum: ['all', 'selected', 'private'],
|
|
323627
|
-
description: 'which repositories can access the secret',
|
|
323628
|
-
},
|
|
323629
|
-
selected_repositories: {
|
|
323630
|
-
type: 'array',
|
|
323631
|
-
items: {
|
|
323632
|
-
type: 'string',
|
|
323633
|
-
},
|
|
323634
|
-
description: 'list of repository refs when visibility is selected',
|
|
323635
|
-
},
|
|
323636
|
-
},
|
|
323637
|
-
required: ['name', 'value'],
|
|
323638
|
-
additionalProperties: false,
|
|
323639
|
-
},
|
|
323640
|
-
},
|
|
323641
|
-
});
|
|
323642
|
-
|
|
323643
323379
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
|
|
323644
323380
|
|
|
323645
323381
|
|
|
@@ -323649,7 +323385,6 @@ const organizationSettingsProperties = {
|
|
|
323649
323385
|
|
|
323650
323386
|
|
|
323651
323387
|
|
|
323652
|
-
|
|
323653
323388
|
const GithubSchemas = [
|
|
323654
323389
|
github_group_schema,
|
|
323655
323390
|
github_user_schema,
|
|
@@ -323659,7 +323394,6 @@ const GithubSchemas = [
|
|
|
323659
323394
|
github_orgsettings_schema,
|
|
323660
323395
|
component_secrets_vars_schema,
|
|
323661
323396
|
component_labels_schema,
|
|
323662
|
-
orgSecrets_schema,
|
|
323663
323397
|
];
|
|
323664
323398
|
|
|
323665
323399
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
|
|
@@ -326806,7 +326540,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
|
|
|
326806
326540
|
function isVariantCR(cr) {
|
|
326807
326541
|
return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
|
|
326808
326542
|
}
|
|
326809
|
-
function getPreviousCRfromClaim(claim, previousCRs
|
|
326543
|
+
function getPreviousCRfromClaim(claim, previousCRs) {
|
|
326810
326544
|
const previousCRsKeys = Object.keys(previousCRs);
|
|
326811
326545
|
const isVariantClaim = !!claim._parentClaimName;
|
|
326812
326546
|
for (const previousCRKey of previousCRsKeys) {
|
|
@@ -326815,8 +326549,6 @@ function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
|
|
|
326815
326549
|
continue;
|
|
326816
326550
|
if (isExcludedFromPreviousCR(previousCR.kind))
|
|
326817
326551
|
continue;
|
|
326818
|
-
if (expectedKind && previousCR.kind !== expectedKind)
|
|
326819
|
-
continue;
|
|
326820
326552
|
const crVariant = isVariantCR(previousCR);
|
|
326821
326553
|
if (isVariantClaim && !crVariant)
|
|
326822
326554
|
continue;
|
|
@@ -327573,382 +327305,6 @@ var FirestartrGithubMembershipSpecContextProviderRefKind;
|
|
|
327573
327305
|
/** FirestartrProviderConfig */
|
|
327574
327306
|
FirestartrGithubMembershipSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327575
327307
|
})(FirestartrGithubMembershipSpecContextProviderRefKind || (FirestartrGithubMembershipSpecContextProviderRefKind = {}));
|
|
327576
|
-
/**
|
|
327577
|
-
* A resource to handle GitHub Organization Actions Secrets.
|
|
327578
|
-
*
|
|
327579
|
-
* @schema FirestartrGithubOrganizationSecretSection
|
|
327580
|
-
*/
|
|
327581
|
-
class FirestartrGithubOrganizationSecretSection extends lib.ApiObject {
|
|
327582
|
-
/**
|
|
327583
|
-
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationSecretSection".
|
|
327584
|
-
*
|
|
327585
|
-
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
327586
|
-
*
|
|
327587
|
-
* @param props initialization props
|
|
327588
|
-
*/
|
|
327589
|
-
static manifest(props) {
|
|
327590
|
-
return {
|
|
327591
|
-
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327592
|
-
...toJson_FirestartrGithubOrganizationSecretSectionProps(props),
|
|
327593
|
-
};
|
|
327594
|
-
}
|
|
327595
|
-
/**
|
|
327596
|
-
* Defines a "FirestartrGithubOrganizationSecretSection" API object
|
|
327597
|
-
* @param scope the scope in which to define this object
|
|
327598
|
-
* @param id a scope-local name for the object
|
|
327599
|
-
* @param props initialization props
|
|
327600
|
-
*/
|
|
327601
|
-
constructor(scope, id, props) {
|
|
327602
|
-
super(scope, id, {
|
|
327603
|
-
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327604
|
-
...props,
|
|
327605
|
-
});
|
|
327606
|
-
}
|
|
327607
|
-
/**
|
|
327608
|
-
* Renders the object to Kubernetes JSON.
|
|
327609
|
-
*/
|
|
327610
|
-
toJson() {
|
|
327611
|
-
const resolved = super.toJson();
|
|
327612
|
-
return {
|
|
327613
|
-
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327614
|
-
...toJson_FirestartrGithubOrganizationSecretSectionProps(resolved),
|
|
327615
|
-
};
|
|
327616
|
-
}
|
|
327617
|
-
}
|
|
327618
|
-
/**
|
|
327619
|
-
* Returns the apiVersion and kind for "FirestartrGithubOrganizationSecretSection"
|
|
327620
|
-
*/
|
|
327621
|
-
FirestartrGithubOrganizationSecretSection.GVK = {
|
|
327622
|
-
apiVersion: 'firestartr.dev/v1',
|
|
327623
|
-
kind: 'FirestartrGithubOrganizationSecretSection',
|
|
327624
|
-
};
|
|
327625
|
-
|
|
327626
|
-
/**
|
|
327627
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionProps' to JSON representation.
|
|
327628
|
-
*/
|
|
327629
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327630
|
-
function toJson_FirestartrGithubOrganizationSecretSectionProps(obj) {
|
|
327631
|
-
if (obj === undefined) {
|
|
327632
|
-
return undefined;
|
|
327633
|
-
}
|
|
327634
|
-
const result = {
|
|
327635
|
-
'metadata': obj.metadata,
|
|
327636
|
-
'spec': toJson_FirestartrGithubOrganizationSecretSectionSpec(obj.spec),
|
|
327637
|
-
};
|
|
327638
|
-
// filter undefined values
|
|
327639
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327640
|
-
}
|
|
327641
|
-
/**
|
|
327642
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpec' to JSON representation.
|
|
327643
|
-
*/
|
|
327644
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327645
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpec(obj) {
|
|
327646
|
-
if (obj === undefined) {
|
|
327647
|
-
return undefined;
|
|
327648
|
-
}
|
|
327649
|
-
const result = {
|
|
327650
|
-
'org': obj.org,
|
|
327651
|
-
'secrets': toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj.secrets),
|
|
327652
|
-
'context': toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj.context),
|
|
327653
|
-
'firestartr': toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj.firestartr),
|
|
327654
|
-
};
|
|
327655
|
-
// filter undefined values
|
|
327656
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327657
|
-
}
|
|
327658
|
-
/**
|
|
327659
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecrets' to JSON representation.
|
|
327660
|
-
*/
|
|
327661
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327662
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj) {
|
|
327663
|
-
if (obj === undefined) {
|
|
327664
|
-
return undefined;
|
|
327665
|
-
}
|
|
327666
|
-
const result = {
|
|
327667
|
-
'actions': obj.actions?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(y)),
|
|
327668
|
-
'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(y)),
|
|
327669
|
-
'dependabot': obj.dependabot?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(y)),
|
|
327670
|
-
};
|
|
327671
|
-
// filter undefined values
|
|
327672
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327673
|
-
}
|
|
327674
|
-
/**
|
|
327675
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContext' to JSON representation.
|
|
327676
|
-
*/
|
|
327677
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327678
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj) {
|
|
327679
|
-
if (obj === undefined) {
|
|
327680
|
-
return undefined;
|
|
327681
|
-
}
|
|
327682
|
-
const result = {
|
|
327683
|
-
'backend': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj.backend),
|
|
327684
|
-
'provider': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj.provider),
|
|
327685
|
-
};
|
|
327686
|
-
// filter undefined values
|
|
327687
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327688
|
-
}
|
|
327689
|
-
/**
|
|
327690
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecFirestartr' to JSON representation.
|
|
327691
|
-
*/
|
|
327692
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327693
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj) {
|
|
327694
|
-
if (obj === undefined) {
|
|
327695
|
-
return undefined;
|
|
327696
|
-
}
|
|
327697
|
-
const result = {
|
|
327698
|
-
'tfStateKey': obj.tfStateKey,
|
|
327699
|
-
};
|
|
327700
|
-
// filter undefined values
|
|
327701
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327702
|
-
}
|
|
327703
|
-
/**
|
|
327704
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActions' to JSON representation.
|
|
327705
|
-
*/
|
|
327706
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327707
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(obj) {
|
|
327708
|
-
if (obj === undefined) {
|
|
327709
|
-
return undefined;
|
|
327710
|
-
}
|
|
327711
|
-
const result = {
|
|
327712
|
-
'name': obj.name,
|
|
327713
|
-
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj.ref),
|
|
327714
|
-
'visibility': obj.visibility,
|
|
327715
|
-
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327716
|
-
};
|
|
327717
|
-
// filter undefined values
|
|
327718
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327719
|
-
}
|
|
327720
|
-
/**
|
|
327721
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces' to JSON representation.
|
|
327722
|
-
*/
|
|
327723
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327724
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(obj) {
|
|
327725
|
-
if (obj === undefined) {
|
|
327726
|
-
return undefined;
|
|
327727
|
-
}
|
|
327728
|
-
const result = {
|
|
327729
|
-
'name': obj.name,
|
|
327730
|
-
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj.ref),
|
|
327731
|
-
'visibility': obj.visibility,
|
|
327732
|
-
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327733
|
-
};
|
|
327734
|
-
// filter undefined values
|
|
327735
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327736
|
-
}
|
|
327737
|
-
/**
|
|
327738
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot' to JSON representation.
|
|
327739
|
-
*/
|
|
327740
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327741
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(obj) {
|
|
327742
|
-
if (obj === undefined) {
|
|
327743
|
-
return undefined;
|
|
327744
|
-
}
|
|
327745
|
-
const result = {
|
|
327746
|
-
'name': obj.name,
|
|
327747
|
-
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj.ref),
|
|
327748
|
-
'visibility': obj.visibility,
|
|
327749
|
-
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327750
|
-
};
|
|
327751
|
-
// filter undefined values
|
|
327752
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327753
|
-
}
|
|
327754
|
-
/**
|
|
327755
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackend' to JSON representation.
|
|
327756
|
-
*/
|
|
327757
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327758
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj) {
|
|
327759
|
-
if (obj === undefined) {
|
|
327760
|
-
return undefined;
|
|
327761
|
-
}
|
|
327762
|
-
const result = {
|
|
327763
|
-
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj.ref),
|
|
327764
|
-
};
|
|
327765
|
-
// filter undefined values
|
|
327766
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327767
|
-
}
|
|
327768
|
-
/**
|
|
327769
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProvider' to JSON representation.
|
|
327770
|
-
*/
|
|
327771
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327772
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj) {
|
|
327773
|
-
if (obj === undefined) {
|
|
327774
|
-
return undefined;
|
|
327775
|
-
}
|
|
327776
|
-
const result = {
|
|
327777
|
-
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj.ref),
|
|
327778
|
-
};
|
|
327779
|
-
// filter undefined values
|
|
327780
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327781
|
-
}
|
|
327782
|
-
/**
|
|
327783
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef' to JSON representation.
|
|
327784
|
-
*/
|
|
327785
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327786
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj) {
|
|
327787
|
-
if (obj === undefined) {
|
|
327788
|
-
return undefined;
|
|
327789
|
-
}
|
|
327790
|
-
const result = {
|
|
327791
|
-
'kind': obj.kind,
|
|
327792
|
-
'name': obj.name,
|
|
327793
|
-
'key': obj.key,
|
|
327794
|
-
};
|
|
327795
|
-
// filter undefined values
|
|
327796
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327797
|
-
}
|
|
327798
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327799
|
-
/**
|
|
327800
|
-
* Which repositories can access the secret.
|
|
327801
|
-
*
|
|
327802
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility
|
|
327803
|
-
*/
|
|
327804
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility;
|
|
327805
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility) {
|
|
327806
|
-
/** all */
|
|
327807
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["ALL"] = "all";
|
|
327808
|
-
/** selected */
|
|
327809
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["SELECTED"] = "selected";
|
|
327810
|
-
/** private */
|
|
327811
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["PRIVATE"] = "private";
|
|
327812
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility = {}));
|
|
327813
|
-
/**
|
|
327814
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef' to JSON representation.
|
|
327815
|
-
*/
|
|
327816
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327817
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj) {
|
|
327818
|
-
if (obj === undefined) {
|
|
327819
|
-
return undefined;
|
|
327820
|
-
}
|
|
327821
|
-
const result = {
|
|
327822
|
-
'kind': obj.kind,
|
|
327823
|
-
'name': obj.name,
|
|
327824
|
-
'key': obj.key,
|
|
327825
|
-
};
|
|
327826
|
-
// filter undefined values
|
|
327827
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327828
|
-
}
|
|
327829
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327830
|
-
/**
|
|
327831
|
-
* Which repositories can access the secret.
|
|
327832
|
-
*
|
|
327833
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility
|
|
327834
|
-
*/
|
|
327835
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility;
|
|
327836
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility) {
|
|
327837
|
-
/** all */
|
|
327838
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["ALL"] = "all";
|
|
327839
|
-
/** selected */
|
|
327840
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["SELECTED"] = "selected";
|
|
327841
|
-
/** private */
|
|
327842
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["PRIVATE"] = "private";
|
|
327843
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility = {}));
|
|
327844
|
-
/**
|
|
327845
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef' to JSON representation.
|
|
327846
|
-
*/
|
|
327847
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327848
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj) {
|
|
327849
|
-
if (obj === undefined) {
|
|
327850
|
-
return undefined;
|
|
327851
|
-
}
|
|
327852
|
-
const result = {
|
|
327853
|
-
'kind': obj.kind,
|
|
327854
|
-
'name': obj.name,
|
|
327855
|
-
'key': obj.key,
|
|
327856
|
-
};
|
|
327857
|
-
// filter undefined values
|
|
327858
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327859
|
-
}
|
|
327860
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327861
|
-
/**
|
|
327862
|
-
* Which repositories can access the secret.
|
|
327863
|
-
*
|
|
327864
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility
|
|
327865
|
-
*/
|
|
327866
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility;
|
|
327867
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility) {
|
|
327868
|
-
/** all */
|
|
327869
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["ALL"] = "all";
|
|
327870
|
-
/** selected */
|
|
327871
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["SELECTED"] = "selected";
|
|
327872
|
-
/** private */
|
|
327873
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["PRIVATE"] = "private";
|
|
327874
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility = {}));
|
|
327875
|
-
/**
|
|
327876
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackendRef' to JSON representation.
|
|
327877
|
-
*/
|
|
327878
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327879
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj) {
|
|
327880
|
-
if (obj === undefined) {
|
|
327881
|
-
return undefined;
|
|
327882
|
-
}
|
|
327883
|
-
const result = {
|
|
327884
|
-
'kind': obj.kind,
|
|
327885
|
-
'name': obj.name,
|
|
327886
|
-
};
|
|
327887
|
-
// filter undefined values
|
|
327888
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327889
|
-
}
|
|
327890
|
-
/**
|
|
327891
|
-
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProviderRef' to JSON representation.
|
|
327892
|
-
*/
|
|
327893
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327894
|
-
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj) {
|
|
327895
|
-
if (obj === undefined) {
|
|
327896
|
-
return undefined;
|
|
327897
|
-
}
|
|
327898
|
-
const result = {
|
|
327899
|
-
'kind': obj.kind,
|
|
327900
|
-
'name': obj.name,
|
|
327901
|
-
};
|
|
327902
|
-
// filter undefined values
|
|
327903
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327904
|
-
}
|
|
327905
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327906
|
-
/**
|
|
327907
|
-
* The type of Kubernetes resource to reference.
|
|
327908
|
-
*
|
|
327909
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind
|
|
327910
|
-
*/
|
|
327911
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind;
|
|
327912
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind) {
|
|
327913
|
-
/** Secret */
|
|
327914
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind["SECRET"] = "Secret";
|
|
327915
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind = {}));
|
|
327916
|
-
/**
|
|
327917
|
-
* The type of Kubernetes resource to reference.
|
|
327918
|
-
*
|
|
327919
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind
|
|
327920
|
-
*/
|
|
327921
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind;
|
|
327922
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind) {
|
|
327923
|
-
/** Secret */
|
|
327924
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind["SECRET"] = "Secret";
|
|
327925
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind = {}));
|
|
327926
|
-
/**
|
|
327927
|
-
* The type of Kubernetes resource to reference.
|
|
327928
|
-
*
|
|
327929
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind
|
|
327930
|
-
*/
|
|
327931
|
-
var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind;
|
|
327932
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind) {
|
|
327933
|
-
/** Secret */
|
|
327934
|
-
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind["SECRET"] = "Secret";
|
|
327935
|
-
})(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind = {}));
|
|
327936
|
-
/**
|
|
327937
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind
|
|
327938
|
-
*/
|
|
327939
|
-
var FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind;
|
|
327940
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind) {
|
|
327941
|
-
/** FirestartrProviderConfig */
|
|
327942
|
-
FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327943
|
-
})(FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind = {}));
|
|
327944
|
-
/**
|
|
327945
|
-
* @schema FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind
|
|
327946
|
-
*/
|
|
327947
|
-
var FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind;
|
|
327948
|
-
(function (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind) {
|
|
327949
|
-
/** FirestartrProviderConfig */
|
|
327950
|
-
FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327951
|
-
})(FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind = {}));
|
|
327952
327308
|
/**
|
|
327953
327309
|
* A resource to handle GitHub Organization Settings.
|
|
327954
327310
|
*
|
|
@@ -328207,254 +327563,6 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
|
|
|
328207
327563
|
/** FirestartrProviderConfig */
|
|
328208
327564
|
FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328209
327565
|
})(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
|
|
328210
|
-
/**
|
|
328211
|
-
* A resource to handle GitHub Organization Actions Variables.
|
|
328212
|
-
*
|
|
328213
|
-
* @schema FirestartrGithubOrganizationVariableSection
|
|
328214
|
-
*/
|
|
328215
|
-
class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
|
|
328216
|
-
/**
|
|
328217
|
-
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
|
|
328218
|
-
*
|
|
328219
|
-
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
328220
|
-
*
|
|
328221
|
-
* @param props initialization props
|
|
328222
|
-
*/
|
|
328223
|
-
static manifest(props) {
|
|
328224
|
-
return {
|
|
328225
|
-
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328226
|
-
...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
|
|
328227
|
-
};
|
|
328228
|
-
}
|
|
328229
|
-
/**
|
|
328230
|
-
* Defines a "FirestartrGithubOrganizationVariableSection" API object
|
|
328231
|
-
* @param scope the scope in which to define this object
|
|
328232
|
-
* @param id a scope-local name for the object
|
|
328233
|
-
* @param props initialization props
|
|
328234
|
-
*/
|
|
328235
|
-
constructor(scope, id, props) {
|
|
328236
|
-
super(scope, id, {
|
|
328237
|
-
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328238
|
-
...props,
|
|
328239
|
-
});
|
|
328240
|
-
}
|
|
328241
|
-
/**
|
|
328242
|
-
* Renders the object to Kubernetes JSON.
|
|
328243
|
-
*/
|
|
328244
|
-
toJson() {
|
|
328245
|
-
const resolved = super.toJson();
|
|
328246
|
-
return {
|
|
328247
|
-
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328248
|
-
...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
|
|
328249
|
-
};
|
|
328250
|
-
}
|
|
328251
|
-
}
|
|
328252
|
-
/**
|
|
328253
|
-
* Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
|
|
328254
|
-
*/
|
|
328255
|
-
FirestartrGithubOrganizationVariableSection.GVK = {
|
|
328256
|
-
apiVersion: 'firestartr.dev/v1',
|
|
328257
|
-
kind: 'FirestartrGithubOrganizationVariableSection',
|
|
328258
|
-
};
|
|
328259
|
-
|
|
328260
|
-
/**
|
|
328261
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
|
|
328262
|
-
*/
|
|
328263
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328264
|
-
function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
|
|
328265
|
-
if (obj === undefined) {
|
|
328266
|
-
return undefined;
|
|
328267
|
-
}
|
|
328268
|
-
const result = {
|
|
328269
|
-
'metadata': obj.metadata,
|
|
328270
|
-
'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
|
|
328271
|
-
};
|
|
328272
|
-
// filter undefined values
|
|
328273
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328274
|
-
}
|
|
328275
|
-
/**
|
|
328276
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
|
|
328277
|
-
*/
|
|
328278
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328279
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
|
|
328280
|
-
if (obj === undefined) {
|
|
328281
|
-
return undefined;
|
|
328282
|
-
}
|
|
328283
|
-
const result = {
|
|
328284
|
-
'org': obj.org,
|
|
328285
|
-
'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
|
|
328286
|
-
'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
|
|
328287
|
-
'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
|
|
328288
|
-
'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
|
|
328289
|
-
};
|
|
328290
|
-
// filter undefined values
|
|
328291
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328292
|
-
}
|
|
328293
|
-
/**
|
|
328294
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
|
|
328295
|
-
*/
|
|
328296
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328297
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
|
|
328298
|
-
if (obj === undefined) {
|
|
328299
|
-
return undefined;
|
|
328300
|
-
}
|
|
328301
|
-
const result = {
|
|
328302
|
-
'name': obj.name,
|
|
328303
|
-
'value': obj.value,
|
|
328304
|
-
'visibility': obj.visibility,
|
|
328305
|
-
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
328306
|
-
};
|
|
328307
|
-
// filter undefined values
|
|
328308
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328309
|
-
}
|
|
328310
|
-
/**
|
|
328311
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
|
|
328312
|
-
*/
|
|
328313
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328314
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
|
|
328315
|
-
if (obj === undefined) {
|
|
328316
|
-
return undefined;
|
|
328317
|
-
}
|
|
328318
|
-
const result = {
|
|
328319
|
-
'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
|
|
328320
|
-
'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
|
|
328321
|
-
};
|
|
328322
|
-
// filter undefined values
|
|
328323
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328324
|
-
}
|
|
328325
|
-
/**
|
|
328326
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
|
|
328327
|
-
*/
|
|
328328
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328329
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
|
|
328330
|
-
if (obj === undefined) {
|
|
328331
|
-
return undefined;
|
|
328332
|
-
}
|
|
328333
|
-
const result = {
|
|
328334
|
-
'tfStateKey': obj.tfStateKey,
|
|
328335
|
-
};
|
|
328336
|
-
// filter undefined values
|
|
328337
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328338
|
-
}
|
|
328339
|
-
/**
|
|
328340
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
|
|
328341
|
-
*/
|
|
328342
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328343
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
|
|
328344
|
-
if (obj === undefined) {
|
|
328345
|
-
return undefined;
|
|
328346
|
-
}
|
|
328347
|
-
const result = {
|
|
328348
|
-
'name': obj.name,
|
|
328349
|
-
'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
|
|
328350
|
-
};
|
|
328351
|
-
// filter undefined values
|
|
328352
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328353
|
-
}
|
|
328354
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328355
|
-
/**
|
|
328356
|
-
* Visibility of the variable
|
|
328357
|
-
*
|
|
328358
|
-
* @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
|
|
328359
|
-
*/
|
|
328360
|
-
var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
|
|
328361
|
-
(function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
|
|
328362
|
-
/** all */
|
|
328363
|
-
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
|
|
328364
|
-
/** private */
|
|
328365
|
-
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
|
|
328366
|
-
/** selected */
|
|
328367
|
-
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
|
|
328368
|
-
})(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
|
|
328369
|
-
/**
|
|
328370
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
|
|
328371
|
-
*/
|
|
328372
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328373
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
|
|
328374
|
-
if (obj === undefined) {
|
|
328375
|
-
return undefined;
|
|
328376
|
-
}
|
|
328377
|
-
const result = {
|
|
328378
|
-
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
|
|
328379
|
-
};
|
|
328380
|
-
// filter undefined values
|
|
328381
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328382
|
-
}
|
|
328383
|
-
/**
|
|
328384
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
|
|
328385
|
-
*/
|
|
328386
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328387
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
|
|
328388
|
-
if (obj === undefined) {
|
|
328389
|
-
return undefined;
|
|
328390
|
-
}
|
|
328391
|
-
const result = {
|
|
328392
|
-
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
|
|
328393
|
-
};
|
|
328394
|
-
// filter undefined values
|
|
328395
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328396
|
-
}
|
|
328397
|
-
/**
|
|
328398
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
|
|
328399
|
-
*/
|
|
328400
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328401
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
|
|
328402
|
-
if (obj === undefined) {
|
|
328403
|
-
return undefined;
|
|
328404
|
-
}
|
|
328405
|
-
const result = {
|
|
328406
|
-
'key': obj.key,
|
|
328407
|
-
};
|
|
328408
|
-
// filter undefined values
|
|
328409
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328410
|
-
}
|
|
328411
|
-
/**
|
|
328412
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
|
|
328413
|
-
*/
|
|
328414
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328415
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
|
|
328416
|
-
if (obj === undefined) {
|
|
328417
|
-
return undefined;
|
|
328418
|
-
}
|
|
328419
|
-
const result = {
|
|
328420
|
-
'kind': obj.kind,
|
|
328421
|
-
'name': obj.name,
|
|
328422
|
-
};
|
|
328423
|
-
// filter undefined values
|
|
328424
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328425
|
-
}
|
|
328426
|
-
/**
|
|
328427
|
-
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
|
|
328428
|
-
*/
|
|
328429
|
-
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328430
|
-
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
|
|
328431
|
-
if (obj === undefined) {
|
|
328432
|
-
return undefined;
|
|
328433
|
-
}
|
|
328434
|
-
const result = {
|
|
328435
|
-
'kind': obj.kind,
|
|
328436
|
-
'name': obj.name,
|
|
328437
|
-
};
|
|
328438
|
-
// filter undefined values
|
|
328439
|
-
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328440
|
-
}
|
|
328441
|
-
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328442
|
-
/**
|
|
328443
|
-
* @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
|
|
328444
|
-
*/
|
|
328445
|
-
var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
|
|
328446
|
-
(function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
|
|
328447
|
-
/** FirestartrProviderConfig */
|
|
328448
|
-
FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328449
|
-
})(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
|
|
328450
|
-
/**
|
|
328451
|
-
* @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
|
|
328452
|
-
*/
|
|
328453
|
-
var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
|
|
328454
|
-
(function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
|
|
328455
|
-
/** FirestartrProviderConfig */
|
|
328456
|
-
FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328457
|
-
})(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
|
|
328458
327566
|
/**
|
|
328459
327567
|
* A resource to handle GitHub Organization Webhooks
|
|
328460
327568
|
*
|
|
@@ -331304,137 +330412,6 @@ class GithubOrgSettingsChart extends BaseGithubChart {
|
|
|
331304
330412
|
}
|
|
331305
330413
|
}
|
|
331306
330414
|
|
|
331307
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
|
|
331308
|
-
|
|
331309
|
-
|
|
331310
|
-
|
|
331311
|
-
class GithubOrgVariableSectionChart extends BaseGithubChart {
|
|
331312
|
-
template() {
|
|
331313
|
-
const claim = this.get('claim');
|
|
331314
|
-
const firestartrId = this.get('firestartrId');
|
|
331315
|
-
const githubProvider = claim.providers.github;
|
|
331316
|
-
const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
|
|
331317
|
-
const entry = {
|
|
331318
|
-
name: v.name,
|
|
331319
|
-
value: v.value,
|
|
331320
|
-
visibility: v.visibility,
|
|
331321
|
-
};
|
|
331322
|
-
if (v.selected_repositories && v.selected_repositories.length > 0) {
|
|
331323
|
-
entry.selectedRepositories = v.selected_repositories.map((ref) => {
|
|
331324
|
-
const match = ref.match(/^component:(.+)$/);
|
|
331325
|
-
if (!match) {
|
|
331326
|
-
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
|
|
331327
|
-
}
|
|
331328
|
-
const componentName = match[1];
|
|
331329
|
-
const resolvedCr = this.refResolver('ComponentClaim', componentName);
|
|
331330
|
-
const org = resolvedCr?.spec?.org;
|
|
331331
|
-
const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
|
|
331332
|
-
if (!org || !repoName) {
|
|
331333
|
-
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
|
|
331334
|
-
}
|
|
331335
|
-
return `${org}/${repoName}`;
|
|
331336
|
-
});
|
|
331337
|
-
}
|
|
331338
|
-
return entry;
|
|
331339
|
-
});
|
|
331340
|
-
const template = {
|
|
331341
|
-
metadata: {
|
|
331342
|
-
name: githubProvider.name,
|
|
331343
|
-
},
|
|
331344
|
-
spec: {
|
|
331345
|
-
org: githubProvider.org,
|
|
331346
|
-
actionsVariables,
|
|
331347
|
-
firestartr: {
|
|
331348
|
-
tfStateKey: firestartrId,
|
|
331349
|
-
},
|
|
331350
|
-
writeConnectionSecretToRef: {
|
|
331351
|
-
name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
|
|
331352
|
-
outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
|
|
331353
|
-
},
|
|
331354
|
-
},
|
|
331355
|
-
};
|
|
331356
|
-
return JSON.parse(JSON.stringify(template));
|
|
331357
|
-
}
|
|
331358
|
-
gvk() {
|
|
331359
|
-
return FirestartrGithubOrganizationVariableSection.GVK;
|
|
331360
|
-
}
|
|
331361
|
-
instanceApiObject(template) {
|
|
331362
|
-
return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
|
|
331363
|
-
}
|
|
331364
|
-
}
|
|
331365
|
-
|
|
331366
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgSecretSectionChart.ts
|
|
331367
|
-
|
|
331368
|
-
|
|
331369
|
-
|
|
331370
|
-
class GithubOrgSecretSectionChart extends BaseGithubChart {
|
|
331371
|
-
template() {
|
|
331372
|
-
const claim = this.get('claim');
|
|
331373
|
-
const firestartrId = this.get('firestartrId');
|
|
331374
|
-
const githubProvider = claim.providers.github;
|
|
331375
|
-
const orgSecrets = githubProvider.org_secrets || {};
|
|
331376
|
-
const renderSecrets = (section) => {
|
|
331377
|
-
const secrets = orgSecrets[section];
|
|
331378
|
-
if (!Array.isArray(secrets))
|
|
331379
|
-
return [];
|
|
331380
|
-
return secrets.map((secret) => {
|
|
331381
|
-
const parts = secret.value.split(':');
|
|
331382
|
-
const selectedRepositories = (secret.selected_repositories || []).map((ref) => {
|
|
331383
|
-
const match = ref.match(/^component:(.+)$/);
|
|
331384
|
-
if (!match) {
|
|
331385
|
-
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
|
|
331386
|
-
}
|
|
331387
|
-
const componentName = match[1];
|
|
331388
|
-
const resolvedCr = this.refResolver('ComponentClaim', componentName);
|
|
331389
|
-
const org = resolvedCr?.spec?.org;
|
|
331390
|
-
const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
|
|
331391
|
-
if (!org || !repoName) {
|
|
331392
|
-
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
|
|
331393
|
-
}
|
|
331394
|
-
return `${org}/${repoName}`;
|
|
331395
|
-
});
|
|
331396
|
-
return {
|
|
331397
|
-
name: secret.name,
|
|
331398
|
-
ref: {
|
|
331399
|
-
kind: 'Secret',
|
|
331400
|
-
name: parts[2],
|
|
331401
|
-
key: parts[3],
|
|
331402
|
-
},
|
|
331403
|
-
visibility: secret.visibility || 'all',
|
|
331404
|
-
selectedRepositories,
|
|
331405
|
-
};
|
|
331406
|
-
});
|
|
331407
|
-
};
|
|
331408
|
-
const template = {
|
|
331409
|
-
metadata: {
|
|
331410
|
-
name: `${githubProvider.name}-secrets`,
|
|
331411
|
-
},
|
|
331412
|
-
spec: {
|
|
331413
|
-
org: githubProvider.org,
|
|
331414
|
-
secrets: {
|
|
331415
|
-
actions: renderSecrets('actions'),
|
|
331416
|
-
codespaces: renderSecrets('codespaces'),
|
|
331417
|
-
dependabot: renderSecrets('dependabot'),
|
|
331418
|
-
},
|
|
331419
|
-
firestartr: {
|
|
331420
|
-
tfStateKey: firestartrId ? `${firestartrId}-secrets` : firestartrId,
|
|
331421
|
-
},
|
|
331422
|
-
writeConnectionSecretToRef: {
|
|
331423
|
-
name: `firestartrgithuborganizationsecretsection-${githubProvider.name}-secrets-outputs`.toLowerCase(),
|
|
331424
|
-
outputs: [{ key: 'managed_secrets' }, { key: 'secret_ids' }],
|
|
331425
|
-
},
|
|
331426
|
-
},
|
|
331427
|
-
};
|
|
331428
|
-
return JSON.parse(JSON.stringify(template));
|
|
331429
|
-
}
|
|
331430
|
-
gvk() {
|
|
331431
|
-
return FirestartrGithubOrganizationSecretSection.GVK;
|
|
331432
|
-
}
|
|
331433
|
-
instanceApiObject(template) {
|
|
331434
|
-
return new FirestartrGithubOrganizationSecretSection(this, template.metadata.name, template);
|
|
331435
|
-
}
|
|
331436
|
-
}
|
|
331437
|
-
|
|
331438
330415
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
|
|
331439
330416
|
|
|
331440
330417
|
|
|
@@ -331442,8 +330419,6 @@ class GithubOrgSecretSectionChart extends BaseGithubChart {
|
|
|
331442
330419
|
|
|
331443
330420
|
|
|
331444
330421
|
|
|
331445
|
-
|
|
331446
|
-
|
|
331447
330422
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
|
|
331448
330423
|
|
|
331449
330424
|
class BaseCatalogChart extends BaseChart {
|
|
@@ -332191,8 +331166,6 @@ class SecretsChart extends BaseSecretsChart {
|
|
|
332191
331166
|
SecretsChart: SecretsChart,
|
|
332192
331167
|
GithubOrgWebhookChart: GithubOrgWebhookChart,
|
|
332193
331168
|
GithubOrgSettingsChart: GithubOrgSettingsChart,
|
|
332194
|
-
GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
|
|
332195
|
-
GithubOrgSecretSectionChart: GithubOrgSecretSectionChart,
|
|
332196
331169
|
});
|
|
332197
331170
|
|
|
332198
331171
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
|
|
@@ -332237,28 +331210,13 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
332237
331210
|
if (configuredProvider !== AllowedProviders.all.toString()) {
|
|
332238
331211
|
providers = providers.filter((provider) => provider === configuredProvider);
|
|
332239
331212
|
}
|
|
332240
|
-
const
|
|
332241
|
-
? 'FirestartrGithubOrganizationSettings'
|
|
332242
|
-
: undefined;
|
|
332243
|
-
const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
|
|
332244
|
-
const variableSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332245
|
-
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-variable-section` }, crs, 'FirestartrGithubOrganizationVariableSection')
|
|
332246
|
-
: false;
|
|
332247
|
-
const secretSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332248
|
-
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-secret-section` }, crs, 'FirestartrGithubOrganizationSecretSection')
|
|
332249
|
-
: false;
|
|
331213
|
+
const previousCR = getPreviousCRfromClaim(claim, crs);
|
|
332250
331214
|
const patches = await extractPatches(renderClaims[claimKey], previousCR);
|
|
332251
|
-
let variableSectionPatches = undefined;
|
|
332252
|
-
let secretSectionPatches = undefined;
|
|
332253
|
-
if (claim.kind === 'OrgSettingsClaim') {
|
|
332254
|
-
variableSectionPatches = await extractPatches(renderClaims[claimKey], variableSectionPreviousCR);
|
|
332255
|
-
secretSectionPatches = await extractPatches(renderClaims[claimKey], secretSectionPreviousCR);
|
|
332256
|
-
}
|
|
332257
331215
|
if (!previousCR) {
|
|
332258
331216
|
logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
|
|
332259
331217
|
}
|
|
332260
331218
|
const claimPath = renderClaims[claimKey].claimPath;
|
|
332261
|
-
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath
|
|
331219
|
+
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath);
|
|
332262
331220
|
if (catalogEntity) {
|
|
332263
331221
|
result[`${catalogEntity.kind}-${catalogEntity.metadata.name}`] =
|
|
332264
331222
|
catalogEntity.toJson();
|
|
@@ -332287,7 +331245,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
332287
331245
|
}
|
|
332288
331246
|
return result;
|
|
332289
331247
|
}
|
|
332290
|
-
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath
|
|
331248
|
+
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath) {
|
|
332291
331249
|
let catalogEntity = undefined;
|
|
332292
331250
|
let firestartrEntity = undefined;
|
|
332293
331251
|
const extraCharts = [];
|
|
@@ -332435,48 +331393,6 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
332435
331393
|
case 'OrgSettingsClaim':
|
|
332436
331394
|
if (loadGithub) {
|
|
332437
331395
|
firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
|
|
332438
|
-
const variableSectionFirestartrId = variableSectionPreviousCR
|
|
332439
|
-
? variableSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332440
|
-
: firestartrId
|
|
332441
|
-
? `${firestartrId}-variables`
|
|
332442
|
-
: null;
|
|
332443
|
-
const vsRenderPatches = variableSectionPatches
|
|
332444
|
-
? variableSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332445
|
-
: renderPatches;
|
|
332446
|
-
const vsPostPatches = variableSectionPatches
|
|
332447
|
-
? variableSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332448
|
-
: postPatches;
|
|
332449
|
-
const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, vsRenderPatches);
|
|
332450
|
-
await variableSectionChart.render();
|
|
332451
|
-
const variableSectionObject = await variableSectionChart.postRenderer(vsPostPatches);
|
|
332452
|
-
extraCharts.push({
|
|
332453
|
-
claim: {
|
|
332454
|
-
kind: claim.kind,
|
|
332455
|
-
name: `${claim.name}-variable-section`,
|
|
332456
|
-
},
|
|
332457
|
-
chart: variableSectionObject,
|
|
332458
|
-
});
|
|
332459
|
-
const secretSectionFirestartrId = secretSectionPreviousCR
|
|
332460
|
-
? secretSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332461
|
-
: firestartrId
|
|
332462
|
-
? `${firestartrId}-secrets`
|
|
332463
|
-
: null;
|
|
332464
|
-
const ssRenderPatches = secretSectionPatches
|
|
332465
|
-
? secretSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332466
|
-
: renderPatches;
|
|
332467
|
-
const ssPostPatches = secretSectionPatches
|
|
332468
|
-
? secretSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332469
|
-
: postPatches;
|
|
332470
|
-
const secretSectionChart = new charts.GithubOrgSecretSectionChart(firestartrScope, `github-secrets-${chartId}`, secretSectionFirestartrId, claim, ssRenderPatches);
|
|
332471
|
-
await secretSectionChart.render();
|
|
332472
|
-
const secretSectionObject = await secretSectionChart.postRenderer(ssPostPatches);
|
|
332473
|
-
extraCharts.push({
|
|
332474
|
-
claim: {
|
|
332475
|
-
kind: claim.kind,
|
|
332476
|
-
name: `${claim.name}-secret-section`,
|
|
332477
|
-
},
|
|
332478
|
-
chart: secretSectionObject,
|
|
332479
|
-
});
|
|
332480
331396
|
}
|
|
332481
331397
|
break;
|
|
332482
331398
|
default:
|
|
@@ -332536,16 +331452,12 @@ function renameVariantCrFiles(outputDir, renderedMap) {
|
|
|
332536
331452
|
|
|
332537
331453
|
const IS_COMPONENT_CLAIM_REF = new RegExp(/^ComponentClaim-/);
|
|
332538
331454
|
const IS_TF_WORKSPACE = new RegExp(/^TFWorkspaceClaim-/);
|
|
332539
|
-
const IS_ORG_SETTINGS_CLAIM = new RegExp(/^OrgSettingsClaim-/);
|
|
332540
|
-
const COMPONENT_REF_PATTERN = /^component:(.+)$/;
|
|
332541
331455
|
function validateSubReferences(renderClaims) {
|
|
332542
331456
|
for (const ref of Object.keys(renderClaims)) {
|
|
332543
331457
|
if (IS_COMPONENT_CLAIM_REF.test(ref))
|
|
332544
331458
|
validateClaimsSecretsRefs(ref, renderClaims);
|
|
332545
331459
|
else if (IS_TF_WORKSPACE.test(ref))
|
|
332546
331460
|
validateTFClaimsSecretsRefs(ref, renderClaims);
|
|
332547
|
-
else if (IS_ORG_SETTINGS_CLAIM.test(ref))
|
|
332548
|
-
validateOrgSettingsComponentRefs(ref, renderClaims);
|
|
332549
331461
|
}
|
|
332550
331462
|
}
|
|
332551
331463
|
function validateTFClaimsSecretsRefs(ref, renderClaims) {
|
|
@@ -332597,57 +331509,6 @@ function searchSecretKey(secretClaim, key) {
|
|
|
332597
331509
|
}
|
|
332598
331510
|
return found;
|
|
332599
331511
|
}
|
|
332600
|
-
function validateOrgSettingsComponentRefs(ref, renderClaims) {
|
|
332601
|
-
const claim = renderClaims[ref].claim;
|
|
332602
|
-
validateOrgSecretsSelectedRepositories(claim, renderClaims);
|
|
332603
|
-
validateActionsVariablesSelectedRepositories(claim, renderClaims);
|
|
332604
|
-
}
|
|
332605
|
-
function validateOrgSecretsSelectedRepositories(claim, renderClaims) {
|
|
332606
|
-
const orgSecrets = claim?.providers?.github?.org_secrets;
|
|
332607
|
-
if (!orgSecrets || typeof orgSecrets !== 'object')
|
|
332608
|
-
return;
|
|
332609
|
-
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332610
|
-
const secrets = orgSecrets[section];
|
|
332611
|
-
if (!Array.isArray(secrets))
|
|
332612
|
-
continue;
|
|
332613
|
-
for (const secret of secrets) {
|
|
332614
|
-
if (!secret.selected_repositories)
|
|
332615
|
-
continue;
|
|
332616
|
-
for (const repoRef of secret.selected_repositories) {
|
|
332617
|
-
const match = repoRef.match(COMPONENT_REF_PATTERN);
|
|
332618
|
-
if (!match)
|
|
332619
|
-
continue;
|
|
332620
|
-
const [, componentName] = match;
|
|
332621
|
-
const expectedKey = `ComponentClaim-${componentName}`;
|
|
332622
|
-
if (!renderClaims[expectedKey]) {
|
|
332623
|
-
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in org_secrets.${section}.${secret.name}.selected_repositories`);
|
|
332624
|
-
}
|
|
332625
|
-
}
|
|
332626
|
-
}
|
|
332627
|
-
}
|
|
332628
|
-
}
|
|
332629
|
-
function validateActionsVariablesSelectedRepositories(claim, renderClaims) {
|
|
332630
|
-
const actionsVariables = claim?.providers?.github?.actions_variables;
|
|
332631
|
-
if (!Array.isArray(actionsVariables))
|
|
332632
|
-
return;
|
|
332633
|
-
for (const variable of actionsVariables) {
|
|
332634
|
-
if (variable.visibility !== 'selected')
|
|
332635
|
-
continue;
|
|
332636
|
-
const selectedRepos = variable.selected_repositories;
|
|
332637
|
-
if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
|
|
332638
|
-
continue;
|
|
332639
|
-
for (const ref of selectedRepos) {
|
|
332640
|
-
const match = ref.match(COMPONENT_REF_PATTERN);
|
|
332641
|
-
if (!match)
|
|
332642
|
-
continue;
|
|
332643
|
-
const componentName = match[1];
|
|
332644
|
-
const expectedKey = `ComponentClaim-${componentName}`;
|
|
332645
|
-
if (!renderClaims[expectedKey]) {
|
|
332646
|
-
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
|
|
332647
|
-
}
|
|
332648
|
-
}
|
|
332649
|
-
}
|
|
332650
|
-
}
|
|
332651
331512
|
|
|
332652
331513
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/componentPagesPath.ts
|
|
332653
331514
|
/**
|
|
@@ -332696,176 +331557,6 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
332696
331557
|
}
|
|
332697
331558
|
}
|
|
332698
331559
|
|
|
332699
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
|
|
332700
|
-
const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
|
|
332701
|
-
const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332702
|
-
const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332703
|
-
function githubOrgVariableSection_formatResourceRef(name, claimRef) {
|
|
332704
|
-
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332705
|
-
}
|
|
332706
|
-
function validateGithubOrgVariableSectionSingleton(crs) {
|
|
332707
|
-
const refsByOrg = new Map();
|
|
332708
|
-
const seenClaimRefs = new Map();
|
|
332709
|
-
for (const crKey of Object.keys(crs)) {
|
|
332710
|
-
const cr = crs[crKey];
|
|
332711
|
-
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332712
|
-
continue;
|
|
332713
|
-
const org = cr.spec?.org;
|
|
332714
|
-
if (typeof org !== 'string' || !org)
|
|
332715
|
-
continue;
|
|
332716
|
-
const name = cr.metadata?.name || crKey;
|
|
332717
|
-
const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332718
|
-
cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
|
|
332719
|
-
const normalizedOrg = org.toLowerCase();
|
|
332720
|
-
if (claimRef) {
|
|
332721
|
-
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332722
|
-
if (seen.has(claimRef))
|
|
332723
|
-
continue;
|
|
332724
|
-
seen.add(claimRef);
|
|
332725
|
-
seenClaimRefs.set(normalizedOrg, seen);
|
|
332726
|
-
}
|
|
332727
|
-
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332728
|
-
refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
|
|
332729
|
-
refsByOrg.set(normalizedOrg, refs);
|
|
332730
|
-
}
|
|
332731
|
-
for (const [org, refs] of refsByOrg.entries()) {
|
|
332732
|
-
if (refs.length < 2)
|
|
332733
|
-
continue;
|
|
332734
|
-
throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332735
|
-
}
|
|
332736
|
-
}
|
|
332737
|
-
function validateActionsVariablesUniqueness(crs) {
|
|
332738
|
-
for (const crKey of Object.keys(crs)) {
|
|
332739
|
-
const cr = crs[crKey];
|
|
332740
|
-
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332741
|
-
continue;
|
|
332742
|
-
const actionsVariables = cr.spec?.actionsVariables;
|
|
332743
|
-
if (!Array.isArray(actionsVariables))
|
|
332744
|
-
continue;
|
|
332745
|
-
const names = new Set();
|
|
332746
|
-
for (const variable of actionsVariables) {
|
|
332747
|
-
const varName = variable?.name;
|
|
332748
|
-
if (!varName)
|
|
332749
|
-
continue;
|
|
332750
|
-
if (names.has(varName)) {
|
|
332751
|
-
const org = cr.spec?.org || 'unknown';
|
|
332752
|
-
throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
|
|
332753
|
-
}
|
|
332754
|
-
names.add(varName);
|
|
332755
|
-
}
|
|
332756
|
-
}
|
|
332757
|
-
}
|
|
332758
|
-
|
|
332759
|
-
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgSecretSection.ts
|
|
332760
|
-
const GITHUB_ORG_SECRET_SECTION_KIND = 'FirestartrGithubOrganizationSecretSection';
|
|
332761
|
-
const githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332762
|
-
const githubOrgSecretSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332763
|
-
const SECRETS_CLAIM_REF_PATTERN = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
332764
|
-
function githubOrgSecretSection_formatResourceRef(name, claimRef) {
|
|
332765
|
-
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332766
|
-
}
|
|
332767
|
-
function validateGithubOrgSecretSectionSingleton(crs) {
|
|
332768
|
-
const refsByOrg = new Map();
|
|
332769
|
-
const seenClaimRefs = new Map();
|
|
332770
|
-
for (const crKey of Object.keys(crs)) {
|
|
332771
|
-
const cr = crs[crKey];
|
|
332772
|
-
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332773
|
-
continue;
|
|
332774
|
-
const org = cr.spec?.org;
|
|
332775
|
-
if (typeof org !== 'string' || !org)
|
|
332776
|
-
continue;
|
|
332777
|
-
const name = cr.metadata?.name || crKey;
|
|
332778
|
-
const claimRef = cr.metadata?.annotations?.[githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332779
|
-
cr.metadata?.labels?.[githubOrgSecretSection_CLAIM_REF_LABEL];
|
|
332780
|
-
const normalizedOrg = org.toLowerCase();
|
|
332781
|
-
if (claimRef) {
|
|
332782
|
-
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332783
|
-
if (seen.has(claimRef))
|
|
332784
|
-
continue;
|
|
332785
|
-
seen.add(claimRef);
|
|
332786
|
-
seenClaimRefs.set(normalizedOrg, seen);
|
|
332787
|
-
}
|
|
332788
|
-
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332789
|
-
refs.push(githubOrgSecretSection_formatResourceRef(name, claimRef));
|
|
332790
|
-
refsByOrg.set(normalizedOrg, refs);
|
|
332791
|
-
}
|
|
332792
|
-
for (const [org, refs] of refsByOrg.entries()) {
|
|
332793
|
-
if (refs.length < 2)
|
|
332794
|
-
continue;
|
|
332795
|
-
throw new Error(`Duplicate ${GITHUB_ORG_SECRET_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332796
|
-
}
|
|
332797
|
-
}
|
|
332798
|
-
function validateSecretNamesUniqueness(crs) {
|
|
332799
|
-
for (const crKey of Object.keys(crs)) {
|
|
332800
|
-
const cr = crs[crKey];
|
|
332801
|
-
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332802
|
-
continue;
|
|
332803
|
-
const secrets = cr.spec?.secrets;
|
|
332804
|
-
if (!secrets || typeof secrets !== 'object')
|
|
332805
|
-
continue;
|
|
332806
|
-
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332807
|
-
const sectionSecrets = secrets[section];
|
|
332808
|
-
if (!Array.isArray(sectionSecrets))
|
|
332809
|
-
continue;
|
|
332810
|
-
const names = new Set();
|
|
332811
|
-
for (const secret of sectionSecrets) {
|
|
332812
|
-
const secretName = secret?.name;
|
|
332813
|
-
if (!secretName)
|
|
332814
|
-
continue;
|
|
332815
|
-
if (names.has(secretName)) {
|
|
332816
|
-
const org = cr.spec?.org || 'unknown';
|
|
332817
|
-
throw new Error(`Duplicate secret name "${secretName}" found in ${section} section of ${GITHUB_ORG_SECRET_SECTION_KIND} for organization "${org}"`);
|
|
332818
|
-
}
|
|
332819
|
-
names.add(secretName);
|
|
332820
|
-
}
|
|
332821
|
-
}
|
|
332822
|
-
}
|
|
332823
|
-
}
|
|
332824
|
-
function validateOrgSecretsCrossReferences(renderClaims) {
|
|
332825
|
-
for (const claimKey of Object.keys(renderClaims)) {
|
|
332826
|
-
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
332827
|
-
continue;
|
|
332828
|
-
const claimData = renderClaims[claimKey];
|
|
332829
|
-
const claim = claimData?.claim;
|
|
332830
|
-
const orgSecrets = claim?.providers?.github?.org_secrets;
|
|
332831
|
-
if (!orgSecrets || typeof orgSecrets !== 'object')
|
|
332832
|
-
continue;
|
|
332833
|
-
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332834
|
-
const secrets = orgSecrets[section];
|
|
332835
|
-
if (!Array.isArray(secrets))
|
|
332836
|
-
continue;
|
|
332837
|
-
for (const secret of secrets) {
|
|
332838
|
-
if (!secret.value)
|
|
332839
|
-
continue;
|
|
332840
|
-
const match = secret.value.match(SECRETS_CLAIM_REF_PATTERN);
|
|
332841
|
-
if (!match)
|
|
332842
|
-
continue;
|
|
332843
|
-
const [, secretClaimName, secretKey] = match;
|
|
332844
|
-
const expectedKey = `SecretsClaim-${secretClaimName}`;
|
|
332845
|
-
if (!renderClaims[expectedKey])
|
|
332846
|
-
continue;
|
|
332847
|
-
const secretClaim = renderClaims[expectedKey]?.claim;
|
|
332848
|
-
const externalSecrets = secretClaim?.providers?.external_secrets?.externalSecrets?.secrets;
|
|
332849
|
-
const pushSecrets = secretClaim?.providers?.external_secrets?.pushSecrets;
|
|
332850
|
-
let keyFound = false;
|
|
332851
|
-
if (Array.isArray(pushSecrets)) {
|
|
332852
|
-
keyFound =
|
|
332853
|
-
pushSecrets.find((s) => s.secretName === secretKey) !==
|
|
332854
|
-
undefined;
|
|
332855
|
-
}
|
|
332856
|
-
if (!keyFound && Array.isArray(externalSecrets)) {
|
|
332857
|
-
keyFound =
|
|
332858
|
-
externalSecrets.find((s) => s.secretName === secretKey) !==
|
|
332859
|
-
undefined;
|
|
332860
|
-
}
|
|
332861
|
-
if (!keyFound) {
|
|
332862
|
-
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent secret key "${secretKey}" in SecretsClaim/${secretClaimName} via org_secrets.${section}.${secret.name}`);
|
|
332863
|
-
}
|
|
332864
|
-
}
|
|
332865
|
-
}
|
|
332866
|
-
}
|
|
332867
|
-
}
|
|
332868
|
-
|
|
332869
331560
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
|
|
332870
331561
|
|
|
332871
331562
|
|
|
@@ -332876,8 +331567,6 @@ function validateOrgSecretsCrossReferences(renderClaims) {
|
|
|
332876
331567
|
|
|
332877
331568
|
|
|
332878
331569
|
|
|
332879
|
-
|
|
332880
|
-
|
|
332881
331570
|
/*
|
|
332882
331571
|
* Function called when rendering but not importing
|
|
332883
331572
|
*
|
|
@@ -332899,13 +331588,8 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
|
|
|
332899
331588
|
try {
|
|
332900
331589
|
validateSubReferences(data.renderClaims);
|
|
332901
331590
|
validateComponentPagesPath(data.renderClaims);
|
|
332902
|
-
validateOrgSecretsCrossReferences(data.renderClaims);
|
|
332903
331591
|
validateTfStateKeyUniqueness(result);
|
|
332904
331592
|
validateGithubOrgSettingsSingleton(fullCrSet);
|
|
332905
|
-
validateGithubOrgVariableSectionSingleton(fullCrSet);
|
|
332906
|
-
validateActionsVariablesUniqueness(result);
|
|
332907
|
-
validateGithubOrgSecretSectionSingleton(fullCrSet);
|
|
332908
|
-
validateSecretNamesUniqueness(result);
|
|
332909
331593
|
validateCrSizes(result);
|
|
332910
331594
|
validatePermissionsUniqueness(result);
|
|
332911
331595
|
}
|
|
@@ -335237,8 +333921,6 @@ const kindPluralMap = {
|
|
|
335237
333921
|
terraformmodules: 'FirestartrTerraformModule',
|
|
335238
333922
|
githuborgwebhooks: 'FirestartrGithubOrgWebhook',
|
|
335239
333923
|
githuborganizationsettings: 'FirestartrGithubOrganizationSettings',
|
|
335240
|
-
githuborganizationvariablesections: 'FirestartrGithubOrganizationVariableSection',
|
|
335241
|
-
githuborganizationsecretsections: 'FirestartrGithubOrganizationSecretSection',
|
|
335242
333924
|
terraformworkspaces: 'FirestartrTerraformWorkspace',
|
|
335243
333925
|
terraformworkspaceplans: 'FirestartrTerraformWorkspacePlan',
|
|
335244
333926
|
providerconfigs: 'FirestartrProviderConfig',
|
|
@@ -337216,8 +335898,6 @@ const kindsWithFinalizer = [
|
|
|
337216
335898
|
'FirestartrGithubRepositoryFeature',
|
|
337217
335899
|
'FirestartrGithubOrgWebhook',
|
|
337218
335900
|
'FirestartrGithubOrganizationSettings',
|
|
337219
|
-
'FirestartrGithubOrganizationVariableSection',
|
|
337220
|
-
'FirestartrGithubOrganizationSecretSection',
|
|
337221
335901
|
'FirestartrGithubRepositorySecretsSection',
|
|
337222
335902
|
];
|
|
337223
335903
|
const kindsWithDependants = [
|
|
@@ -340167,7 +338847,7 @@ async function configGit() {
|
|
|
340167
338847
|
}
|
|
340168
338848
|
// Import github dynamically to avoid Jest ESM issues when not specifically running this function
|
|
340169
338849
|
// (see CONSTITUTION and RULES: must not change test machinery)
|
|
340170
|
-
const githubModule = await Promise.resolve(/* import() */).then(__nccwpck_require__.bind(__nccwpck_require__,
|
|
338850
|
+
const githubModule = await Promise.resolve(/* import() */).then(__nccwpck_require__.bind(__nccwpck_require__, 99029));
|
|
340171
338851
|
const github = githubModule.default || githubModule;
|
|
340172
338852
|
if (external_fs_.existsSync(gitconfigPath)) {
|
|
340173
338853
|
external_fs_.rmSync(gitconfigPath);
|
|
@@ -343759,15 +342439,6 @@ const MODULES = {
|
|
|
343759
342439
|
// github-org-settings-v0.1.0
|
|
343760
342440
|
ref: 'c30c5dfdaddf2bca9e966a726d45970c98576e9e',
|
|
343761
342441
|
},
|
|
343762
|
-
FirestartrGithubOrganizationVariableSection: {
|
|
343763
|
-
module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-variables-section',
|
|
343764
|
-
ref: '79c1407',
|
|
343765
|
-
},
|
|
343766
|
-
FirestartrGithubOrganizationSecretSection: {
|
|
343767
|
-
module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-secrets-section',
|
|
343768
|
-
// feat/1364-feat-add-github-org-secrets-section-module
|
|
343769
|
-
ref: '4380434b158bb38d0b831b0f3d1fc51e7bd509a4',
|
|
343770
|
-
},
|
|
343771
342442
|
};
|
|
343772
342443
|
function getFirestartrDefaultTFM(kind) {
|
|
343773
342444
|
if (kind in MODULES) {
|
|
@@ -345570,294 +344241,6 @@ class EntityGHOrgSettings extends base_Entity {
|
|
|
345570
344241
|
}
|
|
345571
344242
|
}
|
|
345572
344243
|
|
|
345573
|
-
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgvarsection/index.ts
|
|
345574
|
-
|
|
345575
|
-
|
|
345576
|
-
|
|
345577
|
-
class EntityGHOrgVarsSection extends base_Entity {
|
|
345578
|
-
constructor(artifact) {
|
|
345579
|
-
super(artifact, {
|
|
345580
|
-
config: {
|
|
345581
|
-
variables: {},
|
|
345582
|
-
},
|
|
345583
|
-
});
|
|
345584
|
-
}
|
|
345585
|
-
async loadResources(tfOp) {
|
|
345586
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] running ${tfOp} on ${this.k8sId}`);
|
|
345587
|
-
try {
|
|
345588
|
-
const cr = this.cr;
|
|
345589
|
-
const actionsVariables = cr.spec.actionsVariables || [];
|
|
345590
|
-
const variables = {};
|
|
345591
|
-
for (const v of actionsVariables) {
|
|
345592
|
-
const entry = {
|
|
345593
|
-
value: v.value,
|
|
345594
|
-
visibility: v.visibility,
|
|
345595
|
-
};
|
|
345596
|
-
if (v.visibility === 'selected' && v.selectedRepositories) {
|
|
345597
|
-
entry.selectedRepositoryIds = v.selectedRepositories;
|
|
345598
|
-
}
|
|
345599
|
-
variables[v.name] = entry;
|
|
345600
|
-
}
|
|
345601
|
-
this.patchData({
|
|
345602
|
-
op: PatchOperations.replace,
|
|
345603
|
-
path: '/config/variables',
|
|
345604
|
-
value: variables,
|
|
345605
|
-
});
|
|
345606
|
-
if (tfOp === 'apply') {
|
|
345607
|
-
await this.adoptVariablesIfNeeded(actionsVariables);
|
|
345608
|
-
}
|
|
345609
|
-
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} loaded its data`);
|
|
345610
|
-
}
|
|
345611
|
-
catch (err) {
|
|
345612
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
345613
|
-
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345614
|
-
throw new Error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345615
|
-
}
|
|
345616
|
-
}
|
|
345617
|
-
async adoptVariablesIfNeeded(declaredVars) {
|
|
345618
|
-
const cr = this.cr;
|
|
345619
|
-
const managedVariables = this.cr.fResolveSelfOutputs('managed_variables') || [];
|
|
345620
|
-
const declaredNames = declaredVars.map((v) => v.name);
|
|
345621
|
-
const newToModule = declaredNames.filter((name) => !managedVariables.includes(name));
|
|
345622
|
-
if (newToModule.length === 0) {
|
|
345623
|
-
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} all declared variables are already managed, no adoption needed`);
|
|
345624
|
-
return;
|
|
345625
|
-
}
|
|
345626
|
-
if (managedVariables.length === 0) {
|
|
345627
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} no managed_variables output — first reconciliation, treating all ${newToModule.length} declared variable(s) as new to module`);
|
|
345628
|
-
}
|
|
345629
|
-
for (const varName of newToModule) {
|
|
345630
|
-
try {
|
|
345631
|
-
await this.runWithGithubProvider(async () => {
|
|
345632
|
-
await github["default"].org.getOrgVariable(cr.spec.org, varName);
|
|
345633
|
-
});
|
|
345634
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} adopting pre-existing variable '${varName}' on GitHub org '${cr.spec.org}'`);
|
|
345635
|
-
this.patchImportData({
|
|
345636
|
-
op: PatchOperations.add,
|
|
345637
|
-
path: '/imports/-',
|
|
345638
|
-
value: {
|
|
345639
|
-
to: `github_actions_organization_variable.this["${varName}"]`,
|
|
345640
|
-
id: varName,
|
|
345641
|
-
},
|
|
345642
|
-
});
|
|
345643
|
-
}
|
|
345644
|
-
catch (err) {
|
|
345645
|
-
if (err && err.status === 404) {
|
|
345646
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} variable '${varName}' not found on GitHub org '${cr.spec.org}' — will be created by TFM`);
|
|
345647
|
-
}
|
|
345648
|
-
else if (err && (err.status === 401 || err.status === 403)) {
|
|
345649
|
-
gh_provisioner_src_logger.warn(`[gh-provisioner] ${this.k8sId} token lacks scope to check variable '${varName}' on org '${cr.spec.org}' — skipping adoption gracefully`);
|
|
345650
|
-
}
|
|
345651
|
-
else {
|
|
345652
|
-
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} unexpected error checking variable '${varName}' on org '${cr.spec.org}': ${err instanceof Error ? err.message : String(err)}`);
|
|
345653
|
-
}
|
|
345654
|
-
}
|
|
345655
|
-
}
|
|
345656
|
-
}
|
|
345657
|
-
async postProvision(tfOp) { }
|
|
345658
|
-
async loadAddressesToImport() { }
|
|
345659
|
-
}
|
|
345660
|
-
|
|
345661
|
-
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgsecretsection/secrets.ts
|
|
345662
|
-
|
|
345663
|
-
|
|
345664
|
-
|
|
345665
|
-
|
|
345666
|
-
const secrets_SECTIONS = ['actions', 'codespaces', 'dependabot'];
|
|
345667
|
-
|
|
345668
|
-
async function provisionOrgSecrets(entity, secrets) {
|
|
345669
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${entity.k8sId} provisioning org secrets`);
|
|
345670
|
-
for (const section of secrets_SECTIONS) {
|
|
345671
|
-
const sectionSecrets = secrets[section] || [];
|
|
345672
|
-
if (sectionSecrets.length === 0)
|
|
345673
|
-
continue;
|
|
345674
|
-
let preFetchedKey;
|
|
345675
|
-
try {
|
|
345676
|
-
preFetchedKey = await fetchOrgPublicKey(entity, section);
|
|
345677
|
-
}
|
|
345678
|
-
catch (err) {
|
|
345679
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
345680
|
-
throw new Error(`[gh-provisioner] ${entity.k8sId} failed to fetch ${section} org public key: ${message}`);
|
|
345681
|
-
}
|
|
345682
|
-
for (const secret of sectionSecrets) {
|
|
345683
|
-
await provisionOrgSecret(entity, section, secret, preFetchedKey);
|
|
345684
|
-
}
|
|
345685
|
-
}
|
|
345686
|
-
}
|
|
345687
|
-
async function fetchOrgPublicKey(entity, section) {
|
|
345688
|
-
return (await entity.runWithGithubProvider(async () => {
|
|
345689
|
-
return await github["default"].encryption.getOrgPublicKey(entity.cr.spec.org, section);
|
|
345690
|
-
}));
|
|
345691
|
-
}
|
|
345692
|
-
async function provisionOrgSecret(entity, section, secret, preFetchedKey) {
|
|
345693
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] provisioning org secret ${entity.k8sId}/${section}/${secret.name}`);
|
|
345694
|
-
if (process.env['AVOID_PROVIDER_SECRET_ENCRYPTION']) {
|
|
345695
|
-
await secrets_createUnencryptedSecret(entity, section, secret);
|
|
345696
|
-
}
|
|
345697
|
-
else {
|
|
345698
|
-
await secrets_createEncryptedSecret(entity, section, secret, preFetchedKey);
|
|
345699
|
-
}
|
|
345700
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] org secret provisioned ${section}/${secret.name}`);
|
|
345701
|
-
}
|
|
345702
|
-
async function secrets_createEncryptedSecret(entity, section, secret, preFetchedKey) {
|
|
345703
|
-
const plainSecret = base_Entity.refResolver(secret.ref);
|
|
345704
|
-
const plainTextSecret = plainSecret.getOutput(secret.ref.key);
|
|
345705
|
-
const plaintextSha256 = external_crypto_default().createHash('sha256')
|
|
345706
|
-
.update(plainTextSecret)
|
|
345707
|
-
.digest('hex');
|
|
345708
|
-
const { encrypted_value } = (await entity.runWithGithubProvider(async () => {
|
|
345709
|
-
return await github["default"].encryption.encryptOrgSecret(entity.cr.spec.org, section, plainTextSecret, preFetchedKey);
|
|
345710
|
-
}));
|
|
345711
|
-
entity.patchData({
|
|
345712
|
-
op: PatchOperations.add,
|
|
345713
|
-
path: `/config/${section}/${secret.name}`,
|
|
345714
|
-
value: {
|
|
345715
|
-
value: encrypted_value,
|
|
345716
|
-
visibility: secret.visibility || 'all',
|
|
345717
|
-
...(secret.selectedRepositories && secret.selectedRepositories.length > 0
|
|
345718
|
-
? { selectedRepositories: secret.selectedRepositories }
|
|
345719
|
-
: {}),
|
|
345720
|
-
},
|
|
345721
|
-
});
|
|
345722
|
-
entity.patchData({
|
|
345723
|
-
op: PatchOperations.add,
|
|
345724
|
-
path: `/config/${section}_sha256/${secret.name}`,
|
|
345725
|
-
value: plaintextSha256,
|
|
345726
|
-
});
|
|
345727
|
-
}
|
|
345728
|
-
async function secrets_createUnencryptedSecret(entity, section, secret) {
|
|
345729
|
-
const plainSecret = base_Entity.refResolver(secret.ref);
|
|
345730
|
-
const plainTextSecret = plainSecret.getOutput(secret.ref.key);
|
|
345731
|
-
const plaintextSha256 = external_crypto_default().createHash('sha256')
|
|
345732
|
-
.update(plainTextSecret)
|
|
345733
|
-
.digest('hex');
|
|
345734
|
-
entity.patchData({
|
|
345735
|
-
op: PatchOperations.add,
|
|
345736
|
-
path: `/config/${section}/${secret.name}`,
|
|
345737
|
-
value: {
|
|
345738
|
-
value: plainTextSecret,
|
|
345739
|
-
visibility: secret.visibility || 'all',
|
|
345740
|
-
...(secret.selectedRepositories && secret.selectedRepositories.length > 0
|
|
345741
|
-
? { selectedRepositories: secret.selectedRepositories }
|
|
345742
|
-
: {}),
|
|
345743
|
-
},
|
|
345744
|
-
});
|
|
345745
|
-
entity.patchData({
|
|
345746
|
-
op: PatchOperations.add,
|
|
345747
|
-
path: `/config/${section}_sha256/${secret.name}`,
|
|
345748
|
-
value: plaintextSha256,
|
|
345749
|
-
});
|
|
345750
|
-
}
|
|
345751
|
-
async function adoptSecretsIfNeeded(entity, secrets) {
|
|
345752
|
-
const managedSecrets = entity.cr.fResolveSelfOutputs('managed_secrets') || [];
|
|
345753
|
-
for (const section of secrets_SECTIONS) {
|
|
345754
|
-
const sectionSecrets = secrets[section] || [];
|
|
345755
|
-
if (sectionSecrets.length === 0)
|
|
345756
|
-
continue;
|
|
345757
|
-
const declaredNames = sectionSecrets.map((s) => s.name);
|
|
345758
|
-
const newToModule = declaredNames.filter((name) => !managedSecrets.includes(name));
|
|
345759
|
-
if (newToModule.length === 0) {
|
|
345760
|
-
gh_provisioner_src_logger.debug(`[gh-provisioner] ${entity.k8sId} all declared ${section} secrets are already managed`);
|
|
345761
|
-
continue;
|
|
345762
|
-
}
|
|
345763
|
-
if (managedSecrets.length === 0) {
|
|
345764
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${entity.k8sId} no managed_secrets output — first reconciliation, treating all ${newToModule.length} ${section} secret(s) as new to module`);
|
|
345765
|
-
}
|
|
345766
|
-
for (const secretName of newToModule) {
|
|
345767
|
-
try {
|
|
345768
|
-
const existing = (await entity.runWithGithubProvider(async () => {
|
|
345769
|
-
return await github["default"].encryption.getOrgSecret(entity.cr.spec.org, section, secretName);
|
|
345770
|
-
}));
|
|
345771
|
-
if (existing) {
|
|
345772
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${entity.k8sId} adopting pre-existing ${section} secret '${secretName}' on GitHub org '${entity.cr.spec.org}'`);
|
|
345773
|
-
const resourceType = `github_${section}_organization_secret`;
|
|
345774
|
-
entity.patchImportData({
|
|
345775
|
-
op: PatchOperations.add,
|
|
345776
|
-
path: '/imports/-',
|
|
345777
|
-
value: {
|
|
345778
|
-
to: `${resourceType}.this["${secretName}"]`,
|
|
345779
|
-
id: secretName,
|
|
345780
|
-
},
|
|
345781
|
-
});
|
|
345782
|
-
const secretEntry = sectionSecrets.find((s) => s.name === secretName);
|
|
345783
|
-
if (secretEntry &&
|
|
345784
|
-
secretEntry.visibility === 'selected' &&
|
|
345785
|
-
(section === 'actions' || section === 'dependabot')) {
|
|
345786
|
-
const bindingType = `github_${section}_organization_secret_repositories`;
|
|
345787
|
-
entity.patchImportData({
|
|
345788
|
-
op: PatchOperations.add,
|
|
345789
|
-
path: '/imports/-',
|
|
345790
|
-
value: {
|
|
345791
|
-
to: `${bindingType}.this["${secretName}"]`,
|
|
345792
|
-
id: secretName,
|
|
345793
|
-
},
|
|
345794
|
-
});
|
|
345795
|
-
}
|
|
345796
|
-
}
|
|
345797
|
-
}
|
|
345798
|
-
catch (err) {
|
|
345799
|
-
if (err && err.status === 404) {
|
|
345800
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] ${entity.k8sId} ${section} secret '${secretName}' not found on GitHub org '${entity.cr.spec.org}' — will be created by TFM`);
|
|
345801
|
-
}
|
|
345802
|
-
else if (err && (err.status === 401 || err.status === 403)) {
|
|
345803
|
-
gh_provisioner_src_logger.warn(`[gh-provisioner] ${entity.k8sId} token lacks scope to check ${section} secret '${secretName}' on org '${entity.cr.spec.org}' — skipping adoption gracefully`);
|
|
345804
|
-
}
|
|
345805
|
-
else {
|
|
345806
|
-
gh_provisioner_src_logger.warn(`[gh-provisioner] ${entity.k8sId} unexpected error checking ${section} secret '${secretName}' on org '${entity.cr.spec.org}': ${err instanceof Error ? err.message : String(err)}`);
|
|
345807
|
-
}
|
|
345808
|
-
}
|
|
345809
|
-
}
|
|
345810
|
-
}
|
|
345811
|
-
}
|
|
345812
|
-
|
|
345813
|
-
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgsecretsection/index.ts
|
|
345814
|
-
|
|
345815
|
-
|
|
345816
|
-
|
|
345817
|
-
class EntityGHOrgSecretSection extends base_Entity {
|
|
345818
|
-
constructor(artifact) {
|
|
345819
|
-
super(artifact, {
|
|
345820
|
-
config: {
|
|
345821
|
-
org: '',
|
|
345822
|
-
actions: {},
|
|
345823
|
-
codespaces: {},
|
|
345824
|
-
dependabot: {},
|
|
345825
|
-
actions_sha256: {},
|
|
345826
|
-
codespaces_sha256: {},
|
|
345827
|
-
dependabot_sha256: {},
|
|
345828
|
-
},
|
|
345829
|
-
});
|
|
345830
|
-
}
|
|
345831
|
-
async loadResources(tfOp) {
|
|
345832
|
-
gh_provisioner_src_logger.info(`[gh-provisioner] running ${tfOp} on ${this.k8sId}`);
|
|
345833
|
-
try {
|
|
345834
|
-
const cr = this.cr;
|
|
345835
|
-
const org = cr.spec.org;
|
|
345836
|
-
const secrets = cr.spec.secrets || {};
|
|
345837
|
-
this.patchData({
|
|
345838
|
-
op: PatchOperations.replace,
|
|
345839
|
-
path: '/config/org',
|
|
345840
|
-
value: org,
|
|
345841
|
-
});
|
|
345842
|
-
await provisionOrgSecrets(this, secrets);
|
|
345843
|
-
const redactedDoc = JSON.parse(JSON.stringify(this._document, (key, value) => typeof value === 'string' && value.length > 50 ? '[REDACTED]' : value));
|
|
345844
|
-
this.synthMessage(`[gh-provisioner] ${this.k8sId} config:\n${JSON.stringify(redactedDoc, null, 2)}`);
|
|
345845
|
-
this.synthEnd(`[gh-provisioner] ${this.k8sId} loaded its data`);
|
|
345846
|
-
if (tfOp === 'apply') {
|
|
345847
|
-
await adoptSecretsIfNeeded(this, secrets);
|
|
345848
|
-
}
|
|
345849
|
-
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} loaded its data`);
|
|
345850
|
-
}
|
|
345851
|
-
catch (err) {
|
|
345852
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
345853
|
-
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345854
|
-
throw new Error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345855
|
-
}
|
|
345856
|
-
}
|
|
345857
|
-
async postProvision(_tfOp) { }
|
|
345858
|
-
async loadAddressesToImport() { }
|
|
345859
|
-
}
|
|
345860
|
-
|
|
345861
344244
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgwebhook/index.ts
|
|
345862
344245
|
|
|
345863
344246
|
|
|
@@ -345934,8 +344317,6 @@ class EntityGHOrgWebHook extends base_Entity {
|
|
|
345934
344317
|
|
|
345935
344318
|
|
|
345936
344319
|
|
|
345937
|
-
|
|
345938
|
-
|
|
345939
344320
|
function entities_getEntity(cr) {
|
|
345940
344321
|
const entityClass = getEntityClass(cr.kind);
|
|
345941
344322
|
return new entityClass(cr);
|
|
@@ -345956,10 +344337,6 @@ function getEntityClass(kind) {
|
|
|
345956
344337
|
return EntityGHOrgWebHook;
|
|
345957
344338
|
case 'FirestartrGithubOrganizationSettings':
|
|
345958
344339
|
return EntityGHOrgSettings;
|
|
345959
|
-
case 'FirestartrGithubOrganizationVariableSection':
|
|
345960
|
-
return EntityGHOrgVarsSection;
|
|
345961
|
-
case 'FirestartrGithubOrganizationSecretSection':
|
|
345962
|
-
return EntityGHOrgSecretSection;
|
|
345963
344340
|
default:
|
|
345964
344341
|
throw new Error(`kind ${kind} has no entity associated`);
|
|
345965
344342
|
}
|
|
@@ -346373,7 +344750,6 @@ const GITHUB_RESOURCE_KINDS = [
|
|
|
346373
344750
|
'FirestartrGithubRepositorySecretsSection',
|
|
346374
344751
|
'FirestartrGithubOrgWebhook',
|
|
346375
344752
|
'FirestartrGithubOrganizationSettings',
|
|
346376
|
-
'FirestartrGithubOrganizationVariableSection',
|
|
346377
344753
|
];
|
|
346378
344754
|
const GITHUB_REPOSITORY_DEPENDENT_KINDS = [
|
|
346379
344755
|
'FirestartrGithubRepositoryFeature',
|
|
@@ -347632,9 +346008,6 @@ function isObserveModeActive() {
|
|
|
347632
346008
|
function runOperator(opts) {
|
|
347633
346009
|
const { ignoreLease, dummyExec, namespace, kindList, importMode, importModeSkipPlan, observeMode, withMetrics, } = opts;
|
|
347634
346010
|
const implementedKinds = filterImplementedKinds(kindList);
|
|
347635
|
-
operator_src_logger.info(`operator kindList: ${JSON.stringify(kindList)}`);
|
|
347636
|
-
operator_src_logger.info(`operator implementedKinds: ${JSON.stringify(implementedKinds)}`);
|
|
347637
|
-
operator_src_logger.info(`operator ignoring kinds: ${JSON.stringify(kindList.filter((k) => !implementedKinds.includes(k)))}`);
|
|
347638
346011
|
if (observeMode)
|
|
347639
346012
|
observeModeActive = true;
|
|
347640
346013
|
if (withMetrics)
|
|
@@ -347708,8 +346081,6 @@ const provisionImplementations = {
|
|
|
347708
346081
|
githubmemberships: process_operation_processOperation,
|
|
347709
346082
|
githuborgwebhooks: process_operation_processOperation,
|
|
347710
346083
|
githuborganizationsettings: process_operation_processOperation,
|
|
347711
|
-
githuborganizationvariablesections: process_operation_processOperation,
|
|
347712
|
-
githuborganizationsecretsections: process_operation_processOperation,
|
|
347713
346084
|
fsdummiesa: processFirestartrDummies,
|
|
347714
346085
|
fsdummiesb: processFirestartrDummies,
|
|
347715
346086
|
fsdummiesc: processFirestartrDummies,
|
|
@@ -526528,7 +524899,7 @@ const crsStatusSubcommand = {
|
|
|
526528
524899
|
};
|
|
526529
524900
|
|
|
526530
524901
|
;// CONCATENATED MODULE: ./package.json
|
|
526531
|
-
const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-
|
|
524902
|
+
const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-fix-renderer-1"}');
|
|
526532
524903
|
;// CONCATENATED MODULE: ../../package.json
|
|
526533
524904
|
const package_namespaceObject_1 = {"i8":"2.9.0"};
|
|
526534
524905
|
// EXTERNAL MODULE: ../../node_modules/semver/index.js
|