@firestartr/cli 2.10.0-snapshot-force-rebuild-refs-2 → 2.10.0-snapshot-org-secrets-ref-fix-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 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 uuid = previousCR?.spec?.firestartr?.tfStateKey ||
319526
- claim.providers?.[ctx.provider]?.tfStateKey ||
319527
- (0,wrapper.v4)();
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,50 @@ 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
+ const match = secret.value.match(secretRefRegex);
322113
+ if (match) {
322114
+ refs.push(`SecretsClaim-${match[1]}`);
322115
+ }
322116
+ }
322117
+ if (Array.isArray(secret.selected_repositories)) {
322118
+ for (const repoRef of secret.selected_repositories) {
322119
+ const compMatch = repoRef.match(/^component:(.+)$/);
322120
+ if (compMatch) {
322121
+ refs.push(`ComponentClaim-${compMatch[1]}`);
322122
+ }
322123
+ }
322124
+ }
322125
+ }
322126
+ }
322127
+ }
322128
+ break;
322129
+ }
322064
322130
  }
322065
322131
  logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
322066
322132
  return [...new Set(refs)];
@@ -323187,6 +323253,73 @@ const organizationSettingsProperties = {
323187
323253
  secret_scanning_push_protection_enabled_for_new_repositories: {
323188
323254
  type: 'boolean',
323189
323255
  },
323256
+ actions_variables: {
323257
+ type: 'array',
323258
+ items: {
323259
+ type: 'object',
323260
+ properties: {
323261
+ name: {
323262
+ type: 'string',
323263
+ pattern: '^[A-Za-z0-9_]+$',
323264
+ },
323265
+ value: {
323266
+ type: 'string',
323267
+ },
323268
+ visibility: {
323269
+ type: 'string',
323270
+ enum: ['all', 'private', 'selected'],
323271
+ },
323272
+ selected_repositories: {
323273
+ type: 'array',
323274
+ items: {
323275
+ $ref: 'firestartr.dev://common/FirestartrComponentRef',
323276
+ },
323277
+ },
323278
+ },
323279
+ required: ['name', 'value', 'visibility'],
323280
+ additionalProperties: false,
323281
+ allOf: [
323282
+ {
323283
+ if: {
323284
+ properties: {
323285
+ visibility: { const: 'selected' },
323286
+ },
323287
+ required: ['visibility'],
323288
+ },
323289
+ then: {},
323290
+ else: {
323291
+ properties: {
323292
+ selected_repositories: { type: 'array', maxItems: 0 },
323293
+ },
323294
+ },
323295
+ },
323296
+ ],
323297
+ },
323298
+ },
323299
+ org_secrets: {
323300
+ type: 'object',
323301
+ properties: {
323302
+ actions: {
323303
+ type: 'array',
323304
+ items: {
323305
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323306
+ },
323307
+ },
323308
+ codespaces: {
323309
+ type: 'array',
323310
+ items: {
323311
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323312
+ },
323313
+ },
323314
+ dependabot: {
323315
+ type: 'array',
323316
+ items: {
323317
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323318
+ },
323319
+ },
323320
+ },
323321
+ additionalProperties: false,
323322
+ },
323190
323323
  };
323191
323324
  /* harmony default export */ const github_orgsettings_schema = ({
323192
323325
  $schema: SCHEMA,
@@ -323374,6 +323507,75 @@ const organizationSettingsProperties = {
323374
323507
  },
323375
323508
  });
323376
323509
 
323510
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/orgSecrets.schema.ts
323511
+
323512
+ /* harmony default export */ const orgSecrets_schema = ({
323513
+ $schema: SCHEMA,
323514
+ $id: 'GithubOrgClaimSecrets',
323515
+ definitions: {
323516
+ GithubOrgClaimSecrets: {
323517
+ $id: 'firestartr.dev://github/GithubOrgClaimSecrets',
323518
+ type: 'object',
323519
+ description: 'Organization-level GitHub Actions secrets',
323520
+ properties: {
323521
+ actions: {
323522
+ type: 'array',
323523
+ items: {
323524
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323525
+ },
323526
+ },
323527
+ codespaces: {
323528
+ type: 'array',
323529
+ items: {
323530
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323531
+ },
323532
+ },
323533
+ dependabot: {
323534
+ type: 'array',
323535
+ items: {
323536
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecret',
323537
+ },
323538
+ },
323539
+ },
323540
+ additionalProperties: false,
323541
+ },
323542
+ GithubOrgClaimSecretRef: {
323543
+ $id: 'firestartr.dev://github/GithubOrgClaimSecretRef',
323544
+ type: 'string',
323545
+ description: 'the reference of the secret',
323546
+ pattern: '^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
323547
+ },
323548
+ GithubOrgClaimSecret: {
323549
+ $id: 'firestartr.dev://github/GithubOrgClaimSecret',
323550
+ type: 'object',
323551
+ description: 'An organization-level secret for GitHub Actions',
323552
+ properties: {
323553
+ name: {
323554
+ type: 'string',
323555
+ description: 'the name of the secret',
323556
+ },
323557
+ value: {
323558
+ $ref: 'firestartr.dev://github/GithubOrgClaimSecretRef',
323559
+ },
323560
+ visibility: {
323561
+ type: 'string',
323562
+ enum: ['all', 'selected', 'private'],
323563
+ description: 'which repositories can access the secret',
323564
+ },
323565
+ selected_repositories: {
323566
+ type: 'array',
323567
+ items: {
323568
+ type: 'string',
323569
+ },
323570
+ description: 'list of repository refs when visibility is selected',
323571
+ },
323572
+ },
323573
+ required: ['name', 'value'],
323574
+ additionalProperties: false,
323575
+ },
323576
+ },
323577
+ });
323578
+
323377
323579
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
323378
323580
 
323379
323581
 
