@firestartr/cli 2.9.0 → 2.10.0-snapshot-org-secrets-2
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 +1343 -8
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +753 -0
- package/build/packages/cdk8s_renderer/src/charts/github/index.d.ts +2 -0
- package/build/packages/cdk8s_renderer/src/charts/github/orgSecretSectionChart.d.ts +8 -0
- package/build/packages/cdk8s_renderer/src/charts/github/orgVariableSectionChart.d.ts +8 -0
- package/build/packages/cdk8s_renderer/src/charts/index.d.ts +3 -1
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +135 -0
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +135 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgSecrets.schema.d.ts +67 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgSettings.d.ts +26 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgsettings.schema.d.ts +70 -0
- 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/cdk8s_renderer/src/validations/githubOrgSecretSection.d.ts +4 -0
- package/build/packages/cdk8s_renderer/src/validations/githubOrgVariableSection.d.ts +4 -0
- package/build/packages/gh_provisioner/src/entities/ghorgvarsection/index.d.ts +8 -0
- package/build/packages/github/index.d.ts +1 -0
- package/build/packages/github/src/organization.d.ts +2 -0
- package/build/packages/github/src/with_profile.d.ts +1 -0
- package/package.json +3 -2
package/build/index.js
CHANGED
|
@@ -284613,6 +284613,17 @@ 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
|
+
}
|
|
284616
284627
|
/* harmony default export */ const organization = ({
|
|
284617
284628
|
getRepositoryList,
|
|
284618
284629
|
getTeamList,
|
|
@@ -284623,6 +284634,7 @@ async function doPaginatedRequest(options) {
|
|
|
284623
284634
|
getOrgTeamsDirectAccess,
|
|
284624
284635
|
getOrgPlanName,
|
|
284625
284636
|
getWebhookList,
|
|
284637
|
+
getOrgVariable,
|
|
284626
284638
|
});
|
|
284627
284639
|
|
|
284628
284640
|
// EXTERNAL MODULE: external "fs"
|
|
@@ -286115,6 +286127,10 @@ function createFacade(profileName) {
|
|
|
286115
286127
|
const octokit = await getOctokitForOrg(orgName);
|
|
286116
286128
|
return getOrgPlanName(orgName, octokit);
|
|
286117
286129
|
},
|
|
286130
|
+
getOrgVariable: async (orgName, variableName) => {
|
|
286131
|
+
const octokit = await getOctokitForOrg(orgName);
|
|
286132
|
+
return getOrgVariable(orgName, variableName, octokit);
|
|
286133
|
+
},
|
|
286118
286134
|
},
|
|
286119
286135
|
repo: {
|
|
286120
286136
|
addStatusCheck: async (output, isFailure, headSha, name, status, repoName, owner) => {
|
|
@@ -319522,9 +319538,14 @@ class UUIDInitializer extends InitializerPatches {
|
|
|
319522
319538
|
},
|
|
319523
319539
|
apply(cr) {
|
|
319524
319540
|
const ctx = helperCTX(this);
|
|
319525
|
-
const
|
|
319526
|
-
|
|
319527
|
-
|
|
319541
|
+
const reusePrevious = previousCR && previousCR.kind === ctx.kind;
|
|
319542
|
+
const uuid = reusePrevious
|
|
319543
|
+
? previousCR?.spec?.firestartr?.tfStateKey ||
|
|
319544
|
+
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319545
|
+
(0,wrapper.v4)()
|
|
319546
|
+
: cr.spec?.firestartr?.tfStateKey ||
|
|
319547
|
+
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319548
|
+
(0,wrapper.v4)();
|
|
319528
319549
|
if (!cr.spec)
|
|
319529
319550
|
cr.spec = {};
|
|
319530
319551
|
if (!cr.spec.firestartr)
|
|
@@ -320066,6 +320087,7 @@ const ONE_WAY_DEFINITIONS = [
|
|
|
320066
320087
|
'/spec/vars',
|
|
320067
320088
|
'/spec/actions/oidc',
|
|
320068
320089
|
'/spec/repo/labels',
|
|
320090
|
+
'/spec/actionsVariables',
|
|
320069
320091
|
];
|
|
320070
320092
|
function applyOneWayDefs(crSpecs) {
|
|
320071
320093
|
const crSpecsClone = JSON.parse(JSON.stringify(crSpecs));
|
|
@@ -322061,6 +322083,42 @@ function extractAllRefs(claimData) {
|
|
|
322061
322083
|
refs.push(...secretsRefs);
|
|
322062
322084
|
break;
|
|
322063
322085
|
}
|
|
322086
|
+
case 'OrgSettingsClaim': {
|
|
322087
|
+
const actionsVariables = parsedClaim.providers?.github?.actions_variables;
|
|
322088
|
+
if (Array.isArray(actionsVariables)) {
|
|
322089
|
+
for (const variable of actionsVariables) {
|
|
322090
|
+
if (variable.visibility !== 'selected')
|
|
322091
|
+
continue;
|
|
322092
|
+
const selectedRepos = variable.selected_repositories;
|
|
322093
|
+
if (!Array.isArray(selectedRepos))
|
|
322094
|
+
continue;
|
|
322095
|
+
for (const repoRef of selectedRepos) {
|
|
322096
|
+
const match = repoRef.match(/^component:(.+)$/);
|
|
322097
|
+
if (match) {
|
|
322098
|
+
refs.push(`ComponentClaim-${match[1]}`);
|
|
322099
|
+
}
|
|
322100
|
+
}
|
|
322101
|
+
}
|
|
322102
|
+
}
|
|
322103
|
+
const orgSecrets = parsedClaim.providers?.github?.org_secrets;
|
|
322104
|
+
if (orgSecrets && typeof orgSecrets === 'object') {
|
|
322105
|
+
const secretRefRegex = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
322106
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
322107
|
+
const secrets = orgSecrets[section];
|
|
322108
|
+
if (!Array.isArray(secrets))
|
|
322109
|
+
continue;
|
|
322110
|
+
for (const secret of secrets) {
|
|
322111
|
+
if (!secret.value)
|
|
322112
|
+
continue;
|
|
322113
|
+
const match = secret.value.match(secretRefRegex);
|
|
322114
|
+
if (match) {
|
|
322115
|
+
refs.push(`SecretsClaim-${match[1]}`);
|
|
322116
|
+
}
|
|
322117
|
+
}
|
|
322118
|
+
}
|
|
322119
|
+
}
|
|
322120
|
+
break;
|
|
322121
|
+
}
|
|
322064
322122
|
}
|
|
322065
322123
|
logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
|
|
322066
322124
|
return [...new Set(refs)];
|
|
@@ -323187,6 +323245,73 @@ const organizationSettingsProperties = {
|
|
|
323187
323245
|
secret_scanning_push_protection_enabled_for_new_repositories: {
|
|
323188
323246
|
type: 'boolean',
|
|
323189
323247
|
},
|
|
323248
|
+
actions_variables: {
|
|
323249
|
+
type: 'array',
|
|
323250
|
+
items: {
|
|
323251
|
+
type: 'object',
|
|
323252
|
+
properties: {
|
|
323253
|
+
name: {
|
|
323254
|
+
type: 'string',
|
|
323255
|
+
pattern: '^[A-Za-z0-9_]+$',
|
|
323256
|
+
},
|
|
323257
|
+
value: {
|
|
323258
|
+
type: 'string',
|
|
323259
|
+
},
|
|
323260
|
+
visibility: {
|
|
323261
|
+
type: 'string',
|
|
323262
|
+
enum: ['all', 'private', 'selected'],
|
|
323263
|
+
},
|
|
323264
|
+
selected_repositories: {
|
|
323265
|
+
type: 'array',
|
|
323266
|
+
items: {
|
|
323267
|
+
$ref: 'firestartr.dev://common/FirestartrComponentRef',
|
|
323268
|
+
},
|
|
323269
|
+
},
|
|
323270
|
+
},
|
|
323271
|
+
required: ['name', 'value', 'visibility'],
|
|
323272
|
+
additionalProperties: false,
|
|
323273
|
+
allOf: [
|
|
323274
|
+
{
|
|
323275
|
+
if: {
|
|
323276
|
+
properties: {
|
|
323277
|
+
visibility: { const: 'selected' },
|
|
323278
|
+
},
|
|
323279
|
+
required: ['visibility'],
|
|
323280
|
+
},
|
|
323281
|
+
then: {},
|
|
323282
|
+
else: {
|
|
323283
|
+
properties: {
|
|
323284
|
+
selected_repositories: { type: 'array', maxItems: 0 },
|
|
323285
|
+
},
|
|
323286
|
+
},
|
|
323287
|
+
},
|
|
323288
|
+
],
|
|
323289
|
+
},
|
|
323290
|
+
},
|
|
323291
|
+
org_secrets: {
|
|
323292
|
+
type: 'object',
|
|
323293
|
+
properties: {
|
|
323294
|
+
actions: {
|
|
323295
|
+
type: 'array',
|
|
323296
|
+
items: {
|
|
323297
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323298
|
+
},
|
|
323299
|
+
},
|
|
323300
|
+
codespaces: {
|
|
323301
|
+
type: 'array',
|
|
323302
|
+
items: {
|
|
323303
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323304
|
+
},
|
|
323305
|
+
},
|
|
323306
|
+
dependabot: {
|
|
323307
|
+
type: 'array',
|
|
323308
|
+
items: {
|
|
323309
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323310
|
+
},
|
|
323311
|
+
},
|
|
323312
|
+
},
|
|
323313
|
+
additionalProperties: false,
|
|
323314
|
+
},
|
|
323190
323315
|
};
|
|
323191
323316
|
/* harmony default export */ const github_orgsettings_schema = ({
|
|
323192
323317
|
$schema: SCHEMA,
|
|
@@ -323374,6 +323499,75 @@ const organizationSettingsProperties = {
|
|
|
323374
323499
|
},
|
|
323375
323500
|
});
|
|
323376
323501
|
|
|
323502
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/orgSecrets.schema.ts
|
|
323503
|
+
|
|
323504
|
+
/* harmony default export */ const orgSecrets_schema = ({
|
|
323505
|
+
$schema: SCHEMA,
|
|
323506
|
+
$id: 'GithubOrgClaimSecrets',
|
|
323507
|
+
definitions: {
|
|
323508
|
+
GithubOrgClaimSecrets: {
|
|
323509
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecrets',
|
|
323510
|
+
type: 'object',
|
|
323511
|
+
description: 'Organization-level GitHub Actions secrets',
|
|
323512
|
+
properties: {
|
|
323513
|
+
actions: {
|
|
323514
|
+
type: 'array',
|
|
323515
|
+
items: {
|
|
323516
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323517
|
+
},
|
|
323518
|
+
},
|
|
323519
|
+
codespaces: {
|
|
323520
|
+
type: 'array',
|
|
323521
|
+
items: {
|
|
323522
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323523
|
+
},
|
|
323524
|
+
},
|
|
323525
|
+
dependabot: {
|
|
323526
|
+
type: 'array',
|
|
323527
|
+
items: {
|
|
323528
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323529
|
+
},
|
|
323530
|
+
},
|
|
323531
|
+
},
|
|
323532
|
+
additionalProperties: false,
|
|
323533
|
+
},
|
|
323534
|
+
GithubOrgClaimSecretRef: {
|
|
323535
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323536
|
+
type: 'string',
|
|
323537
|
+
description: 'the reference of the secret',
|
|
323538
|
+
pattern: '^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
|
|
323539
|
+
},
|
|
323540
|
+
GithubOrgClaimSecret: {
|
|
323541
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323542
|
+
type: 'object',
|
|
323543
|
+
description: 'An organization-level secret for GitHub Actions',
|
|
323544
|
+
properties: {
|
|
323545
|
+
name: {
|
|
323546
|
+
type: 'string',
|
|
323547
|
+
description: 'the name of the secret',
|
|
323548
|
+
},
|
|
323549
|
+
value: {
|
|
323550
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323551
|
+
},
|
|
323552
|
+
visibility: {
|
|
323553
|
+
type: 'string',
|
|
323554
|
+
enum: ['all', 'selected', 'private'],
|
|
323555
|
+
description: 'which repositories can access the secret',
|
|
323556
|
+
},
|
|
323557
|
+
selected_repositories: {
|
|
323558
|
+
type: 'array',
|
|
323559
|
+
items: {
|
|
323560
|
+
type: 'string',
|
|
323561
|
+
},
|
|
323562
|
+
description: 'list of repository refs when visibility is selected',
|
|
323563
|
+
},
|
|
323564
|
+
},
|
|
323565
|
+
required: ['name', 'value'],
|
|
323566
|
+
additionalProperties: false,
|
|
323567
|
+
},
|
|
323568
|
+
},
|
|
323569
|
+
});
|
|
323570
|
+
|
|
323377
323571
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
|
|
323378
323572
|
|
|
323379
323573
|
|
|
@@ -323383,6 +323577,7 @@ const organizationSettingsProperties = {
|
|
|
323383
323577
|
|
|
323384
323578
|
|
|
323385
323579
|
|
|
323580
|
+
|
|
323386
323581
|
const GithubSchemas = [
|
|
323387
323582
|
github_group_schema,
|
|
323388
323583
|
github_user_schema,
|
|
@@ -323392,6 +323587,7 @@ const GithubSchemas = [
|
|
|
323392
323587
|
github_orgsettings_schema,
|
|
323393
323588
|
component_secrets_vars_schema,
|
|
323394
323589
|
component_labels_schema,
|
|
323590
|
+
orgSecrets_schema,
|
|
323395
323591
|
];
|
|
323396
323592
|
|
|
323397
323593
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
|
|
@@ -326538,7 +326734,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
|
|
|
326538
326734
|
function isVariantCR(cr) {
|
|
326539
326735
|
return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
|
|
326540
326736
|
}
|
|
326541
|
-
function getPreviousCRfromClaim(claim, previousCRs) {
|
|
326737
|
+
function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
|
|
326542
326738
|
const previousCRsKeys = Object.keys(previousCRs);
|
|
326543
326739
|
const isVariantClaim = !!claim._parentClaimName;
|
|
326544
326740
|
for (const previousCRKey of previousCRsKeys) {
|
|
@@ -326547,6 +326743,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
|
|
|
326547
326743
|
continue;
|
|
326548
326744
|
if (isExcludedFromPreviousCR(previousCR.kind))
|
|
326549
326745
|
continue;
|
|
326746
|
+
if (expectedKind && previousCR.kind !== expectedKind)
|
|
326747
|
+
continue;
|
|
326550
326748
|
const crVariant = isVariantCR(previousCR);
|
|
326551
326749
|
if (isVariantClaim && !crVariant)
|
|
326552
326750
|
continue;
|
|
@@ -327303,6 +327501,409 @@ var FirestartrGithubMembershipSpecContextProviderRefKind;
|
|
|
327303
327501
|
/** FirestartrProviderConfig */
|
|
327304
327502
|
FirestartrGithubMembershipSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327305
327503
|
})(FirestartrGithubMembershipSpecContextProviderRefKind || (FirestartrGithubMembershipSpecContextProviderRefKind = {}));
|
|
327504
|
+
/**
|
|
327505
|
+
* A resource to handle GitHub Organization Actions Secrets.
|
|
327506
|
+
*
|
|
327507
|
+
* @schema FirestartrGithubOrganizationSecretSection
|
|
327508
|
+
*/
|
|
327509
|
+
class FirestartrGithubOrganizationSecretSection extends lib.ApiObject {
|
|
327510
|
+
/**
|
|
327511
|
+
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationSecretSection".
|
|
327512
|
+
*
|
|
327513
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
327514
|
+
*
|
|
327515
|
+
* @param props initialization props
|
|
327516
|
+
*/
|
|
327517
|
+
static manifest(props) {
|
|
327518
|
+
return {
|
|
327519
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327520
|
+
...toJson_FirestartrGithubOrganizationSecretSectionProps(props),
|
|
327521
|
+
};
|
|
327522
|
+
}
|
|
327523
|
+
/**
|
|
327524
|
+
* Defines a "FirestartrGithubOrganizationSecretSection" API object
|
|
327525
|
+
* @param scope the scope in which to define this object
|
|
327526
|
+
* @param id a scope-local name for the object
|
|
327527
|
+
* @param props initialization props
|
|
327528
|
+
*/
|
|
327529
|
+
constructor(scope, id, props) {
|
|
327530
|
+
super(scope, id, {
|
|
327531
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327532
|
+
...props,
|
|
327533
|
+
});
|
|
327534
|
+
}
|
|
327535
|
+
/**
|
|
327536
|
+
* Renders the object to Kubernetes JSON.
|
|
327537
|
+
*/
|
|
327538
|
+
toJson() {
|
|
327539
|
+
const resolved = super.toJson();
|
|
327540
|
+
return {
|
|
327541
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327542
|
+
...toJson_FirestartrGithubOrganizationSecretSectionProps(resolved),
|
|
327543
|
+
};
|
|
327544
|
+
}
|
|
327545
|
+
}
|
|
327546
|
+
/**
|
|
327547
|
+
* Returns the apiVersion and kind for "FirestartrGithubOrganizationSecretSection"
|
|
327548
|
+
*/
|
|
327549
|
+
FirestartrGithubOrganizationSecretSection.GVK = {
|
|
327550
|
+
apiVersion: 'firestartr.dev/v1',
|
|
327551
|
+
kind: 'FirestartrGithubOrganizationSecretSection',
|
|
327552
|
+
};
|
|
327553
|
+
|
|
327554
|
+
/**
|
|
327555
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionProps' to JSON representation.
|
|
327556
|
+
*/
|
|
327557
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327558
|
+
function toJson_FirestartrGithubOrganizationSecretSectionProps(obj) {
|
|
327559
|
+
if (obj === undefined) {
|
|
327560
|
+
return undefined;
|
|
327561
|
+
}
|
|
327562
|
+
const result = {
|
|
327563
|
+
'metadata': obj.metadata,
|
|
327564
|
+
'spec': toJson_FirestartrGithubOrganizationSecretSectionSpec(obj.spec),
|
|
327565
|
+
};
|
|
327566
|
+
// filter undefined values
|
|
327567
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327568
|
+
}
|
|
327569
|
+
/**
|
|
327570
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpec' to JSON representation.
|
|
327571
|
+
*/
|
|
327572
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327573
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpec(obj) {
|
|
327574
|
+
if (obj === undefined) {
|
|
327575
|
+
return undefined;
|
|
327576
|
+
}
|
|
327577
|
+
const result = {
|
|
327578
|
+
'org': obj.org,
|
|
327579
|
+
'secrets': toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj.secrets),
|
|
327580
|
+
'context': toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj.context),
|
|
327581
|
+
'firestartr': toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj.firestartr),
|
|
327582
|
+
'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
|
|
327583
|
+
};
|
|
327584
|
+
// filter undefined values
|
|
327585
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327586
|
+
}
|
|
327587
|
+
/**
|
|
327588
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecrets' to JSON representation.
|
|
327589
|
+
*/
|
|
327590
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327591
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj) {
|
|
327592
|
+
if (obj === undefined) {
|
|
327593
|
+
return undefined;
|
|
327594
|
+
}
|
|
327595
|
+
const result = {
|
|
327596
|
+
'actions': obj.actions?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(y)),
|
|
327597
|
+
'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(y)),
|
|
327598
|
+
'dependabot': obj.dependabot?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(y)),
|
|
327599
|
+
};
|
|
327600
|
+
// filter undefined values
|
|
327601
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327602
|
+
}
|
|
327603
|
+
/**
|
|
327604
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContext' to JSON representation.
|
|
327605
|
+
*/
|
|
327606
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327607
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj) {
|
|
327608
|
+
if (obj === undefined) {
|
|
327609
|
+
return undefined;
|
|
327610
|
+
}
|
|
327611
|
+
const result = {
|
|
327612
|
+
'backend': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj.backend),
|
|
327613
|
+
'provider': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj.provider),
|
|
327614
|
+
};
|
|
327615
|
+
// filter undefined values
|
|
327616
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327617
|
+
}
|
|
327618
|
+
/**
|
|
327619
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecFirestartr' to JSON representation.
|
|
327620
|
+
*/
|
|
327621
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327622
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj) {
|
|
327623
|
+
if (obj === undefined) {
|
|
327624
|
+
return undefined;
|
|
327625
|
+
}
|
|
327626
|
+
const result = {
|
|
327627
|
+
'tfStateKey': obj.tfStateKey,
|
|
327628
|
+
};
|
|
327629
|
+
// filter undefined values
|
|
327630
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327631
|
+
}
|
|
327632
|
+
/**
|
|
327633
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef' to JSON representation.
|
|
327634
|
+
*/
|
|
327635
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327636
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj) {
|
|
327637
|
+
if (obj === undefined) {
|
|
327638
|
+
return undefined;
|
|
327639
|
+
}
|
|
327640
|
+
const result = {
|
|
327641
|
+
'name': obj.name,
|
|
327642
|
+
'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(y)),
|
|
327643
|
+
};
|
|
327644
|
+
// filter undefined values
|
|
327645
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327646
|
+
}
|
|
327647
|
+
/**
|
|
327648
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActions' to JSON representation.
|
|
327649
|
+
*/
|
|
327650
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327651
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(obj) {
|
|
327652
|
+
if (obj === undefined) {
|
|
327653
|
+
return undefined;
|
|
327654
|
+
}
|
|
327655
|
+
const result = {
|
|
327656
|
+
'name': obj.name,
|
|
327657
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj.ref),
|
|
327658
|
+
'visibility': obj.visibility,
|
|
327659
|
+
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327660
|
+
};
|
|
327661
|
+
// filter undefined values
|
|
327662
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327663
|
+
}
|
|
327664
|
+
/**
|
|
327665
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces' to JSON representation.
|
|
327666
|
+
*/
|
|
327667
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327668
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(obj) {
|
|
327669
|
+
if (obj === undefined) {
|
|
327670
|
+
return undefined;
|
|
327671
|
+
}
|
|
327672
|
+
const result = {
|
|
327673
|
+
'name': obj.name,
|
|
327674
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj.ref),
|
|
327675
|
+
'visibility': obj.visibility,
|
|
327676
|
+
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327677
|
+
};
|
|
327678
|
+
// filter undefined values
|
|
327679
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327680
|
+
}
|
|
327681
|
+
/**
|
|
327682
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot' to JSON representation.
|
|
327683
|
+
*/
|
|
327684
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327685
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(obj) {
|
|
327686
|
+
if (obj === undefined) {
|
|
327687
|
+
return undefined;
|
|
327688
|
+
}
|
|
327689
|
+
const result = {
|
|
327690
|
+
'name': obj.name,
|
|
327691
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj.ref),
|
|
327692
|
+
'visibility': obj.visibility,
|
|
327693
|
+
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
327694
|
+
};
|
|
327695
|
+
// filter undefined values
|
|
327696
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327697
|
+
}
|
|
327698
|
+
/**
|
|
327699
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackend' to JSON representation.
|
|
327700
|
+
*/
|
|
327701
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327702
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj) {
|
|
327703
|
+
if (obj === undefined) {
|
|
327704
|
+
return undefined;
|
|
327705
|
+
}
|
|
327706
|
+
const result = {
|
|
327707
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj.ref),
|
|
327708
|
+
};
|
|
327709
|
+
// filter undefined values
|
|
327710
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327711
|
+
}
|
|
327712
|
+
/**
|
|
327713
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProvider' to JSON representation.
|
|
327714
|
+
*/
|
|
327715
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327716
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj) {
|
|
327717
|
+
if (obj === undefined) {
|
|
327718
|
+
return undefined;
|
|
327719
|
+
}
|
|
327720
|
+
const result = {
|
|
327721
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj.ref),
|
|
327722
|
+
};
|
|
327723
|
+
// filter undefined values
|
|
327724
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327725
|
+
}
|
|
327726
|
+
/**
|
|
327727
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
|
|
327728
|
+
*/
|
|
327729
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327730
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(obj) {
|
|
327731
|
+
if (obj === undefined) {
|
|
327732
|
+
return undefined;
|
|
327733
|
+
}
|
|
327734
|
+
const result = {
|
|
327735
|
+
'key': obj.key,
|
|
327736
|
+
};
|
|
327737
|
+
// filter undefined values
|
|
327738
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327739
|
+
}
|
|
327740
|
+
/**
|
|
327741
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef' to JSON representation.
|
|
327742
|
+
*/
|
|
327743
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327744
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj) {
|
|
327745
|
+
if (obj === undefined) {
|
|
327746
|
+
return undefined;
|
|
327747
|
+
}
|
|
327748
|
+
const result = {
|
|
327749
|
+
'kind': obj.kind,
|
|
327750
|
+
'name': obj.name,
|
|
327751
|
+
'key': obj.key,
|
|
327752
|
+
};
|
|
327753
|
+
// filter undefined values
|
|
327754
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327755
|
+
}
|
|
327756
|
+
/**
|
|
327757
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef' to JSON representation.
|
|
327758
|
+
*/
|
|
327759
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327760
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj) {
|
|
327761
|
+
if (obj === undefined) {
|
|
327762
|
+
return undefined;
|
|
327763
|
+
}
|
|
327764
|
+
const result = {
|
|
327765
|
+
'kind': obj.kind,
|
|
327766
|
+
'name': obj.name,
|
|
327767
|
+
'key': obj.key,
|
|
327768
|
+
};
|
|
327769
|
+
// filter undefined values
|
|
327770
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327771
|
+
}
|
|
327772
|
+
/**
|
|
327773
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef' to JSON representation.
|
|
327774
|
+
*/
|
|
327775
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327776
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj) {
|
|
327777
|
+
if (obj === undefined) {
|
|
327778
|
+
return undefined;
|
|
327779
|
+
}
|
|
327780
|
+
const result = {
|
|
327781
|
+
'kind': obj.kind,
|
|
327782
|
+
'name': obj.name,
|
|
327783
|
+
'key': obj.key,
|
|
327784
|
+
};
|
|
327785
|
+
// filter undefined values
|
|
327786
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327787
|
+
}
|
|
327788
|
+
/**
|
|
327789
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackendRef' to JSON representation.
|
|
327790
|
+
*/
|
|
327791
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327792
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj) {
|
|
327793
|
+
if (obj === undefined) {
|
|
327794
|
+
return undefined;
|
|
327795
|
+
}
|
|
327796
|
+
const result = {
|
|
327797
|
+
'kind': obj.kind,
|
|
327798
|
+
'name': obj.name,
|
|
327799
|
+
};
|
|
327800
|
+
// filter undefined values
|
|
327801
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327802
|
+
}
|
|
327803
|
+
/**
|
|
327804
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProviderRef' to JSON representation.
|
|
327805
|
+
*/
|
|
327806
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327807
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj) {
|
|
327808
|
+
if (obj === undefined) {
|
|
327809
|
+
return undefined;
|
|
327810
|
+
}
|
|
327811
|
+
const result = {
|
|
327812
|
+
'kind': obj.kind,
|
|
327813
|
+
'name': obj.name,
|
|
327814
|
+
};
|
|
327815
|
+
// filter undefined values
|
|
327816
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327817
|
+
}
|
|
327818
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327819
|
+
/**
|
|
327820
|
+
* The type of Kubernetes resource to reference.
|
|
327821
|
+
*
|
|
327822
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind
|
|
327823
|
+
*/
|
|
327824
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind;
|
|
327825
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind) {
|
|
327826
|
+
/** Secret */
|
|
327827
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind["SECRET"] = "Secret";
|
|
327828
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind = {}));
|
|
327829
|
+
/**
|
|
327830
|
+
* Which repositories can access the secret.
|
|
327831
|
+
*
|
|
327832
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility
|
|
327833
|
+
*/
|
|
327834
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility;
|
|
327835
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility) {
|
|
327836
|
+
/** all */
|
|
327837
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["ALL"] = "all";
|
|
327838
|
+
/** selected */
|
|
327839
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["SELECTED"] = "selected";
|
|
327840
|
+
/** private */
|
|
327841
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["PRIVATE"] = "private";
|
|
327842
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility = {}));
|
|
327843
|
+
/**
|
|
327844
|
+
* The type of Kubernetes resource to reference.
|
|
327845
|
+
*
|
|
327846
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind
|
|
327847
|
+
*/
|
|
327848
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind;
|
|
327849
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind) {
|
|
327850
|
+
/** Secret */
|
|
327851
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind["SECRET"] = "Secret";
|
|
327852
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind = {}));
|
|
327853
|
+
/**
|
|
327854
|
+
* Which repositories can access the secret.
|
|
327855
|
+
*
|
|
327856
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility
|
|
327857
|
+
*/
|
|
327858
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility;
|
|
327859
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility) {
|
|
327860
|
+
/** all */
|
|
327861
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["ALL"] = "all";
|
|
327862
|
+
/** selected */
|
|
327863
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["SELECTED"] = "selected";
|
|
327864
|
+
/** private */
|
|
327865
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["PRIVATE"] = "private";
|
|
327866
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility = {}));
|
|
327867
|
+
/**
|
|
327868
|
+
* The type of Kubernetes resource to reference.
|
|
327869
|
+
*
|
|
327870
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind
|
|
327871
|
+
*/
|
|
327872
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind;
|
|
327873
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind) {
|
|
327874
|
+
/** Secret */
|
|
327875
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind["SECRET"] = "Secret";
|
|
327876
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind = {}));
|
|
327877
|
+
/**
|
|
327878
|
+
* Which repositories can access the secret.
|
|
327879
|
+
*
|
|
327880
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility
|
|
327881
|
+
*/
|
|
327882
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility;
|
|
327883
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility) {
|
|
327884
|
+
/** all */
|
|
327885
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["ALL"] = "all";
|
|
327886
|
+
/** selected */
|
|
327887
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["SELECTED"] = "selected";
|
|
327888
|
+
/** private */
|
|
327889
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["PRIVATE"] = "private";
|
|
327890
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility = {}));
|
|
327891
|
+
/**
|
|
327892
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind
|
|
327893
|
+
*/
|
|
327894
|
+
var FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind;
|
|
327895
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind) {
|
|
327896
|
+
/** FirestartrProviderConfig */
|
|
327897
|
+
FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327898
|
+
})(FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind = {}));
|
|
327899
|
+
/**
|
|
327900
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind
|
|
327901
|
+
*/
|
|
327902
|
+
var FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind;
|
|
327903
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind) {
|
|
327904
|
+
/** FirestartrProviderConfig */
|
|
327905
|
+
FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327906
|
+
})(FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind = {}));
|
|
327306
327907
|
/**
|
|
327307
327908
|
* A resource to handle GitHub Organization Settings.
|
|
327308
327909
|
*
|
|
@@ -327561,6 +328162,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
|
|
|
327561
328162
|
/** FirestartrProviderConfig */
|
|
327562
328163
|
FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327563
328164
|
})(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
|
|
328165
|
+
/**
|
|
328166
|
+
* A resource to handle GitHub Organization Actions Variables.
|
|
328167
|
+
*
|
|
328168
|
+
* @schema FirestartrGithubOrganizationVariableSection
|
|
328169
|
+
*/
|
|
328170
|
+
class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
|
|
328171
|
+
/**
|
|
328172
|
+
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
|
|
328173
|
+
*
|
|
328174
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
328175
|
+
*
|
|
328176
|
+
* @param props initialization props
|
|
328177
|
+
*/
|
|
328178
|
+
static manifest(props) {
|
|
328179
|
+
return {
|
|
328180
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328181
|
+
...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
|
|
328182
|
+
};
|
|
328183
|
+
}
|
|
328184
|
+
/**
|
|
328185
|
+
* Defines a "FirestartrGithubOrganizationVariableSection" API object
|
|
328186
|
+
* @param scope the scope in which to define this object
|
|
328187
|
+
* @param id a scope-local name for the object
|
|
328188
|
+
* @param props initialization props
|
|
328189
|
+
*/
|
|
328190
|
+
constructor(scope, id, props) {
|
|
328191
|
+
super(scope, id, {
|
|
328192
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328193
|
+
...props,
|
|
328194
|
+
});
|
|
328195
|
+
}
|
|
328196
|
+
/**
|
|
328197
|
+
* Renders the object to Kubernetes JSON.
|
|
328198
|
+
*/
|
|
328199
|
+
toJson() {
|
|
328200
|
+
const resolved = super.toJson();
|
|
328201
|
+
return {
|
|
328202
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328203
|
+
...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
|
|
328204
|
+
};
|
|
328205
|
+
}
|
|
328206
|
+
}
|
|
328207
|
+
/**
|
|
328208
|
+
* Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
|
|
328209
|
+
*/
|
|
328210
|
+
FirestartrGithubOrganizationVariableSection.GVK = {
|
|
328211
|
+
apiVersion: 'firestartr.dev/v1',
|
|
328212
|
+
kind: 'FirestartrGithubOrganizationVariableSection',
|
|
328213
|
+
};
|
|
328214
|
+
|
|
328215
|
+
/**
|
|
328216
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
|
|
328217
|
+
*/
|
|
328218
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328219
|
+
function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
|
|
328220
|
+
if (obj === undefined) {
|
|
328221
|
+
return undefined;
|
|
328222
|
+
}
|
|
328223
|
+
const result = {
|
|
328224
|
+
'metadata': obj.metadata,
|
|
328225
|
+
'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
|
|
328226
|
+
};
|
|
328227
|
+
// filter undefined values
|
|
328228
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328229
|
+
}
|
|
328230
|
+
/**
|
|
328231
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
|
|
328232
|
+
*/
|
|
328233
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328234
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
|
|
328235
|
+
if (obj === undefined) {
|
|
328236
|
+
return undefined;
|
|
328237
|
+
}
|
|
328238
|
+
const result = {
|
|
328239
|
+
'org': obj.org,
|
|
328240
|
+
'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
|
|
328241
|
+
'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
|
|
328242
|
+
'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
|
|
328243
|
+
'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
|
|
328244
|
+
};
|
|
328245
|
+
// filter undefined values
|
|
328246
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328247
|
+
}
|
|
328248
|
+
/**
|
|
328249
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
|
|
328250
|
+
*/
|
|
328251
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328252
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
|
|
328253
|
+
if (obj === undefined) {
|
|
328254
|
+
return undefined;
|
|
328255
|
+
}
|
|
328256
|
+
const result = {
|
|
328257
|
+
'name': obj.name,
|
|
328258
|
+
'value': obj.value,
|
|
328259
|
+
'visibility': obj.visibility,
|
|
328260
|
+
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
328261
|
+
};
|
|
328262
|
+
// filter undefined values
|
|
328263
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328264
|
+
}
|
|
328265
|
+
/**
|
|
328266
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
|
|
328267
|
+
*/
|
|
328268
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328269
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
|
|
328270
|
+
if (obj === undefined) {
|
|
328271
|
+
return undefined;
|
|
328272
|
+
}
|
|
328273
|
+
const result = {
|
|
328274
|
+
'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
|
|
328275
|
+
'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
|
|
328276
|
+
};
|
|
328277
|
+
// filter undefined values
|
|
328278
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328279
|
+
}
|
|
328280
|
+
/**
|
|
328281
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
|
|
328282
|
+
*/
|
|
328283
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328284
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
|
|
328285
|
+
if (obj === undefined) {
|
|
328286
|
+
return undefined;
|
|
328287
|
+
}
|
|
328288
|
+
const result = {
|
|
328289
|
+
'tfStateKey': obj.tfStateKey,
|
|
328290
|
+
};
|
|
328291
|
+
// filter undefined values
|
|
328292
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328293
|
+
}
|
|
328294
|
+
/**
|
|
328295
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
|
|
328296
|
+
*/
|
|
328297
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328298
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
|
|
328299
|
+
if (obj === undefined) {
|
|
328300
|
+
return undefined;
|
|
328301
|
+
}
|
|
328302
|
+
const result = {
|
|
328303
|
+
'name': obj.name,
|
|
328304
|
+
'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
|
|
328305
|
+
};
|
|
328306
|
+
// filter undefined values
|
|
328307
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328308
|
+
}
|
|
328309
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328310
|
+
/**
|
|
328311
|
+
* Visibility of the variable
|
|
328312
|
+
*
|
|
328313
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
|
|
328314
|
+
*/
|
|
328315
|
+
var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
|
|
328316
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
|
|
328317
|
+
/** all */
|
|
328318
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
|
|
328319
|
+
/** private */
|
|
328320
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
|
|
328321
|
+
/** selected */
|
|
328322
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
|
|
328323
|
+
})(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
|
|
328324
|
+
/**
|
|
328325
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
|
|
328326
|
+
*/
|
|
328327
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328328
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
|
|
328329
|
+
if (obj === undefined) {
|
|
328330
|
+
return undefined;
|
|
328331
|
+
}
|
|
328332
|
+
const result = {
|
|
328333
|
+
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
|
|
328334
|
+
};
|
|
328335
|
+
// filter undefined values
|
|
328336
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328337
|
+
}
|
|
328338
|
+
/**
|
|
328339
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
|
|
328340
|
+
*/
|
|
328341
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328342
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
|
|
328343
|
+
if (obj === undefined) {
|
|
328344
|
+
return undefined;
|
|
328345
|
+
}
|
|
328346
|
+
const result = {
|
|
328347
|
+
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
|
|
328348
|
+
};
|
|
328349
|
+
// filter undefined values
|
|
328350
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328351
|
+
}
|
|
328352
|
+
/**
|
|
328353
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
|
|
328354
|
+
*/
|
|
328355
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328356
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
|
|
328357
|
+
if (obj === undefined) {
|
|
328358
|
+
return undefined;
|
|
328359
|
+
}
|
|
328360
|
+
const result = {
|
|
328361
|
+
'key': obj.key,
|
|
328362
|
+
};
|
|
328363
|
+
// filter undefined values
|
|
328364
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328365
|
+
}
|
|
328366
|
+
/**
|
|
328367
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
|
|
328368
|
+
*/
|
|
328369
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328370
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
|
|
328371
|
+
if (obj === undefined) {
|
|
328372
|
+
return undefined;
|
|
328373
|
+
}
|
|
328374
|
+
const result = {
|
|
328375
|
+
'kind': obj.kind,
|
|
328376
|
+
'name': obj.name,
|
|
328377
|
+
};
|
|
328378
|
+
// filter undefined values
|
|
328379
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328380
|
+
}
|
|
328381
|
+
/**
|
|
328382
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
|
|
328383
|
+
*/
|
|
328384
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328385
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
|
|
328386
|
+
if (obj === undefined) {
|
|
328387
|
+
return undefined;
|
|
328388
|
+
}
|
|
328389
|
+
const result = {
|
|
328390
|
+
'kind': obj.kind,
|
|
328391
|
+
'name': obj.name,
|
|
328392
|
+
};
|
|
328393
|
+
// filter undefined values
|
|
328394
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328395
|
+
}
|
|
328396
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328397
|
+
/**
|
|
328398
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
|
|
328399
|
+
*/
|
|
328400
|
+
var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
|
|
328401
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
|
|
328402
|
+
/** FirestartrProviderConfig */
|
|
328403
|
+
FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328404
|
+
})(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
|
|
328405
|
+
/**
|
|
328406
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
|
|
328407
|
+
*/
|
|
328408
|
+
var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
|
|
328409
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
|
|
328410
|
+
/** FirestartrProviderConfig */
|
|
328411
|
+
FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328412
|
+
})(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
|
|
327564
328413
|
/**
|
|
327565
328414
|
* A resource to handle GitHub Organization Webhooks
|
|
327566
328415
|
*
|
|
@@ -330410,6 +331259,122 @@ class GithubOrgSettingsChart extends BaseGithubChart {
|
|
|
330410
331259
|
}
|
|
330411
331260
|
}
|
|
330412
331261
|
|
|
331262
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
|
|
331263
|
+
|
|
331264
|
+
|
|
331265
|
+
|
|
331266
|
+
class GithubOrgVariableSectionChart extends BaseGithubChart {
|
|
331267
|
+
template() {
|
|
331268
|
+
const claim = this.get('claim');
|
|
331269
|
+
const firestartrId = this.get('firestartrId');
|
|
331270
|
+
const githubProvider = claim.providers.github;
|
|
331271
|
+
const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
|
|
331272
|
+
const entry = {
|
|
331273
|
+
name: v.name,
|
|
331274
|
+
value: v.value,
|
|
331275
|
+
visibility: v.visibility,
|
|
331276
|
+
};
|
|
331277
|
+
if (v.selected_repositories && v.selected_repositories.length > 0) {
|
|
331278
|
+
entry.selectedRepositories = v.selected_repositories.map((ref) => {
|
|
331279
|
+
const match = ref.match(/^component:(.+)$/);
|
|
331280
|
+
if (!match) {
|
|
331281
|
+
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
|
|
331282
|
+
}
|
|
331283
|
+
const componentName = match[1];
|
|
331284
|
+
const resolvedCr = this.refResolver('ComponentClaim', componentName);
|
|
331285
|
+
const org = resolvedCr?.spec?.org;
|
|
331286
|
+
const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
|
|
331287
|
+
if (!org || !repoName) {
|
|
331288
|
+
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
|
|
331289
|
+
}
|
|
331290
|
+
return `${org}/${repoName}`;
|
|
331291
|
+
});
|
|
331292
|
+
}
|
|
331293
|
+
return entry;
|
|
331294
|
+
});
|
|
331295
|
+
const template = {
|
|
331296
|
+
metadata: {
|
|
331297
|
+
name: githubProvider.name,
|
|
331298
|
+
},
|
|
331299
|
+
spec: {
|
|
331300
|
+
org: githubProvider.org,
|
|
331301
|
+
actionsVariables,
|
|
331302
|
+
firestartr: {
|
|
331303
|
+
tfStateKey: firestartrId,
|
|
331304
|
+
},
|
|
331305
|
+
writeConnectionSecretToRef: {
|
|
331306
|
+
name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
|
|
331307
|
+
outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
|
|
331308
|
+
},
|
|
331309
|
+
},
|
|
331310
|
+
};
|
|
331311
|
+
return JSON.parse(JSON.stringify(template));
|
|
331312
|
+
}
|
|
331313
|
+
gvk() {
|
|
331314
|
+
return FirestartrGithubOrganizationVariableSection.GVK;
|
|
331315
|
+
}
|
|
331316
|
+
instanceApiObject(template) {
|
|
331317
|
+
return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
|
|
331318
|
+
}
|
|
331319
|
+
}
|
|
331320
|
+
|
|
331321
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgSecretSectionChart.ts
|
|
331322
|
+
|
|
331323
|
+
|
|
331324
|
+
class GithubOrgSecretSectionChart extends BaseGithubChart {
|
|
331325
|
+
template() {
|
|
331326
|
+
const claim = this.get('claim');
|
|
331327
|
+
const firestartrId = this.get('firestartrId');
|
|
331328
|
+
const githubProvider = claim.providers.github;
|
|
331329
|
+
const orgSecrets = githubProvider.org_secrets || {};
|
|
331330
|
+
const renderSecrets = (section) => {
|
|
331331
|
+
const secrets = orgSecrets[section];
|
|
331332
|
+
if (!Array.isArray(secrets))
|
|
331333
|
+
return [];
|
|
331334
|
+
return secrets.map((secret) => {
|
|
331335
|
+
const parts = secret.value.split(':');
|
|
331336
|
+
return {
|
|
331337
|
+
name: secret.name,
|
|
331338
|
+
ref: {
|
|
331339
|
+
kind: 'Secret',
|
|
331340
|
+
name: parts[2],
|
|
331341
|
+
key: parts[3],
|
|
331342
|
+
},
|
|
331343
|
+
visibility: secret.visibility || 'all',
|
|
331344
|
+
selectedRepositories: secret.selected_repositories || [],
|
|
331345
|
+
};
|
|
331346
|
+
});
|
|
331347
|
+
};
|
|
331348
|
+
const template = {
|
|
331349
|
+
metadata: {
|
|
331350
|
+
name: `${githubProvider.name}-secrets`,
|
|
331351
|
+
},
|
|
331352
|
+
spec: {
|
|
331353
|
+
org: githubProvider.org,
|
|
331354
|
+
secrets: {
|
|
331355
|
+
actions: renderSecrets('actions'),
|
|
331356
|
+
codespaces: renderSecrets('codespaces'),
|
|
331357
|
+
dependabot: renderSecrets('dependabot'),
|
|
331358
|
+
},
|
|
331359
|
+
firestartr: {
|
|
331360
|
+
tfStateKey: firestartrId ? `${firestartrId}-secrets` : firestartrId,
|
|
331361
|
+
},
|
|
331362
|
+
writeConnectionSecretToRef: {
|
|
331363
|
+
name: `firestartrgithuborganizationsecretsection-${githubProvider.name}-outputs`.toLowerCase(),
|
|
331364
|
+
outputs: [{ key: 'managed_secrets' }, { key: 'secret_ids' }],
|
|
331365
|
+
},
|
|
331366
|
+
},
|
|
331367
|
+
};
|
|
331368
|
+
return JSON.parse(JSON.stringify(template));
|
|
331369
|
+
}
|
|
331370
|
+
gvk() {
|
|
331371
|
+
return FirestartrGithubOrganizationSecretSection.GVK;
|
|
331372
|
+
}
|
|
331373
|
+
instanceApiObject(template) {
|
|
331374
|
+
return new FirestartrGithubOrganizationSecretSection(this, template.metadata.name, template);
|
|
331375
|
+
}
|
|
331376
|
+
}
|
|
331377
|
+
|
|
330413
331378
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
|
|
330414
331379
|
|
|
330415
331380
|
|
|
@@ -330417,6 +331382,8 @@ class GithubOrgSettingsChart extends BaseGithubChart {
|
|
|
330417
331382
|
|
|
330418
331383
|
|
|
330419
331384
|
|
|
331385
|
+
|
|
331386
|
+
|
|
330420
331387
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
|
|
330421
331388
|
|
|
330422
331389
|
class BaseCatalogChart extends BaseChart {
|
|
@@ -331164,6 +332131,8 @@ class SecretsChart extends BaseSecretsChart {
|
|
|
331164
332131
|
SecretsChart: SecretsChart,
|
|
331165
332132
|
GithubOrgWebhookChart: GithubOrgWebhookChart,
|
|
331166
332133
|
GithubOrgSettingsChart: GithubOrgSettingsChart,
|
|
332134
|
+
GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
|
|
332135
|
+
GithubOrgSecretSectionChart: GithubOrgSecretSectionChart,
|
|
331167
332136
|
});
|
|
331168
332137
|
|
|
331169
332138
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
|
|
@@ -331208,13 +332177,28 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
331208
332177
|
if (configuredProvider !== AllowedProviders.all.toString()) {
|
|
331209
332178
|
providers = providers.filter((provider) => provider === configuredProvider);
|
|
331210
332179
|
}
|
|
331211
|
-
const
|
|
332180
|
+
const expectedKind = claim.kind === 'OrgSettingsClaim'
|
|
332181
|
+
? 'FirestartrGithubOrganizationSettings'
|
|
332182
|
+
: undefined;
|
|
332183
|
+
const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
|
|
332184
|
+
const variableSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332185
|
+
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-variable-section` }, crs, 'FirestartrGithubOrganizationVariableSection')
|
|
332186
|
+
: false;
|
|
332187
|
+
const secretSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332188
|
+
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-secret-section` }, crs, 'FirestartrGithubOrganizationSecretSection')
|
|
332189
|
+
: false;
|
|
331212
332190
|
const patches = await extractPatches(renderClaims[claimKey], previousCR);
|
|
332191
|
+
let variableSectionPatches = undefined;
|
|
332192
|
+
let secretSectionPatches = undefined;
|
|
332193
|
+
if (claim.kind === 'OrgSettingsClaim') {
|
|
332194
|
+
variableSectionPatches = await extractPatches(renderClaims[claimKey], variableSectionPreviousCR);
|
|
332195
|
+
secretSectionPatches = await extractPatches(renderClaims[claimKey], secretSectionPreviousCR);
|
|
332196
|
+
}
|
|
331213
332197
|
if (!previousCR) {
|
|
331214
332198
|
logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
|
|
331215
332199
|
}
|
|
331216
332200
|
const claimPath = renderClaims[claimKey].claimPath;
|
|
331217
|
-
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath);
|
|
332201
|
+
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath, variableSectionPreviousCR, variableSectionPatches, secretSectionPreviousCR, secretSectionPatches);
|
|
331218
332202
|
if (catalogEntity) {
|
|
331219
332203
|
result[`${catalogEntity.kind}-${catalogEntity.metadata.name}`] =
|
|
331220
332204
|
catalogEntity.toJson();
|
|
@@ -331243,7 +332227,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
331243
332227
|
}
|
|
331244
332228
|
return result;
|
|
331245
332229
|
}
|
|
331246
|
-
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath) {
|
|
332230
|
+
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath, variableSectionPreviousCR = false, variableSectionPatches, secretSectionPreviousCR = false, secretSectionPatches) {
|
|
331247
332231
|
let catalogEntity = undefined;
|
|
331248
332232
|
let firestartrEntity = undefined;
|
|
331249
332233
|
const extraCharts = [];
|
|
@@ -331391,6 +332375,48 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
331391
332375
|
case 'OrgSettingsClaim':
|
|
331392
332376
|
if (loadGithub) {
|
|
331393
332377
|
firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
|
|
332378
|
+
const variableSectionFirestartrId = variableSectionPreviousCR
|
|
332379
|
+
? variableSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332380
|
+
: firestartrId
|
|
332381
|
+
? `${firestartrId}-variables`
|
|
332382
|
+
: null;
|
|
332383
|
+
const vsRenderPatches = variableSectionPatches
|
|
332384
|
+
? variableSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332385
|
+
: renderPatches;
|
|
332386
|
+
const vsPostPatches = variableSectionPatches
|
|
332387
|
+
? variableSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332388
|
+
: postPatches;
|
|
332389
|
+
const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, vsRenderPatches);
|
|
332390
|
+
await variableSectionChart.render();
|
|
332391
|
+
const variableSectionObject = await variableSectionChart.postRenderer(vsPostPatches);
|
|
332392
|
+
extraCharts.push({
|
|
332393
|
+
claim: {
|
|
332394
|
+
kind: claim.kind,
|
|
332395
|
+
name: `${claim.name}-variable-section`,
|
|
332396
|
+
},
|
|
332397
|
+
chart: variableSectionObject,
|
|
332398
|
+
});
|
|
332399
|
+
const secretSectionFirestartrId = secretSectionPreviousCR
|
|
332400
|
+
? secretSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332401
|
+
: firestartrId
|
|
332402
|
+
? `${firestartrId}-secrets`
|
|
332403
|
+
: null;
|
|
332404
|
+
const ssRenderPatches = secretSectionPatches
|
|
332405
|
+
? secretSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332406
|
+
: renderPatches;
|
|
332407
|
+
const ssPostPatches = secretSectionPatches
|
|
332408
|
+
? secretSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332409
|
+
: postPatches;
|
|
332410
|
+
const secretSectionChart = new charts.GithubOrgSecretSectionChart(firestartrScope, `github-secrets-${chartId}`, secretSectionFirestartrId, claim, ssRenderPatches);
|
|
332411
|
+
await secretSectionChart.render();
|
|
332412
|
+
const secretSectionObject = await secretSectionChart.postRenderer(ssPostPatches);
|
|
332413
|
+
extraCharts.push({
|
|
332414
|
+
claim: {
|
|
332415
|
+
kind: claim.kind,
|
|
332416
|
+
name: `${claim.name}-secret-section`,
|
|
332417
|
+
},
|
|
332418
|
+
chart: secretSectionObject,
|
|
332419
|
+
});
|
|
331394
332420
|
}
|
|
331395
332421
|
break;
|
|
331396
332422
|
default:
|
|
@@ -331555,6 +332581,205 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
331555
332581
|
}
|
|
331556
332582
|
}
|
|
331557
332583
|
|
|
332584
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
|
|
332585
|
+
const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
|
|
332586
|
+
const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332587
|
+
const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332588
|
+
const COMPONENT_REF_PATTERN = /^component:(.+)$/;
|
|
332589
|
+
function githubOrgVariableSection_formatResourceRef(name, claimRef) {
|
|
332590
|
+
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332591
|
+
}
|
|
332592
|
+
function validateGithubOrgVariableSectionSingleton(crs) {
|
|
332593
|
+
const refsByOrg = new Map();
|
|
332594
|
+
const seenClaimRefs = new Map();
|
|
332595
|
+
for (const crKey of Object.keys(crs)) {
|
|
332596
|
+
const cr = crs[crKey];
|
|
332597
|
+
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332598
|
+
continue;
|
|
332599
|
+
const org = cr.spec?.org;
|
|
332600
|
+
if (typeof org !== 'string' || !org)
|
|
332601
|
+
continue;
|
|
332602
|
+
const name = cr.metadata?.name || crKey;
|
|
332603
|
+
const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332604
|
+
cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
|
|
332605
|
+
const normalizedOrg = org.toLowerCase();
|
|
332606
|
+
if (claimRef) {
|
|
332607
|
+
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332608
|
+
if (seen.has(claimRef))
|
|
332609
|
+
continue;
|
|
332610
|
+
seen.add(claimRef);
|
|
332611
|
+
seenClaimRefs.set(normalizedOrg, seen);
|
|
332612
|
+
}
|
|
332613
|
+
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332614
|
+
refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
|
|
332615
|
+
refsByOrg.set(normalizedOrg, refs);
|
|
332616
|
+
}
|
|
332617
|
+
for (const [org, refs] of refsByOrg.entries()) {
|
|
332618
|
+
if (refs.length < 2)
|
|
332619
|
+
continue;
|
|
332620
|
+
throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332621
|
+
}
|
|
332622
|
+
}
|
|
332623
|
+
function validateActionsVariablesUniqueness(crs) {
|
|
332624
|
+
for (const crKey of Object.keys(crs)) {
|
|
332625
|
+
const cr = crs[crKey];
|
|
332626
|
+
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332627
|
+
continue;
|
|
332628
|
+
const actionsVariables = cr.spec?.actionsVariables;
|
|
332629
|
+
if (!Array.isArray(actionsVariables))
|
|
332630
|
+
continue;
|
|
332631
|
+
const names = new Set();
|
|
332632
|
+
for (const variable of actionsVariables) {
|
|
332633
|
+
const varName = variable?.name;
|
|
332634
|
+
if (!varName)
|
|
332635
|
+
continue;
|
|
332636
|
+
if (names.has(varName)) {
|
|
332637
|
+
const org = cr.spec?.org || 'unknown';
|
|
332638
|
+
throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
|
|
332639
|
+
}
|
|
332640
|
+
names.add(varName);
|
|
332641
|
+
}
|
|
332642
|
+
}
|
|
332643
|
+
}
|
|
332644
|
+
function validateActionsVariablesSelectedRepositories(renderClaims) {
|
|
332645
|
+
for (const claimKey of Object.keys(renderClaims)) {
|
|
332646
|
+
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
332647
|
+
continue;
|
|
332648
|
+
const claimData = renderClaims[claimKey];
|
|
332649
|
+
const claim = claimData?.claim;
|
|
332650
|
+
const actionsVariables = claim?.providers?.github?.actions_variables;
|
|
332651
|
+
if (!Array.isArray(actionsVariables))
|
|
332652
|
+
continue;
|
|
332653
|
+
for (const variable of actionsVariables) {
|
|
332654
|
+
if (variable.visibility !== 'selected')
|
|
332655
|
+
continue;
|
|
332656
|
+
const selectedRepos = variable.selected_repositories;
|
|
332657
|
+
if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
|
|
332658
|
+
continue;
|
|
332659
|
+
for (const ref of selectedRepos) {
|
|
332660
|
+
const match = ref.match(COMPONENT_REF_PATTERN);
|
|
332661
|
+
if (!match)
|
|
332662
|
+
continue;
|
|
332663
|
+
const componentName = match[1];
|
|
332664
|
+
const expectedKey = `ComponentClaim-${componentName}`;
|
|
332665
|
+
if (!renderClaims[expectedKey]) {
|
|
332666
|
+
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
|
|
332667
|
+
}
|
|
332668
|
+
}
|
|
332669
|
+
}
|
|
332670
|
+
}
|
|
332671
|
+
}
|
|
332672
|
+
|
|
332673
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgSecretSection.ts
|
|
332674
|
+
const GITHUB_ORG_SECRET_SECTION_KIND = 'FirestartrGithubOrganizationSecretSection';
|
|
332675
|
+
const githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332676
|
+
const githubOrgSecretSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332677
|
+
const SECRETS_CLAIM_REF_PATTERN = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
332678
|
+
function githubOrgSecretSection_formatResourceRef(name, claimRef) {
|
|
332679
|
+
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332680
|
+
}
|
|
332681
|
+
function validateGithubOrgSecretSectionSingleton(crs) {
|
|
332682
|
+
const refsByOrg = new Map();
|
|
332683
|
+
const seenClaimRefs = new Map();
|
|
332684
|
+
for (const crKey of Object.keys(crs)) {
|
|
332685
|
+
const cr = crs[crKey];
|
|
332686
|
+
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332687
|
+
continue;
|
|
332688
|
+
const org = cr.spec?.org;
|
|
332689
|
+
if (typeof org !== 'string' || !org)
|
|
332690
|
+
continue;
|
|
332691
|
+
const name = cr.metadata?.name || crKey;
|
|
332692
|
+
const claimRef = cr.metadata?.annotations?.[githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332693
|
+
cr.metadata?.labels?.[githubOrgSecretSection_CLAIM_REF_LABEL];
|
|
332694
|
+
const normalizedOrg = org.toLowerCase();
|
|
332695
|
+
if (claimRef) {
|
|
332696
|
+
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332697
|
+
if (seen.has(claimRef))
|
|
332698
|
+
continue;
|
|
332699
|
+
seen.add(claimRef);
|
|
332700
|
+
seenClaimRefs.set(normalizedOrg, seen);
|
|
332701
|
+
}
|
|
332702
|
+
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332703
|
+
refs.push(githubOrgSecretSection_formatResourceRef(name, claimRef));
|
|
332704
|
+
refsByOrg.set(normalizedOrg, refs);
|
|
332705
|
+
}
|
|
332706
|
+
for (const [org, refs] of refsByOrg.entries()) {
|
|
332707
|
+
if (refs.length < 2)
|
|
332708
|
+
continue;
|
|
332709
|
+
throw new Error(`Duplicate ${GITHUB_ORG_SECRET_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332710
|
+
}
|
|
332711
|
+
}
|
|
332712
|
+
function validateSecretNamesUniqueness(crs) {
|
|
332713
|
+
for (const crKey of Object.keys(crs)) {
|
|
332714
|
+
const cr = crs[crKey];
|
|
332715
|
+
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332716
|
+
continue;
|
|
332717
|
+
const secrets = cr.spec?.secrets;
|
|
332718
|
+
if (!secrets || typeof secrets !== 'object')
|
|
332719
|
+
continue;
|
|
332720
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332721
|
+
const sectionSecrets = secrets[section];
|
|
332722
|
+
if (!Array.isArray(sectionSecrets))
|
|
332723
|
+
continue;
|
|
332724
|
+
const names = new Set();
|
|
332725
|
+
for (const secret of sectionSecrets) {
|
|
332726
|
+
const secretName = secret?.name;
|
|
332727
|
+
if (!secretName)
|
|
332728
|
+
continue;
|
|
332729
|
+
if (names.has(secretName)) {
|
|
332730
|
+
const org = cr.spec?.org || 'unknown';
|
|
332731
|
+
throw new Error(`Duplicate secret name "${secretName}" found in ${section} section of ${GITHUB_ORG_SECRET_SECTION_KIND} for organization "${org}"`);
|
|
332732
|
+
}
|
|
332733
|
+
names.add(secretName);
|
|
332734
|
+
}
|
|
332735
|
+
}
|
|
332736
|
+
}
|
|
332737
|
+
}
|
|
332738
|
+
function validateOrgSecretsCrossReferences(renderClaims) {
|
|
332739
|
+
for (const claimKey of Object.keys(renderClaims)) {
|
|
332740
|
+
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
332741
|
+
continue;
|
|
332742
|
+
const claimData = renderClaims[claimKey];
|
|
332743
|
+
const claim = claimData?.claim;
|
|
332744
|
+
const orgSecrets = claim?.providers?.github?.org_secrets;
|
|
332745
|
+
if (!orgSecrets || typeof orgSecrets !== 'object')
|
|
332746
|
+
continue;
|
|
332747
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332748
|
+
const secrets = orgSecrets[section];
|
|
332749
|
+
if (!Array.isArray(secrets))
|
|
332750
|
+
continue;
|
|
332751
|
+
for (const secret of secrets) {
|
|
332752
|
+
if (!secret.value)
|
|
332753
|
+
continue;
|
|
332754
|
+
const match = secret.value.match(SECRETS_CLAIM_REF_PATTERN);
|
|
332755
|
+
if (!match)
|
|
332756
|
+
continue;
|
|
332757
|
+
const [, secretClaimName, secretKey] = match;
|
|
332758
|
+
const expectedKey = `SecretsClaim-${secretClaimName}`;
|
|
332759
|
+
if (!renderClaims[expectedKey])
|
|
332760
|
+
continue;
|
|
332761
|
+
const secretClaim = renderClaims[expectedKey]?.claim;
|
|
332762
|
+
const externalSecrets = secretClaim?.providers?.external_secrets?.externalSecrets?.secrets;
|
|
332763
|
+
const pushSecrets = secretClaim?.providers?.external_secrets?.pushSecrets;
|
|
332764
|
+
let keyFound = false;
|
|
332765
|
+
if (Array.isArray(pushSecrets)) {
|
|
332766
|
+
keyFound =
|
|
332767
|
+
pushSecrets.find((s) => s.secretName === secretKey) !==
|
|
332768
|
+
undefined;
|
|
332769
|
+
}
|
|
332770
|
+
if (!keyFound && Array.isArray(externalSecrets)) {
|
|
332771
|
+
keyFound =
|
|
332772
|
+
externalSecrets.find((s) => s.secretName === secretKey) !==
|
|
332773
|
+
undefined;
|
|
332774
|
+
}
|
|
332775
|
+
if (!keyFound) {
|
|
332776
|
+
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent secret key "${secretKey}" in SecretsClaim/${secretClaimName} via org_secrets.${section}.${secret.name}`);
|
|
332777
|
+
}
|
|
332778
|
+
}
|
|
332779
|
+
}
|
|
332780
|
+
}
|
|
332781
|
+
}
|
|
332782
|
+
|
|
331558
332783
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
|
|
331559
332784
|
|
|
331560
332785
|
|
|
@@ -331565,6 +332790,8 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
331565
332790
|
|
|
331566
332791
|
|
|
331567
332792
|
|
|
332793
|
+
|
|
332794
|
+
|
|
331568
332795
|
/*
|
|
331569
332796
|
* Function called when rendering but not importing
|
|
331570
332797
|
*
|
|
@@ -331586,8 +332813,14 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
|
|
|
331586
332813
|
try {
|
|
331587
332814
|
validateSubReferences(data.renderClaims);
|
|
331588
332815
|
validateComponentPagesPath(data.renderClaims);
|
|
332816
|
+
validateActionsVariablesSelectedRepositories(data.renderClaims);
|
|
332817
|
+
validateOrgSecretsCrossReferences(data.renderClaims);
|
|
331589
332818
|
validateTfStateKeyUniqueness(result);
|
|
331590
332819
|
validateGithubOrgSettingsSingleton(fullCrSet);
|
|
332820
|
+
validateGithubOrgVariableSectionSingleton(fullCrSet);
|
|
332821
|
+
validateActionsVariablesUniqueness(result);
|
|
332822
|
+
validateGithubOrgSecretSectionSingleton(fullCrSet);
|
|
332823
|
+
validateSecretNamesUniqueness(result);
|
|
331591
332824
|
validateCrSizes(result);
|
|
331592
332825
|
validatePermissionsUniqueness(result);
|
|
331593
332826
|
}
|
|
@@ -333919,6 +335152,7 @@ const kindPluralMap = {
|
|
|
333919
335152
|
terraformmodules: 'FirestartrTerraformModule',
|
|
333920
335153
|
githuborgwebhooks: 'FirestartrGithubOrgWebhook',
|
|
333921
335154
|
githuborganizationsettings: 'FirestartrGithubOrganizationSettings',
|
|
335155
|
+
githuborganizationvariablesections: 'FirestartrGithubOrganizationVariableSection',
|
|
333922
335156
|
terraformworkspaces: 'FirestartrTerraformWorkspace',
|
|
333923
335157
|
terraformworkspaceplans: 'FirestartrTerraformWorkspacePlan',
|
|
333924
335158
|
providerconfigs: 'FirestartrProviderConfig',
|
|
@@ -335896,6 +337130,7 @@ const kindsWithFinalizer = [
|
|
|
335896
337130
|
'FirestartrGithubRepositoryFeature',
|
|
335897
337131
|
'FirestartrGithubOrgWebhook',
|
|
335898
337132
|
'FirestartrGithubOrganizationSettings',
|
|
337133
|
+
'FirestartrGithubOrganizationVariableSection',
|
|
335899
337134
|
'FirestartrGithubRepositorySecretsSection',
|
|
335900
337135
|
];
|
|
335901
337136
|
const kindsWithDependants = [
|
|
@@ -342437,6 +343672,10 @@ const MODULES = {
|
|
|
342437
343672
|
// github-org-settings-v0.1.0
|
|
342438
343673
|
ref: 'c30c5dfdaddf2bca9e966a726d45970c98576e9e',
|
|
342439
343674
|
},
|
|
343675
|
+
FirestartrGithubOrganizationVariableSection: {
|
|
343676
|
+
module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-variables-section',
|
|
343677
|
+
ref: '79c1407',
|
|
343678
|
+
},
|
|
342440
343679
|
};
|
|
342441
343680
|
function getFirestartrDefaultTFM(kind) {
|
|
342442
343681
|
if (kind in MODULES) {
|
|
@@ -344239,6 +345478,94 @@ class EntityGHOrgSettings extends base_Entity {
|
|
|
344239
345478
|
}
|
|
344240
345479
|
}
|
|
344241
345480
|
|
|
345481
|
+
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgvarsection/index.ts
|
|
345482
|
+
|
|
345483
|
+
|
|
345484
|
+
|
|
345485
|
+
class EntityGHOrgVarsSection extends base_Entity {
|
|
345486
|
+
constructor(artifact) {
|
|
345487
|
+
super(artifact, {
|
|
345488
|
+
config: {
|
|
345489
|
+
variables: {},
|
|
345490
|
+
},
|
|
345491
|
+
});
|
|
345492
|
+
}
|
|
345493
|
+
async loadResources(tfOp) {
|
|
345494
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] running ${tfOp} on ${this.k8sId}`);
|
|
345495
|
+
try {
|
|
345496
|
+
const cr = this.cr;
|
|
345497
|
+
const actionsVariables = cr.spec.actionsVariables || [];
|
|
345498
|
+
const variables = {};
|
|
345499
|
+
for (const v of actionsVariables) {
|
|
345500
|
+
const entry = {
|
|
345501
|
+
value: v.value,
|
|
345502
|
+
visibility: v.visibility,
|
|
345503
|
+
};
|
|
345504
|
+
if (v.visibility === 'selected' && v.selectedRepositories) {
|
|
345505
|
+
entry.selectedRepositoryIds = v.selectedRepositories;
|
|
345506
|
+
}
|
|
345507
|
+
variables[v.name] = entry;
|
|
345508
|
+
}
|
|
345509
|
+
this.patchData({
|
|
345510
|
+
op: PatchOperations.replace,
|
|
345511
|
+
path: '/config/variables',
|
|
345512
|
+
value: variables,
|
|
345513
|
+
});
|
|
345514
|
+
if (tfOp === 'apply') {
|
|
345515
|
+
await this.adoptVariablesIfNeeded(actionsVariables);
|
|
345516
|
+
}
|
|
345517
|
+
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} loaded its data`);
|
|
345518
|
+
}
|
|
345519
|
+
catch (err) {
|
|
345520
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
345521
|
+
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345522
|
+
throw new Error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345523
|
+
}
|
|
345524
|
+
}
|
|
345525
|
+
async adoptVariablesIfNeeded(declaredVars) {
|
|
345526
|
+
const cr = this.cr;
|
|
345527
|
+
const managedVariables = this.cr.fResolveSelfOutputs('managed_variables') || [];
|
|
345528
|
+
const declaredNames = declaredVars.map((v) => v.name);
|
|
345529
|
+
const newToModule = declaredNames.filter((name) => !managedVariables.includes(name));
|
|
345530
|
+
if (newToModule.length === 0) {
|
|
345531
|
+
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} all declared variables are already managed, no adoption needed`);
|
|
345532
|
+
return;
|
|
345533
|
+
}
|
|
345534
|
+
if (managedVariables.length === 0) {
|
|
345535
|
+
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`);
|
|
345536
|
+
}
|
|
345537
|
+
for (const varName of newToModule) {
|
|
345538
|
+
try {
|
|
345539
|
+
await this.runWithGithubProvider(async () => {
|
|
345540
|
+
await github["default"].org.getOrgVariable(cr.spec.org, varName);
|
|
345541
|
+
});
|
|
345542
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} adopting pre-existing variable '${varName}' on GitHub org '${cr.spec.org}'`);
|
|
345543
|
+
this.patchImportData({
|
|
345544
|
+
op: PatchOperations.add,
|
|
345545
|
+
path: '/imports/-',
|
|
345546
|
+
value: {
|
|
345547
|
+
to: `github_actions_organization_variable.this["${varName}"]`,
|
|
345548
|
+
id: varName,
|
|
345549
|
+
},
|
|
345550
|
+
});
|
|
345551
|
+
}
|
|
345552
|
+
catch (err) {
|
|
345553
|
+
if (err && err.status === 404) {
|
|
345554
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} variable '${varName}' not found on GitHub org '${cr.spec.org}' — will be created by TFM`);
|
|
345555
|
+
}
|
|
345556
|
+
else if (err && (err.status === 401 || err.status === 403)) {
|
|
345557
|
+
gh_provisioner_src_logger.warn(`[gh-provisioner] ${this.k8sId} token lacks scope to check variable '${varName}' on org '${cr.spec.org}' — skipping adoption gracefully`);
|
|
345558
|
+
}
|
|
345559
|
+
else {
|
|
345560
|
+
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)}`);
|
|
345561
|
+
}
|
|
345562
|
+
}
|
|
345563
|
+
}
|
|
345564
|
+
}
|
|
345565
|
+
async postProvision(tfOp) { }
|
|
345566
|
+
async loadAddressesToImport() { }
|
|
345567
|
+
}
|
|
345568
|
+
|
|
344242
345569
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgwebhook/index.ts
|
|
344243
345570
|
|
|
344244
345571
|
|
|
@@ -344315,6 +345642,7 @@ class EntityGHOrgWebHook extends base_Entity {
|
|
|
344315
345642
|
|
|
344316
345643
|
|
|
344317
345644
|
|
|
345645
|
+
|
|
344318
345646
|
function entities_getEntity(cr) {
|
|
344319
345647
|
const entityClass = getEntityClass(cr.kind);
|
|
344320
345648
|
return new entityClass(cr);
|
|
@@ -344335,6 +345663,8 @@ function getEntityClass(kind) {
|
|
|
344335
345663
|
return EntityGHOrgWebHook;
|
|
344336
345664
|
case 'FirestartrGithubOrganizationSettings':
|
|
344337
345665
|
return EntityGHOrgSettings;
|
|
345666
|
+
case 'FirestartrGithubOrganizationVariableSection':
|
|
345667
|
+
return EntityGHOrgVarsSection;
|
|
344338
345668
|
default:
|
|
344339
345669
|
throw new Error(`kind ${kind} has no entity associated`);
|
|
344340
345670
|
}
|
|
@@ -344748,6 +346078,7 @@ const GITHUB_RESOURCE_KINDS = [
|
|
|
344748
346078
|
'FirestartrGithubRepositorySecretsSection',
|
|
344749
346079
|
'FirestartrGithubOrgWebhook',
|
|
344750
346080
|
'FirestartrGithubOrganizationSettings',
|
|
346081
|
+
'FirestartrGithubOrganizationVariableSection',
|
|
344751
346082
|
];
|
|
344752
346083
|
const GITHUB_REPOSITORY_DEPENDENT_KINDS = [
|
|
344753
346084
|
'FirestartrGithubRepositoryFeature',
|
|
@@ -346006,6 +347337,9 @@ function isObserveModeActive() {
|
|
|
346006
347337
|
function runOperator(opts) {
|
|
346007
347338
|
const { ignoreLease, dummyExec, namespace, kindList, importMode, importModeSkipPlan, observeMode, withMetrics, } = opts;
|
|
346008
347339
|
const implementedKinds = filterImplementedKinds(kindList);
|
|
347340
|
+
operator_src_logger.info(`operator kindList: ${JSON.stringify(kindList)}`);
|
|
347341
|
+
operator_src_logger.info(`operator implementedKinds: ${JSON.stringify(implementedKinds)}`);
|
|
347342
|
+
operator_src_logger.info(`operator ignoring kinds: ${JSON.stringify(kindList.filter((k) => !implementedKinds.includes(k)))}`);
|
|
346009
347343
|
if (observeMode)
|
|
346010
347344
|
observeModeActive = true;
|
|
346011
347345
|
if (withMetrics)
|
|
@@ -346079,6 +347413,7 @@ const provisionImplementations = {
|
|
|
346079
347413
|
githubmemberships: process_operation_processOperation,
|
|
346080
347414
|
githuborgwebhooks: process_operation_processOperation,
|
|
346081
347415
|
githuborganizationsettings: process_operation_processOperation,
|
|
347416
|
+
githuborganizationvariablesections: process_operation_processOperation,
|
|
346082
347417
|
fsdummiesa: processFirestartrDummies,
|
|
346083
347418
|
fsdummiesb: processFirestartrDummies,
|
|
346084
347419
|
fsdummiesc: processFirestartrDummies,
|
|
@@ -524897,7 +526232,7 @@ const crsStatusSubcommand = {
|
|
|
524897
526232
|
};
|
|
524898
526233
|
|
|
524899
526234
|
;// CONCATENATED MODULE: ./package.json
|
|
524900
|
-
const package_namespaceObject = {"i8":"2.
|
|
526235
|
+
const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-org-secrets-2"}');
|
|
524901
526236
|
;// CONCATENATED MODULE: ../../package.json
|
|
524902
526237
|
const package_namespaceObject_1 = {"i8":"2.9.0"};
|
|
524903
526238
|
// EXTERNAL MODULE: ../../node_modules/semver/index.js
|