@intentius/terragucci 0.4.45 → 0.4.46

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.
@@ -638,13 +638,13 @@
638
638
  "anyOf": [
639
639
  {
640
640
  "type": "string",
641
- "pattern": "^(?:git-tags$|oci://[^/]+/.)"
641
+ "pattern": "^(?:git-tags$|oci://[^/]+/.|gitlab$|gitlab://[^/\\s]+/[^/\\s?#]+/[^\\s?#]+$|hcp://(?:[^/\\s]+\\.[^/\\s]+/)?[A-Za-z0-9_-]+$|(?:artifactory|nexus)://[^/\\s]+/[A-Za-z0-9._-]+(?:/[A-Za-z0-9_-]+)?$)"
642
642
  },
643
643
  {
644
644
  "type": "array",
645
645
  "items": {
646
646
  "type": "string",
647
- "pattern": "^(?:git-tags$|oci://[^/]+/.)"
647
+ "pattern": "^(?:git-tags$|oci://[^/]+/.|gitlab$|gitlab://[^/\\s]+/[^/\\s?#]+/[^\\s?#]+$|hcp://(?:[^/\\s]+\\.[^/\\s]+/)?[A-Za-z0-9_-]+$|(?:artifactory|nexus)://[^/\\s]+/[A-Za-z0-9._-]+(?:/[A-Za-z0-9_-]+)?$)"
648
648
  }
649
649
  }
650
650
  ]
@@ -669,6 +669,10 @@
669
669
  "require": {
670
670
  "const": "attested"
671
671
  },
672
+ "gitlab_token": {
673
+ "type": "string",
674
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
675
+ },
672
676
  "trusted": {
673
677
  "type": "array",
674
678
  "items": {
@@ -743,6 +747,46 @@
743
747
  "git-tags",
744
748
  "oci"
745
749
  ]
750
+ },
751
+ "edge": {
752
+ "enum": [
753
+ "cloudflare",
754
+ "cloudfront",
755
+ "pages",
756
+ "none"
757
+ ]
758
+ },
759
+ "auth": {
760
+ "enum": [
761
+ "off",
762
+ "token"
763
+ ]
764
+ },
765
+ "tokens": {
766
+ "enum": [
767
+ "zip",
768
+ "ssm",
769
+ "secrets-manager"
770
+ ]
771
+ },
772
+ "tokens_name": {
773
+ "type": "string",
774
+ "minLength": 1
775
+ },
776
+ "tokens_region": {
777
+ "type": "string",
778
+ "pattern": "^[a-z]{2}(-[a-z]+)+-\\d$"
779
+ },
780
+ "providers": {
781
+ "enum": [
782
+ "mirror"
783
+ ]
784
+ },
785
+ "catalog": {
786
+ "enum": [
787
+ "on",
788
+ "off"
789
+ ]
746
790
  }
747
791
  },
748
792
  "additionalProperties": false,
@@ -1154,12 +1198,67 @@
1154
1198
  "type": "string",
1155
1199
  "pattern": "^[^\\s,;'\"]+$"
1156
1200
  }
1201
+ },
1202
+ "proxies": {
1203
+ "type": "array",
1204
+ "minItems": 1,
1205
+ "items": {
1206
+ "type": "object",
1207
+ "properties": {
1208
+ "artifactory": {
1209
+ "type": "string",
1210
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
1211
+ },
1212
+ "nexus": {
1213
+ "type": "string",
1214
+ "pattern": "^https?://[^/\\s]+/?$"
1215
+ },
1216
+ "repo": {
1217
+ "type": "string",
1218
+ "pattern": "^[A-Za-z0-9._-]+$"
1219
+ },
1220
+ "upstream": {
1221
+ "type": "string",
1222
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
1223
+ },
1224
+ "host": {
1225
+ "type": "string",
1226
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
1227
+ }
1228
+ },
1229
+ "additionalProperties": false,
1230
+ "required": [
1231
+ "repo"
1232
+ ],
1233
+ "oneOf": [
1234
+ {
1235
+ "required": [
1236
+ "artifactory"
1237
+ ]
1238
+ },
1239
+ {
1240
+ "required": [
1241
+ "nexus"
1242
+ ]
1243
+ }
1244
+ ]
1245
+ }
1157
1246
  }
1158
1247
  },
1159
1248
  "additionalProperties": false,
1160
1249
  "minProperties": 1,
1161
1250
  "description": "Globs of the module sources and provider addresses a root may use, checked before init."
1162
1251
  },