@@ -323383,6 +323585,7 @@ const organizationSettingsProperties = {
323383
323585
 
323384
323586
 
323385
323587
 
323588
+
323386
323589
  const GithubSchemas = [
323387
323590
  github_group_schema,
323388
323591
  github_user_schema,
@@ -323392,6 +323595,7 @@ const GithubSchemas = [
323392
323595
  github_orgsettings_schema,
323393
323596
  component_secrets_vars_schema,
323394
323597
  component_labels_schema,
323598
+ orgSecrets_schema,
323395
323599
  ];
323396
323600
 
323397
323601
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
@@ -326538,7 +326742,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
326538
326742
  function isVariantCR(cr) {
326539
326743
  return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
326540
326744
  }
326541
- function getPreviousCRfromClaim(claim, previousCRs) {
326745
+ function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
326542
326746
  const previousCRsKeys = Object.keys(previousCRs);
326543
326747
  const isVariantClaim = !!claim._parentClaimName;
326544
326748
  for (const previousCRKey of previousCRsKeys) {
@@ -326547,6 +326751,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
326547
326751
  continue;
326548
326752
  if (isExcludedFromPreviousCR(previousCR.kind))
326549
326753
  continue;
326754
+ if (expectedKind && previousCR.kind !== expectedKind)
326755
+ continue;
326550
326756
  const crVariant = isVariantCR(previousCR);
326551
326757
  if (isVariantClaim && !crVariant)
326552
326758
  continue;
@@ -327303,6 +327509,412 @@ var FirestartrGithubMembershipSpecContextProviderRefKind;
327303
327509
  /** FirestartrProviderConfig */
327304
327510
  FirestartrGithubMembershipSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
327305
327511
  })(FirestartrGithubMembershipSpecContextProviderRefKind || (FirestartrGithubMembershipSpecContextProviderRefKind = {}));
327512
+ /**
327513
+ * A resource to handle GitHub Organization Actions Secrets.
327514
+ *
327515
+ * @schema FirestartrGithubOrganizationSecretSection
327516
+ */
327517
+ class FirestartrGithubOrganizationSecretSection extends lib.ApiObject {
327518
+ /**
327519
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationSecretSection".
327520
+ *
327521
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
327522
+ *
327523
+ * @param props initialization props
327524
+ */
327525
+ static manifest(props) {
327526
+ return {
327527
+ ...FirestartrGithubOrganizationSecretSection.GVK,
327528
+ ...toJson_FirestartrGithubOrganizationSecretSectionProps(props),
327529
+ };
327530
+ }
327531
+ /**
327532
+ * Defines a "FirestartrGithubOrganizationSecretSection" API object
327533
+ * @param scope the scope in which to define this object
327534
+ * @param id a scope-local name for the object
327535
+ * @param props initialization props
327536
+ */
327537
+ constructor(scope, id, props) {
327538
+ super(scope, id, {
327539
+ ...FirestartrGithubOrganizationSecretSection.GVK,
327540
+ ...props,
327541
+ });
327542
+ }
327543
+ /**
327544
+ * Renders the object to Kubernetes JSON.
327545
+ */
327546
+ toJson() {
327547
+ const resolved = super.toJson();
327548
+ return {
327549
+ ...FirestartrGithubOrganizationSecretSection.GVK,
327550
+ ...toJson_FirestartrGithubOrganizationSecretSectionProps(resolved),
327551
+ };
327552
+ }
327553
+ }
327554
+ /**
327555
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationSecretSection"
327556
+ */
327557
+ FirestartrGithubOrganizationSecretSection.GVK = {
327558
+ apiVersion: 'firestartr.dev/v1',
327559
+ kind: 'FirestartrGithubOrganizationSecretSection',
327560
+ };
327561
+
327562
+ /**
327563
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionProps' to JSON representation.
327564
+ */
327565
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327566
+ function toJson_FirestartrGithubOrganizationSecretSectionProps(obj) {
327567
+ if (obj === undefined) {
327568
+ return undefined;
327569
+ }
327570
+ const result = {
327571
+ 'metadata': obj.metadata,
327572
+ 'spec': toJson_FirestartrGithubOrganizationSecretSectionSpec(obj.spec),
327573
+ };
327574
+ // filter undefined values
327575
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327576
+ }
327577
+ /**
327578
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpec' to JSON representation.
327579
+ */
327580
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327581
+ function toJson_FirestartrGithubOrganizationSecretSectionSpec(obj) {
327582
+ if (obj === undefined) {
327583
+ return undefined;
327584
+ }
327585
+ const result = {
327586
+ 'org': obj.org,
327587
+ 'secrets': toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj.secrets),
327588
+ 'context': toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj.context),
327589
+ 'firestartr': toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj.firestartr),
327590
+ 'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
327591
+ };
327592
+ // filter undefined values
327593
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327594
+ }
327595
+ /**
327596
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecrets' to JSON representation.
327597
+ */
327598
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327599
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj) {
327600
+ if (obj === undefined) {
327601
+ return undefined;
327602
+ }
327603
+ const result = {
327604
+ 'actions': obj.actions?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(y)),
327605
+ 'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(y)),
327606
+ 'dependabot': obj.dependabot?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(y)),
327607
+ };
327608
+ // filter undefined values
327609
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327610
+ }
327611
+ /**
327612
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContext' to JSON representation.
327613
+ */
327614
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327615
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj) {
327616
+ if (obj === undefined) {
327617
+ return undefined;
327618
+ }
327619
+ const result = {
327620
+ 'backend': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj.backend),
327621
+ 'provider': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj.provider),
327622
+ };
327623
+ // filter undefined values
327624
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327625
+ }
327626
+ /**
327627
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecFirestartr' to JSON representation.
327628
+ */
327629
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327630
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj) {
327631
+ if (obj === undefined) {
327632
+ return undefined;
327633
+ }
327634
+ const result = {
327635
+ 'tfStateKey': obj.tfStateKey,
327636
+ };
327637
+ // filter undefined values
327638
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327639
+ }
327640
+ /**
327641
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef' to JSON representation.
327642
+ */
327643
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327644
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj) {
327645
+ if (obj === undefined) {
327646
+ return undefined;
327647
+ }
327648
+ const result = {
327649
+ 'name': obj.name,
327650
+ 'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(y)),
327651
+ };
327652
+ // filter undefined values
327653
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327654
+ }
327655
+ /**
327656
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActions' to JSON representation.
327657
+ */
327658
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327659
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(obj) {
327660
+ if (obj === undefined) {
327661
+ return undefined;
327662
+ }
327663
+ const result = {
327664
+ 'name': obj.name,
327665
+ 'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj.ref),
327666
+ 'visibility': obj.visibility,
327667
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
327668
+ };
327669
+ // filter undefined values
327670
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327671
+ }
327672
+ /**
327673
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces' to JSON representation.
327674
+ */
327675
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327676
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(obj) {
327677
+ if (obj === undefined) {
327678
+ return undefined;
327679
+ }
327680
+ const result = {
327681
+ 'name': obj.name,
327682
+ 'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj.ref),
327683
+ 'visibility': obj.visibility,
327684
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
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 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot' to JSON representation.
327691
+ */
327692
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327693
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(obj) {
327694
+ if (obj === undefined) {
327695
+ return undefined;
327696
+ }
327697
+ const result = {
327698
+ 'name': obj.name,
327699
+ 'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj.ref),
327700
+ 'visibility': obj.visibility,
327701
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
327702
+ };
327703
+ // filter undefined values
327704
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327705
+ }
327706
+ /**
327707
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackend' to JSON representation.
327708
+ */
327709
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327710
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj) {
327711
+ if (obj === undefined) {
327712
+ return undefined;
327713
+ }
327714
+ const result = {
327715
+ 'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj.ref),
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 'FirestartrGithubOrganizationSecretSectionSpecContextProvider' to JSON representation.
327722
+ */
327723
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327724
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj) {
327725
+ if (obj === undefined) {
327726
+ return undefined;
327727
+ }
327728
+ const result = {
327729
+ 'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj.ref),
327730
+ };
327731
+ // filter undefined values
327732
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327733
+ }
327734
+ /**
327735
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
327736
+ */
327737
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327738
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(obj) {
327739
+ if (obj === undefined) {
327740
+ return undefined;
327741
+ }
327742
+ const result = {
327743
+ 'key': obj.key,
327744
+ };
327745
+ // filter undefined values
327746
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327747
+ }
327748
+ /**
327749
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef' to JSON representation.
327750
+ */
327751
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327752
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj) {
327753
+ if (obj === undefined) {
327754
+ return undefined;
327755
+ }
327756
+ const result = {
327757
+ 'kind': obj.kind,
327758
+ 'name': obj.name,
327759
+ 'key': obj.key,
327760
+ };
327761
+ // filter undefined values
327762
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327763
+ }
327764
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327765
+ /**
327766
+ * Which repositories can access the secret.
327767
+ *
327768
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility
327769
+ */
327770
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility;
327771
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility) {
327772
+ /** all */
327773
+ FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["ALL"] = "all";
327774
+ /** selected */
327775
+ FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["SELECTED"] = "selected";
327776
+ /** private */
327777
+ FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility["PRIVATE"] = "private";
327778
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsVisibility = {}));
327779
+ /**
327780
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef' to JSON representation.
327781
+ */
327782
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327783
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj) {
327784
+ if (obj === undefined) {
327785
+ return undefined;
327786
+ }
327787
+ const result = {
327788
+ 'kind': obj.kind,
327789
+ 'name': obj.name,
327790
+ 'key': obj.key,
327791
+ };
327792
+ // filter undefined values
327793
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327794
+ }
327795
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327796
+ /**
327797
+ * Which repositories can access the secret.
327798
+ *
327799
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility
327800
+ */
327801
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility;
327802
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility) {
327803
+ /** all */
327804
+ FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["ALL"] = "all";
327805
+ /** selected */
327806
+ FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["SELECTED"] = "selected";
327807
+ /** private */
327808
+ FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility["PRIVATE"] = "private";
327809
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesVisibility = {}));
327810
+ /**
327811
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef' to JSON representation.
327812
+ */
327813
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327814
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj) {
327815
+ if (obj === undefined) {
327816
+ return undefined;
327817
+ }
327818
+ const result = {
327819
+ 'kind': obj.kind,
327820
+ 'name': obj.name,
327821
+ 'key': obj.key,
327822
+ };
327823
+ // filter undefined values
327824
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327825
+ }
327826
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327827
+ /**
327828
+ * Which repositories can access the secret.
327829
+ *
327830
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility
327831
+ */
327832
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility;
327833
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility) {
327834
+ /** all */
327835
+ FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["ALL"] = "all";
327836
+ /** selected */
327837
+ FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["SELECTED"] = "selected";
327838
+ /** private */
327839
+ FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility["PRIVATE"] = "private";
327840
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotVisibility = {}));
327841
+ /**
327842
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackendRef' to JSON representation.
327843
+ */
327844
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327845
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj) {
327846
+ if (obj === undefined) {
327847
+ return undefined;
327848
+ }
327849
+ const result = {
327850
+ 'kind': obj.kind,
327851
+ 'name': obj.name,
327852
+ };
327853
+ // filter undefined values
327854
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327855
+ }
327856
+ /**
327857
+ * Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProviderRef' to JSON representation.
327858
+ */
327859
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327860
+ function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj) {
327861
+ if (obj === undefined) {
327862
+ return undefined;
327863
+ }
327864
+ const result = {
327865
+ 'kind': obj.kind,
327866
+ 'name': obj.name,
327867
+ };
327868
+ // filter undefined values
327869
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
327870
+ }
327871
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
327872
+ /**
327873
+ * The type of Kubernetes resource to reference.
327874
+ *
327875
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind
327876
+ */
327877
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind;
327878
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind) {
327879
+ /** Secret */
327880
+ FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind["SECRET"] = "Secret";
327881
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind = {}));
327882
+ /**
327883
+ * The type of Kubernetes resource to reference.
327884
+ *
327885
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind
327886
+ */
327887
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind;
327888
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind) {
327889
+ /** Secret */
327890
+ FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind["SECRET"] = "Secret";
327891
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind = {}));
327892
+ /**
327893
+ * The type of Kubernetes resource to reference.
327894
+ *
327895
+ * @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind
327896
+ */
327897
+ var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind;
327898
+ (function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind) {
327899
+ /** Secret */
327900
+ FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind["SECRET"] = "Secret";
327901
+ })(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind = {}));
327902
+ /**
327903
+ * @schema FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind
327904
+ */
327905
+ var FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind;
327906
+ (function (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind) {
327907
+ /** FirestartrProviderConfig */
327908
+ FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
327909
+ })(FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind = {}));
327910
+ /**
327911
+ * @schema FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind
327912
+ */
327913
+ var FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind;
327914
+ (function (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind) {
327915
+ /** FirestartrProviderConfig */
327916
+ FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
327917
+ })(FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind = {}));
327306
327918
  /**
327307
327919
  * A resource to handle GitHub Organization Settings.
327308
327920
  *
@@ -327561,6 +328173,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
327561
328173
  /** FirestartrProviderConfig */
