@continuous-excellence/ze-great-dashboard-aws 0.9.2 → 0.11.0

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/README.md CHANGED
@@ -20,8 +20,13 @@ AWS to try it.
20
20
  - A consumer-owned gateway that can privately invoke Lambda and enforce your access policy.
21
21
 
22
22
  The included deployment works out of the box with public GitHub repositories and HTTP endpoints
23
- that do not require credentials. Private sources require a consumer-owned runtime integration; the
24
- stock template does not turn a Secrets Manager reference into `token_env` variables.
23
+ that do not require credentials. For private GitHub sources, `SecretReference` is the ARN of one
24
+ consumer-owned Secrets Manager JSON map (for example, `{"GITHUB_TOKEN":"github_pat_…"}`). The
25
+ runtime resolves configured `token_env` names only at Lambda cold start and never exposes token
26
+ values to the browser, API responses, logs, CloudFormation parameters, or Lambda environment.
27
+ This is the one added runtime dependency: AWS's Secrets Manager client supplies IAM-authenticated
28
+ `GetSecretValue` support in the bundled Lambda, at the cost of its bundled SDK code and a single
29
+ cold-start request when private sources are configured.
25
30
 
26
31
  ## Deployment map
27
32
 
@@ -73,7 +78,7 @@ Changing `board.yaml` or upgrading the pinned package uses this same path.
73
78
  | Board validation and Lambda packaging | Board content and source access |
74
79
  | Compatible immutable browser assets | The protected gateway and authentication |
75
80
  | Private application CloudFormation template | AWS account administration |
76
- | Restricted bootstrap templates | Secret values and runtime credential loading |
81
+ | Restricted bootstrap templates | Secret values and the credential-map ARN |
77
82
  | Read-only preflight and consistency checks | Reviewing and executing AWS changes |
78
83
 
79
84
  Bootstrap commands never execute mutating AWS operations. They produce plans, parameters, and
package/dist/cli.js CHANGED
@@ -810,10 +810,18 @@ async function validateBoardConfig(path) {
810
810
  throw new Error(`Invalid board configuration:
811
811
  ${z2.prettifyError(result.error)}`);
812
812
  const yaml = stringify(result.data, { sortMapEntries: true });
813
- return { yaml, sha256: sha256(yaml) };
813
+ return {
814
+ yaml,
815
+ sha256: sha256(yaml),
816
+ usesCredentials: Object.values(result.data.sources).some((source2) => Boolean(source2.token_env))
817
+ };
814
818
  }
815
819
  async function assembleRelease(input) {
816
820
  const board = await validateBoardConfig(input.boardConfigPath);
821
+ if (board.usesCredentials && !input.secretReference)
822
+ throw new Error(
823
+ "Board config uses token_env; SecretReference must name the Secrets Manager credential-map ARN"
824
+ );
817
825
  const outputDir = resolve(input.outputDir);
818
826
  await mkdir(outputDir, { recursive: true });
819
827
  await writeFile(join(outputDir, "board.yaml"), board.yaml);
@@ -2004,7 +2012,8 @@ async function packageLambda(options) {
2004
2012
  outputDir: runtimeDir,
2005
2013
  version: options.version,
2006
2014
  providers: ["aws-lambda"],
2007
- assetDomain: options.assetDomain
2015
+ assetDomain: options.assetDomain,
2016
+ secretReference: options.secretReference
2008
2017
  });
2009
2018
  const runtimeMetadata = {
2010
2019
  ...release.metadata,
@@ -2764,11 +2773,13 @@ ${plan.notes.join("\n")}`);
2764
2773
  await existingParameters(parametersPath),
2765
2774
  template
2766
2775
  );
2776
+ const secretReference = consumerParameters.SecretReference ?? String(template.definitions.SecretReference?.Default ?? "");
2767
2777
  const metadata = await packageLambda({
2768
2778
  boardConfigPath: boardConfig,
2769
2779
  outputDir,
2770
2780
  version,
2771
- assetDomain: option("--asset-domain")
2781
+ assetDomain: option("--asset-domain"),
2782
+ secretReference
2772
2783
  });
2773
2784
  const resolvedParameters = resolvedReleaseParameters(consumerParameters, template, {
2774
2785
  LambdaArtifactKey: metadata.artifactKey,
package/dist/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export type LambdaPackageOptions = {
20
20
  outputDir: string;
21
21
  version: string;
22
22
  assetDomain?: string;
23
+ /** ARN of the consumer-owned JSON credential-map secret, never a secret value. */
24
+ secretReference?: string;
23
25
  };
24
26
  export declare function packageLambda(options: LambdaPackageOptions): Promise<PackagedRelease>;
25
27
  export type PublishClientAssetsOptions = {
package/dist/index.js CHANGED
@@ -797,10 +797,18 @@ async function validateBoardConfig(path) {
797
797
  throw new Error(`Invalid board configuration:
798
798
  ${z2.prettifyError(result.error)}`);
799
799
  const yaml = stringify(result.data, { sortMapEntries: true });
800
- return { yaml, sha256: sha256(yaml) };
800
+ return {
801
+ yaml,
802
+ sha256: sha256(yaml),
803
+ usesCredentials: Object.values(result.data.sources).some((source2) => Boolean(source2.token_env))
804
+ };
801
805
  }
802
806
  async function assembleRelease(input) {
803
807
  const board = await validateBoardConfig(input.boardConfigPath);
808
+ if (board.usesCredentials && !input.secretReference)
809
+ throw new Error(
810
+ "Board config uses token_env; SecretReference must name the Secrets Manager credential-map ARN"
811
+ );
804
812
  const outputDir = resolve(input.outputDir);
805
813
  await mkdir(outputDir, { recursive: true });
806
814
  await writeFile(join(outputDir, "board.yaml"), board.yaml);
@@ -1991,7 +1999,8 @@ async function packageLambda(options) {
1991
1999
  outputDir: runtimeDir,
1992
2000
  version: options.version,
1993
2001
  providers: ["aws-lambda"],
1994
- assetDomain: options.assetDomain
2002
+ assetDomain: options.assetDomain,
2003
+ secretReference: options.secretReference
1995
2004
  });
1996
2005
  const runtimeMetadata = {
1997
2006
  ...release.metadata,