1252
+ "check": {
1253
+ "type": "object",
1254
+ "properties": {
1255
+ "pre_commit": {
1256
+ "type": "boolean"
1257
+ }
1258
+ },
1259
+ "additionalProperties": false,
1260
+ "description": "What tf-check runs beyond its own checks: the repo's pre-commit hooks."
1261
+ },
1163
1262
  "atlantis_comments": {
1164
1263
  "type": "boolean",
1165
1264
  "description": "Read atlantis plan and atlantis apply comments as terragucci's."
@@ -2463,13 +2562,13 @@
2463
2562
  "anyOf": [
2464
2563
  {
2465
2564
  "type": "string",
2466
- "pattern": "^(?:git-tags$|oci://[^/]+/.)"
2565
+ "pattern": "^(?:git-tags$|oci://[^/]+/.|gitlab$|gitlab://[^/\\s]+/[^/\\s?#]+/[^\\s?#]+$|hcp://(?:[^/\\s]+\\.[^/\\s]+/)?[A-Za-z0-9_-]+$|(?:artifactory|nexus)://[^/\\s]+/[A-Za-z0-9._-]+(?:/[A-Za-z0-9_-]+)?$)"
2467
2566
  },
2468
2567
  {
2469
2568
  "type": "array",
2470
2569
  "items": {
2471
2570
  "type": "string",
2472
- "pattern": "^(?:git-tags$|oci://[^/]+/.)"
2571
+ "pattern": "^(?:git-tags$|oci://[^/]+/.|gitlab$|gitlab://[^/\\s]+/[^/\\s?#]+/[^\\s?#]+$|hcp://(?:[^/\\s]+\\.[^/\\s]+/)?[A-Za-z0-9_-]+$|(?:artifactory|nexus)://[^/\\s]+/[A-Za-z0-9._-]+(?:/[A-Za-z0-9_-]+)?$)"
2473
2572
  }
2474
2573
  }
2475
2574
  ]
@@ -2494,6 +2593,10 @@
2494
2593
  "require": {
2495
2594
  "const": "attested"
2496
2595
  },
2596
+ "gitlab_token": {
2597
+ "type": "string",
2598
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
2599
+ },
2497
2600
  "trusted": {
2498
2601
  "type": "array",
2499
2602
  "items": {
@@ -2568,6 +2671,46 @@
2568
2671
  "git-tags",
2569
2672
  "oci"
2570
2673
  ]
2674
+ },
2675
+ "edge": {
2676
+ "enum": [
2677
+ "cloudflare",
2678
+ "cloudfront",
2679
+ "pages",
2680
+ "none"
2681
+ ]
2682
+ },
2683
+ "auth": {
2684
+ "enum": [
2685
+ "off",
2686
+ "token"
2687
+ ]
2688
+ },
2689
+ "tokens": {
2690
+ "enum": [
2691
+ "zip",
2692
+ "ssm",
2693
+ "secrets-manager"
2694
+ ]
2695
+ },
2696
+ "tokens_name": {
2697
+ "type": "string",
2698
+ "minLength": 1
2699
+ },
2700
+ "tokens_region": {
2701
+ "type": "string",
2702
+ "pattern": "^[a-z]{2}(-[a-z]+)+-\\d$"
2703
+ },
2704
+ "providers": {
2705
+ "enum": [
2706
+ "mirror"
2707
+ ]
2708
+ },
2709
+ "catalog": {
2710
+ "enum": [
2711
+ "on",
2712
+ "off"
2713
+ ]
2571
2714
  }
2572
2715
  },
2573
2716
  "additionalProperties": false,
@@ -2979,12 +3122,67 @@
2979
3122
  "type": "string",
2980
3123
  "pattern": "^[^\\s,;'\"]+$"
2981
3124
  }
3125
+ },
3126
+ "proxies": {
3127
+ "type": "array",
3128
+ "minItems": 1,
3129
+ "items": {
3130
+ "type": "object",
3131
+ "properties": {
3132
+ "artifactory": {
3133
+ "type": "string",
3134
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
3135
+ },
3136
+ "nexus": {
3137
+ "type": "string",
3138
+ "pattern": "^https?://[^/\\s]+/?$"
3139
+ },
3140
+ "repo": {
3141
+ "type": "string",
3142
+ "pattern": "^[A-Za-z0-9._-]+$"
3143
+ },
3144
+ "upstream": {
3145
+ "type": "string",
3146
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
3147
+ },
3148
+ "host": {
3149
+ "type": "string",
3150
+ "pattern": "^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(:\\d+)?$"
3151
+ }
3152
+ },
3153
+ "additionalProperties": false,
3154
+ "required": [
3155
+ "repo"
3156
+ ],
3157
+ "oneOf": [
3158
+ {
3159
+ "required": [
3160
+ "artifactory"
3161
+ ]
3162
+ },
3163
+ {
3164
+ "required": [
3165
+ "nexus"
3166
+ ]
3167
+ }
3168
+ ]
3169
+ }
2982
3170
  }