327562
328174
  FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
327563
328175
  })(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
328176
+ /**
328177
+ * A resource to handle GitHub Organization Actions Variables.
328178
+ *
328179
+ * @schema FirestartrGithubOrganizationVariableSection
328180
+ */
328181
+ class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
328182
+ /**
328183
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
328184
+ *
328185
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
328186
+ *
328187
+ * @param props initialization props
328188
+ */
328189
+ static manifest(props) {
328190
+ return {
328191
+ ...FirestartrGithubOrganizationVariableSection.GVK,
328192
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
328193
+ };
328194
+ }
328195
+ /**
328196
+ * Defines a "FirestartrGithubOrganizationVariableSection" API object
328197
+ * @param scope the scope in which to define this object
328198
+ * @param id a scope-local name for the object
328199
+ * @param props initialization props
328200
+ */
328201
+ constructor(scope, id, props) {
328202
+ super(scope, id, {
328203
+ ...FirestartrGithubOrganizationVariableSection.GVK,
328204
+ ...props,
328205
+ });
328206
+ }
328207
+ /**
328208
+ * Renders the object to Kubernetes JSON.
328209
+ */
328210
+ toJson() {
328211
+ const resolved = super.toJson();
328212
+ return {
328213
+ ...FirestartrGithubOrganizationVariableSection.GVK,
328214
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
328215
+ };
328216
+ }
328217
+ }
328218
+ /**
328219
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
328220
+ */
328221
+ FirestartrGithubOrganizationVariableSection.GVK = {
328222
+ apiVersion: 'firestartr.dev/v1',
328223
+ kind: 'FirestartrGithubOrganizationVariableSection',
328224
+ };
328225
+
328226
+ /**
328227
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
328228
+ */
328229
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328230
+ function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
328231
+ if (obj === undefined) {
328232
+ return undefined;
328233
+ }
328234
+ const result = {
328235
+ 'metadata': obj.metadata,
328236
+ 'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
328237
+ };
328238
+ // filter undefined values
328239
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328240
+ }
328241
+ /**
328242
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
328243
+ */
328244
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328245
+ function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
328246
+ if (obj === undefined) {
328247
+ return undefined;
328248
+ }
328249
+ const result = {
328250
+ 'org': obj.org,
328251
+ 'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
328252
+ 'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
328253
+ 'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
328254
+ 'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
328255
+ };
328256
+ // filter undefined values
328257
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328258
+ }
328259
+ /**
328260
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
328261
+ */
328262
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328263
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
328264
+ if (obj === undefined) {
328265
+ return undefined;
328266
+ }
328267
+ const result = {
328268
+ 'name': obj.name,
328269
+ 'value': obj.value,
328270
+ 'visibility': obj.visibility,
328271
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
328272
+ };
328273
+ // filter undefined values
328274
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328275
+ }
328276
+ /**
328277
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
328278
+ */
328279
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328280
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
328281
+ if (obj === undefined) {
328282
+ return undefined;
328283
+ }
328284
+ const result = {
328285
+ 'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
328286
+ 'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
328287
+ };
328288
+ // filter undefined values
328289
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328290
+ }
328291
+ /**
328292
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
328293
+ */
328294
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328295
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
328296
+ if (obj === undefined) {
328297
+ return undefined;
328298
+ }
328299
+ const result = {
328300
+ 'tfStateKey': obj.tfStateKey,
328301
+ };
328302
+ // filter undefined values
328303
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328304
+ }
328305
+ /**
328306
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
328307
+ */
328308
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328309
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
328310
+ if (obj === undefined) {
328311
+ return undefined;
328312
+ }
328313
+ const result = {
328314
+ 'name': obj.name,
328315
+ 'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
328316
+ };
328317
+ // filter undefined values
328318
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328319
+ }
328320
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328321
+ /**
328322
+ * Visibility of the variable
328323
+ *
328324
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
328325
+ */
328326
+ var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
328327
+ (function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
328328
+ /** all */
328329
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
328330
+ /** private */
328331
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
328332
+ /** selected */
328333
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
328334
+ })(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
328335
+ /**
328336
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
328337
+ */
328338
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328339
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
328340
+ if (obj === undefined) {
328341
+ return undefined;
328342
+ }
328343
+ const result = {
328344
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
328345
+ };
328346
+ // filter undefined values
328347
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328348
+ }
328349
+ /**
328350
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
328351
+ */
328352
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328353
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
328354
+ if (obj === undefined) {
328355
+ return undefined;
328356
+ }
328357
+ const result = {
328358
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
328359
+ };
328360
+ // filter undefined values
328361
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328362
+ }
328363
+ /**
328364
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
328365
+ */
328366
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328367
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
328368
+ if (obj === undefined) {
328369
+ return undefined;
328370
+ }
328371
+ const result = {
328372
+ 'key': obj.key,
328373
+ };
328374
+ // filter undefined values
328375
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328376
+ }
328377
+ /**
328378
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
328379
+ */
328380
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328381
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
328382
+ if (obj === undefined) {
328383
+ return undefined;
328384
+ }
328385
+ const result = {
328386
+ 'kind': obj.kind,
328387
+ 'name': obj.name,
328388
+ };
328389
+ // filter undefined values
328390
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328391
+ }
328392
+ /**
328393
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
328394
+ */
328395
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328396
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
328397
+ if (obj === undefined) {
328398
+ return undefined;
328399
+ }
328400
+ const result = {
328401
+ 'kind': obj.kind,
328402
+ 'name': obj.name,
328403
+ };
328404
+ // filter undefined values
328405
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
328406
+ }
328407
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
328408
+ /**
328409
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
328410
+ */
328411
+ var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
328412
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
328413
+ /** FirestartrProviderConfig */
328414
+ FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
328415
+ })(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
328416
+ /**
328417
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
328418
+ */
328419
+ var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
328420
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
328421
+ /** FirestartrProviderConfig */
328422
+ FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
328423
+ })(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
327564
328424
  /**
327565
328425
  * A resource to handle GitHub Organization Webhooks
327566
328426
  *
@@ -330410,6 +331270,122 @@ class GithubOrgSettingsChart extends BaseGithubChart {
330410
331270
  }
330411
331271
  }
330412
331272
 
331273
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
331274
+
331275
+
331276
+
331277
+ class GithubOrgVariableSectionChart extends BaseGithubChart {
331278
+ template() {
331279
+ const claim = this.get('claim');
331280
+ const firestartrId = this.get('firestartrId');
331281
+ const githubProvider = claim.providers.github;
331282
+ const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
331283
+ const entry = {
331284
+ name: v.name,
331285
+ value: v.value,
331286
+ visibility: v.visibility,
331287
+ };
331288
+ if (v.selected_repositories && v.selected_repositories.length > 0) {
331289
+ entry.selectedRepositories = v.selected_repositories.map((ref) => {
331290
+ const match = ref.match(/^component:(.+)$/);
331291
+ if (!match) {
331292
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
331293
+ }
331294
+ const componentName = match[1];
331295
+ const resolvedCr = this.refResolver('ComponentClaim', componentName);
331296
+ const org = resolvedCr?.spec?.org;
331297
+ const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
331298
+ if (!org || !repoName) {
331299
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
331300
+ }
331301
+ return `${org}/${repoName}`;
331302
+ });
331303
+ }
331304
+ return entry;
331305
+ });
331306
+ const template = {
331307
+ metadata: {
331308
+ name: githubProvider.name,
331309
+ },
331310
+ spec: {
331311
+ org: githubProvider.org,
331312
+ actionsVariables,
331313
+ firestartr: {
331314
+ tfStateKey: firestartrId,
331315
+ },
331316
+ writeConnectionSecretToRef: {
331317
+ name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
331318
+ outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
331319
+ },
331320
+ },
331321
+ };
331322
+ return JSON.parse(JSON.stringify(template));
331323
+ }
331324
+ gvk() {
331325
+ return FirestartrGithubOrganizationVariableSection.GVK;
331326
+ }
331327
+ instanceApiObject(template) {
331328
+ return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
331329
+ }
331330
+ }
331331
+
331332
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgSecretSectionChart.ts
331333
+
331334
+
331335
+ class GithubOrgSecretSectionChart extends BaseGithubChart {
331336
+ template() {
331337
+ const claim = this.get('claim');
331338
+ const firestartrId = this.get('firestartrId');
331339
+ const githubProvider = claim.providers.github;
331340
+ const orgSecrets = githubProvider.org_secrets || {};
331341
+ const renderSecrets = (section) => {
331342
+ const secrets = orgSecrets[section];
331343
+ if (!Array.isArray(secrets))
331344
+ return [];
331345
+ return secrets.map((secret) => {
331346
+ const parts = secret.value.split(':');
331347
+ return {
331348
+ name: secret.name,
331349
+ ref: {
331350
+ kind: 'Secret',
331351
+ name: parts[2],
331352
+ key: parts[3],
331353
+ },
331354
+ visibility: secret.visibility || 'all',
331355
+ selectedRepositories: secret.selected_repositories || [],
331356
+ };
331357
+ });
331358
+ };
331359
+ const template = {
331360
+ metadata: {
331361
+ name: `${githubProvider.name}-secrets`,
331362
+ },
331363
+ spec: {
331364
+ org: githubProvider.org,
331365
+ secrets: {
331366
+ actions: renderSecrets('actions'),
331367
+ codespaces: renderSecrets('codespaces'),
331368
+ dependabot: renderSecrets('dependabot'),
331369
+ },
331370
+ firestartr: {
331371
+ tfStateKey: firestartrId ? `${firestartrId}-secrets` : firestartrId,
331372
+ },
331373
+ writeConnectionSecretToRef: {
331374
+ name: `firestartrgithuborganizationsecretsection-${githubProvider.name}-outputs`.toLowerCase(),
331375
+ outputs: [{ key: 'managed_secrets' }, { key: 'secret_ids' }],
331376
+ },
331377
+ },
331378
+ };
331379
+ return JSON.parse(JSON.stringify(template));
331380
+ }
331381
+ gvk() {
331382
+ return FirestartrGithubOrganizationSecretSection.GVK;
331383
+ }
331384
+ instanceApiObject(template) {
331385
+ return new FirestartrGithubOrganizationSecretSection(this, template.metadata.name, template);
331386
+ }
331387
+ }
331388
+
330413
331389
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
330414
331390
 
330415
331391
 
@@ -330417,6 +331393,8 @@ class GithubOrgSettingsChart extends BaseGithubChart {
330417
331393
 
330418
331394
 
330419
331395
 
331396
+
331397
+
330420
331398
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
330421
331399
 
330422
331400
  class BaseCatalogChart extends BaseChart {
@@ -331164,6 +332142,8 @@ class SecretsChart extends BaseSecretsChart {
331164
332142
  SecretsChart: SecretsChart,
331165
332143
  GithubOrgWebhookChart: GithubOrgWebhookChart,
331166
332144
  GithubOrgSettingsChart: GithubOrgSettingsChart,
332145
+ GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
332146
+ GithubOrgSecretSectionChart: GithubOrgSecretSectionChart,
331167
332147
  });
331168
332148
 
331169
332149
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
@@ -331208,13 +332188,28 @@ async function renderClaims(catalogScope, firestartrScope, data) {
331208
332188
  if (configuredProvider !== AllowedProviders.all.toString()) {
331209
332189
  providers = providers.filter((provider) => provider === configuredProvider);
331210
332190
  }
331211
- const previousCR = getPreviousCRfromClaim(claim, crs);
332191
+ const expectedKind = claim.kind === 'OrgSettingsClaim'
332192
+ ? 'FirestartrGithubOrganizationSettings'
332193
+ : undefined;
332194
+ const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
332195
+ const variableSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
332196
+ ? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-variable-section` }, crs, 'FirestartrGithubOrganizationVariableSection')
332197
+ : false;
332198
+ const secretSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
332199
+ ? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-secret-section` }, crs, 'FirestartrGithubOrganizationSecretSection')
332200
+ : false;
331212
332201
  const patches = await extractPatches(renderClaims[claimKey], previousCR);
332202
+ let variableSectionPatches = undefined;
332203
+ let secretSectionPatches = undefined;
332204
+ if (claim.kind === 'OrgSettingsClaim') {
332205
+ variableSectionPatches = await extractPatches(renderClaims[claimKey], variableSectionPreviousCR);
332206
+ secretSectionPatches = await extractPatches(renderClaims[claimKey], secretSectionPreviousCR);
332207
+ }
331213
332208
  if (!previousCR) {
331214
332209
  logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
331215
332210
  }
331216
332211
  const claimPath = renderClaims[claimKey].claimPath;
331217
- const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath);
332212
+ const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath, variableSectionPreviousCR, variableSectionPatches, secretSectionPreviousCR, secretSectionPatches);
331218
332213
  if (catalogEntity) {
331219
332214
  result[`${catalogEntity.kind}-${catalogEntity.metadata.name}`] =
331220
332215
  catalogEntity.toJson();
@@ -331243,7 +332238,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
331243
332238
  }
331244
332239
  return result;
331245
332240
  }
331246
- async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath) {
332241
+ async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath, variableSectionPreviousCR = false, variableSectionPatches, secretSectionPreviousCR = false, secretSectionPatches) {
331247
332242
  let catalogEntity = undefined;
331248
332243
  let firestartrEntity = undefined;
331249
332244
  const extraCharts = [];
@@ -331391,6 +332386,48 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
331391
332386
  case 'OrgSettingsClaim':
331392
332387
  if (loadGithub) {
331393
332388
  firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
332389
+ const variableSectionFirestartrId = variableSectionPreviousCR
332390
+ ? variableSectionPreviousCR.spec?.firestartr?.tfStateKey
332391
+ : firestartrId
332392
+ ? `${firestartrId}-variables`
332393
+ : null;
332394
+ const vsRenderPatches = variableSectionPatches
332395
+ ? variableSectionPatches.filter((patch) => !patch.isPostPatch)
332396
+ : renderPatches;
332397
+ const vsPostPatches = variableSectionPatches
332398
+ ? variableSectionPatches.filter((patch) => patch.isPostPatch)
332399
+ : postPatches;
332400
+ const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, vsRenderPatches);
332401
+ await variableSectionChart.render();
332402
+ const variableSectionObject = await variableSectionChart.postRenderer(vsPostPatches);
332403
+ extraCharts.push({
332404
+ claim: {
332405
+ kind: claim.kind,
332406
+ name: `${claim.name}-variable-section`,
332407
+ },
332408
+ chart: variableSectionObject,
332409
+ });
332410
+ const secretSectionFirestartrId = secretSectionPreviousCR
332411
+ ? secretSectionPreviousCR.spec?.firestartr?.tfStateKey
332412
+ : firestartrId
332413
+ ? `${firestartrId}-secrets`
332414
+ : null;
332415
+ const ssRenderPatches = secretSectionPatches
332416
+ ? secretSectionPatches.filter((patch) => !patch.isPostPatch)
332417
+ : renderPatches;
332418
+ const ssPostPatches = secretSectionPatches
332419
+ ? secretSectionPatches.filter((patch) => patch.isPostPatch)
332420
+ : postPatches;
332421
+ const secretSectionChart = new charts.GithubOrgSecretSectionChart(firestartrScope, `github-secrets-${chartId}`, secretSectionFirestartrId, claim, ssRenderPatches);
332422
+ await secretSectionChart.render();
332423
+ const secretSectionObject = await secretSectionChart.postRenderer(ssPostPatches);
332424
+ extraCharts.push({
332425
+ claim: {
332426
+ kind: claim.kind,
332427
+ name: `${claim.name}-secret-section`,
332428
+ },
332429
+ chart: secretSectionObject,
332430
+ });
331394
332431
  }
331395
332432
  break;
331396
332433
  default:
@@ -331450,12 +332487,16 @@ function renameVariantCrFiles(outputDir, renderedMap) {
331450
332487
 
331451
332488
  const IS_COMPONENT_CLAIM_REF = new RegExp(/^ComponentClaim-/);
331452
332489
  const IS_TF_WORKSPACE = new RegExp(/^TFWorkspaceClaim-/);
332490
+ const IS_ORG_SETTINGS_CLAIM = new RegExp(/^OrgSettingsClaim-/);
332491
+ const COMPONENT_REF_PATTERN = /^component:(.+)$/;
331453
332492
  function validateSubReferences(renderClaims) {
331454
332493
  for (const ref of Object.keys(renderClaims)) {
331455
332494
  if (IS_COMPONENT_CLAIM_REF.test(ref))
331456
332495
  validateClaimsSecretsRefs(ref, renderClaims);
331457
332496
  else if (IS_TF_WORKSPACE.test(ref))
331458
332497
  validateTFClaimsSecretsRefs(ref, renderClaims);
332498
+ else if (IS_ORG_SETTINGS_CLAIM.test(ref))
332499
+ validateOrgSettingsComponentRefs(ref, renderClaims);
331459
332500
  }
331460
332501
  }
331461
332502
  function validateTFClaimsSecretsRefs(ref, renderClaims) {
@@ -331507,6 +332548,57 @@ function searchSecretKey(secretClaim, key) {
331507
332548
  }
331508
332549
  return found;
331509
332550
  }
332551
+ function validateOrgSettingsComponentRefs(ref, renderClaims) {
332552
+ const claim = renderClaims[ref].claim;
332553
+ validateOrgSecretsSelectedRepositories(claim, renderClaims);
332554
+ validateActionsVariablesSelectedRepositories(claim, renderClaims);
332555
+ }
332556
+ function validateOrgSecretsSelectedRepositories(claim, renderClaims) {
332557
+ const orgSecrets = claim?.providers?.github?.org_secrets;
332558
+ if (!orgSecrets || typeof orgSecrets !== 'object')
332559
+ return;
332560
+ for (const section of ['actions', 'codespaces', 'dependabot']) {
332561
+ const secrets = orgSecrets[section];
332562
+ if (!Array.isArray(secrets))
332563
+ continue;
332564
+ for (const secret of secrets) {
332565
+ if (!secret.selected_repositories)
332566
+ continue;
332567
+ for (const repoRef of secret.selected_repositories) {
332568
+ const match = repoRef.match(COMPONENT_REF_PATTERN);
332569
+ if (!match)
332570
+ continue;
332571
+ const [, componentName] = match;
332572
+ const expectedKey = `ComponentClaim-${componentName}`;
332573
+ if (!renderClaims[expectedKey]) {
332574
+ throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in org_secrets.${section}.${secret.name}.selected_repositories`);
332575
+ }
332576
+ }
332577
+ }
332578
+ }
332579
+ }
332580
+ function validateActionsVariablesSelectedRepositories(claim, renderClaims) {
332581
+ const actionsVariables = claim?.providers?.github?.actions_variables;
332582
+ if (!Array.isArray(actionsVariables))
332583
+ return;
332584
+ for (const variable of actionsVariables) {
332585
+ if (variable.visibility !== 'selected')
332586
+ continue;
332587
+ const selectedRepos = variable.selected_repositories;
332588
+ if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
332589
+ continue;
332590
+ for (const ref of selectedRepos) {
332591
+ const match = ref.match(COMPONENT_REF_PATTERN);
332592
+ if (!match)
332593
+ continue;
332594
+ const componentName = match[1];
332595
+ const expectedKey = `ComponentClaim-${componentName}`;
332596
+ if (!renderClaims[expectedKey]) {
332597
+ throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
332598
+ }
332599
+ }
332600
+ }
332601
+ }
331510
332602
 
331511
332603
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/componentPagesPath.ts
331512
332604
  /**
@@ -331555,6 +332647,176 @@ function validateGithubOrgSettingsSingleton(crs) {
331555
332647
  }
331556
332648
  }
331557
332649
 
332650
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
332651
+ const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
332652
+ const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
332653
+ const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
332654
+ function githubOrgVariableSection_formatResourceRef(name, claimRef) {
332655
+ return claimRef ? `${name} (claim: ${claimRef})` : name;
332656
+ }
332657
+ function validateGithubOrgVariableSectionSingleton(crs) {
332658
+ const refsByOrg = new Map();
332659
+ const seenClaimRefs = new Map();
332660
+ for (const crKey of Object.keys(crs)) {
332661
+ const cr = crs[crKey];
332662
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
332663
+ continue;
332664
+ const org = cr.spec?.org;
332665
+ if (typeof org !== 'string' || !org)
332666
+ continue;
332667
+ const name = cr.metadata?.name || crKey;
332668
+ const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
332669
+ cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
332670
+ const normalizedOrg = org.toLowerCase();
332671
+ if (claimRef) {
332672
+ const seen = seenClaimRefs.get(normalizedOrg) || new Set();
332673
+ if (seen.has(claimRef))
332674
+ continue;
332675
+ seen.add(claimRef);
332676
+ seenClaimRefs.set(normalizedOrg, seen);
332677
+ }
332678
+ const refs = refsByOrg.get(normalizedOrg) || [];
332679
+ refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
332680
+ refsByOrg.set(normalizedOrg, refs);
332681
+ }
332682
+ for (const [org, refs] of refsByOrg.entries()) {
332683
+ if (refs.length < 2)
332684
+ continue;
332685
+ throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
332686
+ }
332687
+ }
332688
+ function validateActionsVariablesUniqueness(crs) {
332689
+ for (const crKey of Object.keys(crs)) {
332690
+ const cr = crs[crKey];
332691
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
332692
+ continue;
332693
+ const actionsVariables = cr.spec?.actionsVariables;
332694
+ if (!Array.isArray(actionsVariables))
332695
+ continue;
332696
+ const names = new Set();
332697
+ for (const variable of actionsVariables) {
332698
+ const varName = variable?.name;
332699
+ if (!varName)
332700
+ continue;
332701
+ if (names.has(varName)) {
332702
+ const org = cr.spec?.org || 'unknown';
332703
+ throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
332704
+ }
332705
+ names.add(varName);
332706
+ }
332707
+ }
332708
+ }
332709
+
332710
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgSecretSection.ts
332711
+ const GITHUB_ORG_SECRET_SECTION_KIND = 'FirestartrGithubOrganizationSecretSection';
332712
+ const githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
332713
+ const githubOrgSecretSection_CLAIM_REF_LABEL = 'claim-ref';
332714
+ const SECRETS_CLAIM_REF_PATTERN = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
332715
+ function githubOrgSecretSection_formatResourceRef(name, claimRef) {
332716
+ return claimRef ? `${name} (claim: ${claimRef})` : name;
332717
+ }
332718
+ function validateGithubOrgSecretSectionSingleton(crs) {
332719
+ const refsByOrg = new Map();
332720
+ const seenClaimRefs = new Map();
332721
+ for (const crKey of Object.keys(crs)) {
332722
+ const cr = crs[crKey];
332723
+ if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
332724
+ continue;
332725
+ const org = cr.spec?.org;
332726
+ if (typeof org !== 'string' || !org)
332727
+ continue;
332728
+ const name = cr.metadata?.name || crKey;
332729
+ const claimRef = cr.metadata?.annotations?.[githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
332730
+ cr.metadata?.labels?.[githubOrgSecretSection_CLAIM_REF_LABEL];
332731
+ const normalizedOrg = org.toLowerCase();
332732
+ if (claimRef) {
332733
+ const seen = seenClaimRefs.get(normalizedOrg) || new Set();
332734
+ if (seen.has(claimRef))
332735
+ continue;
332736
+ seen.add(claimRef);
332737
+ seenClaimRefs.set(normalizedOrg, seen);
332738
+ }
332739
+ const refs = refsByOrg.get(normalizedOrg) || [];
332740
+ refs.push(githubOrgSecretSection_formatResourceRef(name, claimRef));
332741
+ refsByOrg.set(normalizedOrg, refs);
332742
+ }
332743
+ for (const [org, refs] of refsByOrg.entries()) {
332744
+ if (refs.length < 2)
332745
+ continue;
332746
+ throw new Error(`Duplicate ${GITHUB_ORG_SECRET_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
332747
+ }
332748
+ }
332749
+ function validateSecretNamesUniqueness(crs) {
332750
+ for (const crKey of Object.keys(crs)) {
332751
+ const cr = crs[crKey];
332752
+ if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
332753
+ continue;
332754
+ const secrets = cr.spec?.secrets;
332755
+ if (!secrets || typeof secrets !== 'object')
332756
+ continue;
332757
+ for (const section of ['actions', 'codespaces', 'dependabot']) {
332758
+ const sectionSecrets = secrets[section];
332759
+ if (!Array.isArray(sectionSecrets))
332760
+ continue;
332761
+ const names = new Set();
332762
+ for (const secret of sectionSecrets) {
332763
+ const secretName = secret?.name;
332764
+ if (!secretName)
332765
+ continue;
332766
+ if (names.has(secretName)) {
332767
+ const org = cr.spec?.org || 'unknown';
332768
+ throw new Error(`Duplicate secret name "${secretName}" found in ${section} section of ${GITHUB_ORG_SECRET_SECTION_KIND} for organization "${org}"`);
332769
+ }
332770
+ names.add(secretName);
332771
+ }
332772
+ }
332773
+ }
332774
+ }
332775
+ function validateOrgSecretsCrossReferences(renderClaims) {
332776
+ for (const claimKey of Object.keys(renderClaims)) {
332777
+ if (!claimKey.startsWith('OrgSettingsClaim-'))
332778
+ continue;
332779
+ const claimData = renderClaims[claimKey];
332780
+ const claim = claimData?.claim;
332781
+ const orgSecrets = claim?.providers?.github?.org_secrets;
332782
+ if (!orgSecrets || typeof orgSecrets !== 'object')
332783
+ continue;
332784
+ for (const section of ['actions', 'codespaces', 'dependabot']) {
332785
+ const secrets = orgSecrets[section];
332786
+ if (!Array.isArray(secrets))
332787
+ continue;
332788
+ for (const secret of secrets) {
332789
+ if (!secret.value)
332790
+ continue;
332791
+ const match = secret.value.match(SECRETS_CLAIM_REF_PATTERN);
332792
+ if (!match)
332793
+ continue;
332794
+ const [, secretClaimName, secretKey] = match;
332795
+ const expectedKey = `SecretsClaim-${secretClaimName}`;
332796
+ if (!renderClaims[expectedKey])
332797
+ continue;
332798
+ const secretClaim = renderClaims[expectedKey]?.claim;
332799
+ const externalSecrets = secretClaim?.providers?.external_secrets?.externalSecrets?.secrets;
332800
+ const pushSecrets = secretClaim?.providers?.external_secrets?.pushSecrets;
332801
+ let keyFound = false;
332802
+ if (Array.isArray(pushSecrets)) {
332803
+ keyFound =
332804
+ pushSecrets.find((s) => s.secretName === secretKey) !==
332805
+ undefined;
332806
+ }
332807
+ if (!keyFound && Array.isArray(externalSecrets)) {
332808
+ keyFound =
332809
+ externalSecrets.find((s) => s.secretName === secretKey) !==
332810
+ undefined;
332811
+ }
332812
+ if (!keyFound) {
332813
+ throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent secret key "${secretKey}" in SecretsClaim/${secretClaimName} via org_secrets.${section}.${secret.name}`);
332814
+ }
332815
+ }
332816
+ }
332817
+ }
332818
+ }
332819
+
331558
332820
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
331559
332821
 
331560
332822
 
@@ -331565,6 +332827,8 @@ function validateGithubOrgSettingsSingleton(crs) {
331565
332827
 
331566
332828
 
331567
332829
 
332830
+
332831
+
331568
332832
  /*
331569
332833
  * Function called when rendering but not importing
331570
332834
  *
@@ -331586,8 +332850,13 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
331586
332850
  try {
331587
332851
  validateSubReferences(data.renderClaims);
331588
332852
  validateComponentPagesPath(data.renderClaims);
332853
+ validateOrgSecretsCrossReferences(data.renderClaims);
331589
332854
  validateTfStateKeyUniqueness(result);
331590
332855
  validateGithubOrgSettingsSingleton(fullCrSet);
332856
+ validateGithubOrgVariableSectionSingleton(fullCrSet);
332857
+ validateActionsVariablesUniqueness(result);
332858
+ validateGithubOrgSecretSectionSingleton(fullCrSet);
332859
+ validateSecretNamesUniqueness(result);
331591
332860
  validateCrSizes(result);
331592
332861
  validatePermissionsUniqueness(result);
331593
332862
  }
@@ -333919,6 +335188,7 @@ const kindPluralMap = {
333919
335188
  terraformmodules: 'FirestartrTerraformModule',
333920
335189
  githuborgwebhooks: 'FirestartrGithubOrgWebhook',
333921
335190
  githuborganizationsettings: 'FirestartrGithubOrganizationSettings',
335191
+ githuborganizationvariablesections: 'FirestartrGithubOrganizationVariableSection',
333922
335192
  terraformworkspaces: 'FirestartrTerraformWorkspace',
333923
335193
  terraformworkspaceplans: 'FirestartrTerraformWorkspacePlan',
333924
335194
  providerconfigs: 'FirestartrProviderConfig',
@@ -335896,6 +337166,7 @@ const kindsWithFinalizer = [
335896
337166
  'FirestartrGithubRepositoryFeature',
335897
337167
  'FirestartrGithubOrgWebhook',
335898
337168
  'FirestartrGithubOrganizationSettings',
337169
+ 'FirestartrGithubOrganizationVariableSection',
335899
337170
  'FirestartrGithubRepositorySecretsSection',
335900
337171
  ];
335901
337172
  const kindsWithDependants = [
@@ -342437,6 +343708,10 @@ const MODULES = {
342437
343708
  // github-org-settings-v0.1.0
342438
343709
  ref: 'c30c5dfdaddf2bca9e966a726d45970c98576e9e',
342439
343710
  },
343711
+ FirestartrGithubOrganizationVariableSection: {
343712
+ module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-variables-section',
343713
+ ref: '79c1407',
343714
+ },
342440
343715
  };
342441
343716
  function getFirestartrDefaultTFM(kind) {
342442
343717
  if (kind in MODULES) {
@@ -344239,6 +345514,94 @@ class EntityGHOrgSettings extends base_Entity {
344239
345514
  }
344240
345515
  }
344241
345516
 
345517
+ ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgvarsection/index.ts
345518
+
345519
+
345520
+
345521
+ class EntityGHOrgVarsSection extends base_Entity {
345522
+ constructor(artifact) {
345523
+ super(artifact, {
345524
+ config: {
345525
+ variables: {},
345526
+ },
345527
+ });
345528
+ }
345529
+ async loadResources(tfOp) {
345530
+ gh_provisioner_src_logger.info(`[gh-provisioner] running ${tfOp} on ${this.k8sId}`);
345531
+ try {
345532
+ const cr = this.cr;
345533
+ const actionsVariables = cr.spec.actionsVariables || [];
345534
+ const variables = {};
345535
+ for (const v of actionsVariables) {
345536
+ const entry = {
345537
+ value: v.value,
345538
+ visibility: v.visibility,
345539
+ };
345540
+ if (v.visibility === 'selected' && v.selectedRepositories) {
345541
+ entry.selectedRepositoryIds = v.selectedRepositories;
345542
+ }
345543
+ variables[v.name] = entry;
345544
+ }
345545
+ this.patchData({
345546
+ op: PatchOperations.replace,
345547
+ path: '/config/variables',
345548
+ value: variables,
345549
+ });
345550
+ if (tfOp === 'apply') {
345551
+ await this.adoptVariablesIfNeeded(actionsVariables);
345552
+ }
345553
+ gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} loaded its data`);
345554
+ }
345555
+ catch (err) {
345556
+ const message = err instanceof Error ? err.message : String(err);
345557
+ gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
345558
+ throw new Error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
345559
+ }
345560
+ }
345561
+ async adoptVariablesIfNeeded(declaredVars) {
345562
+ const cr = this.cr;
345563
+ const managedVariables = this.cr.fResolveSelfOutputs('managed_variables') || [];
345564
+ const declaredNames = declaredVars.map((v) => v.name);
345565
+ const newToModule = declaredNames.filter((name) => !managedVariables.includes(name));
345566
+ if (newToModule.length === 0) {
345567
+ gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} all declared variables are already managed, no adoption needed`);
345568
+ return;
345569
+ }
345570
+ if (managedVariables.length === 0) {
345571
+ 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`);
345572
+ }
345573
+ for (const varName of newToModule) {
345574
+ try {
345575
+ await this.runWithGithubProvider(async () => {
345576
+ await github["default"].org.getOrgVariable(cr.spec.org, varName);
345577
+ });
345578
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} adopting pre-existing variable '${varName}' on GitHub org '${cr.spec.org}'`);
345579
+ this.patchImportData({
345580
+ op: PatchOperations.add,
345581
+ path: '/imports/-',
345582
+ value: {
345583
+ to: `github_actions_organization_variable.this["${varName}"]`,
345584
+ id: varName,
345585
+ },
345586
+ });
345587
+ }
345588
+ catch (err) {
345589
+ if (err && err.status === 404) {
345590
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} variable '${varName}' not found on GitHub org '${cr.spec.org}' — will be created by TFM`);
345591
+ }
345592
+ else if (err && (err.status === 401 || err.status === 403)) {
345593
+ gh_provisioner_src_logger.warn(`[gh-provisioner] ${this.k8sId} token lacks scope to check variable '${varName}' on org '${cr.spec.org}' — skipping adoption gracefully`);
345594
+ }
345595
+ else {
345596
+ 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)}`);
345597
+ }
345598
+ }
345599
+ }
345600
+ }
345601
+ async postProvision(tfOp) { }
345602
+ async loadAddressesToImport() { }
345603
+ }
345604
+
344242
345605
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgwebhook/index.ts
344243
345606
 
344244
345607
 
@@ -344315,6 +345678,7 @@ class EntityGHOrgWebHook extends base_Entity {
344315
345678
 
344316
345679
 
344317
345680
 
345681
+
344318
345682
  function entities_getEntity(cr) {
344319
345683
  const entityClass = getEntityClass(cr.kind);
344320
345684
  return new entityClass(cr);
@@ -344335,6 +345699,8 @@ function getEntityClass(kind) {
344335
345699
  return EntityGHOrgWebHook;
344336
345700
  case 'FirestartrGithubOrganizationSettings':
344337
345701
  return EntityGHOrgSettings;
345702
+ case 'FirestartrGithubOrganizationVariableSection':
345703
+ return EntityGHOrgVarsSection;
344338
345704
  default:
344339
345705
  throw new Error(`kind ${kind} has no entity associated`);
344340
345706
  }
@@ -344748,6 +346114,7 @@ const GITHUB_RESOURCE_KINDS = [
344748
346114
  'FirestartrGithubRepositorySecretsSection',
344749
346115
  'FirestartrGithubOrgWebhook',
344750
346116
  'FirestartrGithubOrganizationSettings',
346117
+ 'FirestartrGithubOrganizationVariableSection',
344751
346118
  ];
344752
346119
  const GITHUB_REPOSITORY_DEPENDENT_KINDS = [
344753
346120
  'FirestartrGithubRepositoryFeature',
@@ -346006,6 +347373,9 @@ function isObserveModeActive() {
346006
347373
  function runOperator(opts) {
346007
347374
  const { ignoreLease, dummyExec, namespace, kindList, importMode, importModeSkipPlan, observeMode, withMetrics, } = opts;
346008
347375
  const implementedKinds = filterImplementedKinds(kindList);
347376
+ operator_src_logger.info(`operator kindList: ${JSON.stringify(kindList)}`);
347377
+ operator_src_logger.info(`operator implementedKinds: ${JSON.stringify(implementedKinds)}`);
347378
+ operator_src_logger.info(`operator ignoring kinds: ${JSON.stringify(kindList.filter((k) => !implementedKinds.includes(k)))}`);
346009
347379
  if (observeMode)
346010
347380
  observeModeActive = true;
346011
347381
  if (withMetrics)
@@ -346079,6 +347449,7 @@ const provisionImplementations = {
346079
347449
  githubmemberships: process_operation_processOperation,
346080
347450
  githuborgwebhooks: process_operation_processOperation,
346081
347451
  githuborganizationsettings: process_operation_processOperation,
347452
+ githuborganizationvariablesections: process_operation_processOperation,
346082
347453
  fsdummiesa: processFirestartrDummies,
346083
347454
  fsdummiesb: processFirestartrDummies,
346084
347455
  fsdummiesc: processFirestartrDummies,
@@ -524897,7 +526268,7 @@ const crsStatusSubcommand = {
524897
526268
  };
524898
526269
 
524899
526270
  ;// CONCATENATED MODULE: ./package.json
524900
- const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-force-rebuild-refs-2"}');
526271
+ const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-org-secrets-ref-fix-1"}');
524901
526272
  ;// CONCATENATED MODULE: ../../package.json
524902
526273
  const package_namespaceObject_1 = {"i8":"2.9.0"};
524903
526274
  // EXTERNAL MODULE: ../../node_modules/semver/index.js