2983
3171
  },
2984
3172
  "additionalProperties": false,
2985
3173
  "minProperties": 1,
2986
3174
  "description": "Globs of the module sources and provider addresses a root may use, checked before init."
2987
3175
  },
3176
+ "check": {
3177
+ "type": "object",
3178
+ "properties": {
3179
+ "pre_commit": {
3180
+ "type": "boolean"
3181
+ }
3182
+ },
3183
+ "additionalProperties": false,
3184
+ "description": "What tf-check runs beyond its own checks: the repo's pre-commit hooks."
3185
+ },
2988
3186
  "atlantis_comments": {
2989
3187
  "type": "boolean",
2990
3188
  "description": "Read atlantis plan and atlantis apply comments as terragucci's."
package/dist/types.d.ts CHANGED
@@ -289,6 +289,16 @@ export interface TerragruntSettings {
289
289
  credentials?: Record<string, RolePair>;
290
290
  }
291
291
  /** Atmos settings. Atmos mode is detected (`atmos.yaml` at the repo root); this block only tunes it. */
292
+ /** `check`: what tf-check runs beyond its own checks. */
293
+ export interface CheckSettings {
294
+ /**
295
+ * Run the repo's `.pre-commit-config.yaml` in tf-check, as a chant check
296
+ * hook (./pre-commit.ts), with `PCT_TFPATH` set to the binary and
297
+ * `terraform_fmt` skipped. Off by default; init never turns it on.
298
+ */
299
+ pre_commit?: boolean;
300
+ }
301
+ export declare const CHECK_KEYS: readonly ["pre_commit"];
292
302
  export interface AtmosSettings {
293
303
  /** The Atmos release every job installs. Default: the one this terragucci release pins. */
294
304
  version?: string;
@@ -626,6 +636,8 @@ export interface ProjectSettings {
626
636
  policy?: PolicySettings;
627
637
  /** The module and provider sources a root may use, checked before init; see SourcesSettings. Off when absent. */
628
638
  sources?: SourcesSettings;
639
+ /** What tf-check runs beyond its own checks: the repo's pre-commit hooks; see CheckSettings. */
640
+ check?: CheckSettings;
629
641
  /**
630
642
  * `atlantis plan` and `atlantis apply` comments read as `/terragucci plan`
631
643
  * and `/terragucci apply`. Off by default. The alias changes the words
@@ -859,6 +871,8 @@ export declare const RELEASE_VERSION: RegExp;
859
871
  export declare const NOTIFY_KEYS: string[];
860
872
  export declare const POLICY_KEYS: string[];
861
873
  export declare const SOURCES_KEYS: string[];
874
+ /** The settings of one `sources.proxies` entry. */
875
+ export declare const SOURCE_PROXY_KEYS: string[];
862
876
  /** One `sources` entry: a glob with no whitespace, commas, semicolons or quotes. */
863
877
  export declare const SOURCE_GLOB = "^[^\\s,;'\"]+$";
864
878
  export declare const OIDC_KEYS: string[];
@@ -885,10 +899,53 @@ export declare function agentLoginWarning(agent: {
885
899
  export declare const STEPS_MOVED = "steps are ci.hooks in chant.workspace.json now, each with a command list and perRun: true (before: init or drift is before.observe, after: init is before.plan, after: drift is after.plan, roots is targets, on_failure is onFailure); see https://intentius.io/terragucci/guides/run-steps/";
886
900
  export declare const MODULES_KEYS: Set<string>;
887
901
  export declare const REGISTRY_KEYS: string[];
902
+ /** `modules.registry.providers`: `mirror` serves the providers the lock files pin as a network mirror under `providers/` (chant#4564). */
903
+ export declare const REGISTRY_PROVIDERS: readonly ["mirror"];
904
+ /** `modules.registry.catalog`: the release catalog under `catalog/` beside the registry's files (terragucci#1297). `on` by default; `off` writes none. */
905
+ export declare const REGISTRY_CATALOG: readonly ["on", "off"];
906
+ /**
907
+ * `modules.registry.edge`: what sends Terraform the X-Terraform-Get header a
908
+ * stored download answer cannot carry (terragucci#1287). `cloudflare` is a
909
+ * Worker, `cloudfront` a Lambda@Edge function, `pages` a `_headers` file for
910
+ * Cloudflare Pages or Netlify, and `none` serves the files as they are, which
911
+ * OpenTofu reads and Terraform does not.
912
+ */
913
+ export declare const REGISTRY_EDGES: readonly ["cloudflare", "cloudfront", "pages", "none"];
914
+ export type RegistryEdge = (typeof REGISTRY_EDGES)[number];
915
+ /** `modules.registry.auth`: `token` has the edge function check each reader's bearer token. Default `off`. */
916
+ export declare const REGISTRY_AUTHS: readonly ["off", "token"];
917
+ export type RegistryAuth = (typeof REGISTRY_AUTHS)[number];
918
+ /**
919
+ * `modules.registry.tokens`: where Lambda@Edge reads the accepted tokens
920
+ * (chant#4590). `zip` builds them into the function's options file (the
921
+ * default); `ssm` reads an SSM parameter and `secrets-manager` a secret at run
922
+ * time, so rotation needs no redeploy and no token reaches `registry-edge.json`.
923
+ */
924
+ export declare const REGISTRY_TOKENS: readonly ["zip", "ssm", "secrets-manager"];
925
+ export type RegistryTokens = (typeof REGISTRY_TOKENS)[number];
926
+ /** The region the token store is read from when `tokens_region` is unset: where Lambda@Edge functions are created. */
927
+ export declare const REGISTRY_TOKENS_REGION = "us-east-1";
928
+ /**
929
+ * The edge preset a registry gets when `edge` is unset, picked by where its
930
+ * files are: a dir deploys to a Pages site, so `pages`; an R2 bucket (an
931
+ * endpoint on r2.cloudflarestorage.com) and a GCS or Azure bucket get a
932
+ * Cloudflare Worker; any other S3 bucket gets CloudFront's Lambda@Edge.
933
+ */
934
+ export declare function registryEdge(reg: Pick<RegistrySettings, "edge" | "dir" | "bucket" | "endpoint">): RegistryEdge;
888
935
  /** A registry namespace or module name, as the Terraform module registry protocol allows them. */
889
936
  export declare const REGISTRY_NAME: RegExp;
890
937
  /** A registry module's system (its target provider): lower-case letters and digits. */
891
938
  export declare const REGISTRY_SYSTEM: RegExp;
939
+ /**
940
+ * A GitLab module registry in `modules.publish` (terragucci#1300): `gitlab`,
941
+ * the project a GitLab CI job runs in, or `gitlab://<host>/<project path>`.
942
+ */
943
+ export declare const gitlabPublishForm: RegExp;
944
+ export declare const isGitlabTarget: (t: string) => boolean;
945
+ /** HCP Terraform's private registry in `modules.publish` (terragucci#1301): `hcp://<org>`, or `hcp://<host>/<org>` for Terraform Enterprise. */
946
+ export declare const hcpPublishForm: RegExp;
947
+ /** An Artifactory or Nexus hosted repository in `modules.publish` (terragucci#1302): `<kind>://<host>/<repository>[/<namespace>]`. */
948
+ export declare const repositoryPublishForm: RegExp;
892
949
  /** A publisher in another repo whose releases `modules.require: attested` checks. */
893
950
  export interface TrustedModuleSource {
894
951
  /** How the roots' module sources begin: an `oci://` prefix, or the publisher's git URL with or without `git::`. */
@@ -913,7 +970,11 @@ export interface ModulesSettings {
913
970
  test?: boolean;
914
971
  /** Write each release as the Terraform module registry protocol, as static files a bucket or a Pages site serves. */
915
972
  registry?: RegistrySettings;
973
+ /** The secret holding a GitLab token with the api scope, which a GitHub or Forgejo publish job passes as `GITLAB_TOKEN` for a `gitlab://` target. Default `GITLAB_TOKEN`. */
974
+ gitlab_token?: string;
916
975
  }
976
+ /** The secret a GitHub or Forgejo publish job reads the GitLab token from, when `modules.publish` names a `gitlab://` project; undefined when it names none. */
977
+ export declare function gitlabPublishToken(m: ModulesSettings | undefined): string | undefined;
917
978
  /**
918
979
  * `sources`: the module and provider sources a root may use (./sources.ts).
919
980
  * A list that is set refuses every source of its kind that no glob in it
@@ -925,6 +986,24 @@ export interface SourcesSettings {
925
986
  modules?: string[];
926
987
  /** Globs of provider addresses, such as `hashicorp/*` or `registry.example.com/acme/*`. */
927
988
  providers?: string[];
989
+ /** Registry proxies a source may be written through, each standing for its upstream (terragucci#1302). */
990
+ proxies?: SourceProxy[];
991
+ }
992
+ /**
993
+ * One `sources.proxies` entry: an Artifactory remote or virtual Terraform
994
+ * repository (`artifactory: <host>`), or a Nexus proxy or group Terraform
995
+ * repository (`nexus: <https url>`), each with its repository and the
996
+ * upstream it stands for. A source written through one matches the globs as
997
+ * its upstream form, and `modules.require` reads through it.
998
+ */
999
+ export interface SourceProxy {
1000
+ artifactory?: string;
1001
+ nexus?: string;
1002
+ repo: string;
1003
+ /** The registry host the proxy stands for. Default registry.terraform.io. */
1004
+ upstream?: string;
1005
+ /** Nexus: the label of the consumers' CLI `host` block. Default the upstream. */
1006
+ host?: string;
928
1007
  }
929
1008
  /** `modules.registry`: the module registry protocol as static files. */
930
1009
  export interface RegistrySettings {
@@ -946,6 +1025,20 @@ export interface RegistrySettings {
946
1025
  system?: string;
947
1026
  /** What a version's download points at: a tarball beside it (the default), its git tag, or its OCI artifact. */
948
1027
  download?: "tarball" | "git-tags" | "oci";
1028
+ /** What adds the X-Terraform-Get header Terraform reads: a Cloudflare Worker, CloudFront's Lambda@Edge, a Pages `_headers` file, or nothing. Default: picked from `bucket`, `endpoint` or `dir` (registryEdge). */
1029
+ edge?: RegistryEdge;
1030
+ /** `token`: the edge function refuses a read without one of its bearer tokens and signs tarball URLs. Default `off`. */
1031
+ auth?: RegistryAuth;
1032
+ /** Where CloudFront's Lambda@Edge reads the accepted tokens with `auth: token`: `zip` (built into the function, the default), `ssm` or `secrets-manager`. */
1033
+ tokens?: RegistryTokens;
1034
+ /** The SSM parameter's name or the secret's name or ARN, for `tokens: ssm` or `secrets-manager`. */
1035
+ tokens_name?: string;
1036
+ /** The token store's region. Default us-east-1. */
1037
+ tokens_region?: string;
1038
+ /** `mirror`: publish also serves every provider the lock files pin as a provider network mirror under `providers/`. */
1039
+ providers?: (typeof REGISTRY_PROVIDERS)[number];
1040
+ /** `off`: publish writes no release catalog under `catalog/`. Default `on`. */
1041
+ catalog?: (typeof REGISTRY_CATALOG)[number];
949
1042
  }
950
1043
  /** Why a control repo's projects take no `rollouts` job: each project's pipeline sees only its own roots. */
951
1044
  /** Why `waves.compose` is refused in a Terragrunt repo. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/terragucci",
3
- "version": "0.4.45",
3
+ "version": "0.4.46",
4
4
  "description": "The whole Terraform lifecycle, handled: one config file, generated pipelines for GitHub, GitLab and Forgejo.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "build": "node ../../scripts/build-cli.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@intentius/chant": "0.124.52"
39
+ "@intentius/chant": "0.124.55"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@intentius/tsad-reference": "2.x",
@@ -52,10 +52,10 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@cdktn/hcl2json": "0.24.0",
55
- "@intentius/chant-lexicon-forgejo": "0.124.52",
56
- "@intentius/chant-lexicon-github": "0.124.52",
57
- "@intentius/chant-lexicon-gitlab": "0.124.52",
58
- "@intentius/chant-lexicon-terraform": "0.124.52",
55
+ "@intentius/chant-lexicon-forgejo": "0.124.55",
56
+ "@intentius/chant-lexicon-github": "0.124.55",
57
+ "@intentius/chant-lexicon-gitlab": "0.124.55",
58
+ "@intentius/chant-lexicon-terraform": "0.124.55",
59
59
  "@intentius/tsad-reference": "2.1.0",
60
60
  "@modelcontextprotocol/sdk": "1.30.1"
61
61
  }