@intentius/terragucci 0.4.12 → 0.4.13

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.
@@ -64,12 +64,34 @@
64
64
  "description": "When a wave waits for an approval. on-destroy is an older name for on-destructive."
65
65
  },
66
66
  "approval": {
67
- "enum": [
68
- "ledger",
69
- "pr-review",
70
- "sealed"
67
+ "anyOf": [
68
+ {
69
+ "enum": [
70
+ "ledger",
71
+ "pr-review",
72
+ "sealed"
73
+ ]
74
+ },
75
+ {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "mode": {
80
+ "enum": [
81
+ "ledger",
82
+ "pr-review",
83
+ "sealed"
84
+ ],
85
+ "description": "What counts as a waiting wave's approval."
86
+ },
87
+ "require_signed": {
88
+ "type": "boolean",
89
+ "description": "Refuse an unsigned approval on the ledger, so every ledger approval is tied to the principal who signed it."
90
+ }
91
+ }
92
+ }
71
93
  ],
72
- "description": "What counts as a waiting wave's approval."
94
+ "description": "What counts as a waiting wave's approval: the mode, or a map with the mode and require_signed."
73
95
  },
74
96
  "apply": {
75
97
  "type": "object",
@@ -1127,6 +1149,11 @@
1127
1149
  "type": "string",
1128
1150
  "minLength": 1
1129
1151
  },
1152
+ "login": {
1153
+ "type": "string",
1154
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(\\[bot\\])?$",
1155
+ "description": "The forge login agent.token_env's token acts as. No approval by it counts."
1156
+ },
1130
1157
  "comment": {
1131
1158
  "anyOf": [
1132
1159
  {
@@ -1720,12 +1747,34 @@
1720
1747
  "description": "When a wave waits for an approval. on-destroy is an older name for on-destructive."
1721
1748
  },
1722
1749
  "approval": {
1723
- "enum": [
1724
- "ledger",
1725
- "pr-review",
1726
- "sealed"
1750
+ "anyOf": [
1751
+ {
1752
+ "enum": [
1753
+ "ledger",
1754
+ "pr-review",
1755
+ "sealed"
1756
+ ]
1757
+ },
1758
+ {
1759
+ "type": "object",
1760
+ "additionalProperties": false,
1761
+ "properties": {
1762
+ "mode": {
1763
+ "enum": [
1764
+ "ledger",
1765
+ "pr-review",
1766
+ "sealed"
1767
+ ],
1768
+ "description": "What counts as a waiting wave's approval."
1769
+ },
1770
+ "require_signed": {
1771
+ "type": "boolean",
1772
+ "description": "Refuse an unsigned approval on the ledger, so every ledger approval is tied to the principal who signed it."
1773
+ }
1774
+ }
1775
+ }
1727
1776
  ],
1728
- "description": "What counts as a waiting wave's approval."
1777
+ "description": "What counts as a waiting wave's approval: the mode, or a map with the mode and require_signed."
1729
1778
  },
1730
1779
  "apply": {
1731
1780
  "type": "object",
@@ -2775,6 +2824,11 @@
2775
2824
  "type": "string",
2776
2825
  "minLength": 1
2777
2826
  },
2827
+ "login": {
2828
+ "type": "string",
2829
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*(\\[bot\\])?$",
2830
+ "description": "The forge login agent.token_env's token acts as. No approval by it counts."
2831
+ },
2778
2832
  "comment": {
2779
2833
  "anyOf": [
2780
2834
  {
package/dist/types.d.ts CHANGED
@@ -20,6 +20,22 @@ export declare function normalizeGate(v: unknown): Gate | undefined;
20
20
  * lists for its approver. Every mode binds the digest.
21
21
  */
22
22
  export declare const APPROVALS: readonly ["ledger", "pr-review", "sealed"];
23
+ /** The keys of `approval:` as a map: the mode, and whether a ledger approval must be signed. */
24
+ export declare const APPROVAL_KEYS: readonly ["mode", "require_signed"];
25
+ /**
26
+ * `approval:` as a map, in place of the mode alone. `require_signed: true`
27
+ * refuses an unsigned approval on the ledger: only a signed one can be tied
28
+ * to the person whose principal signed it, so only a signed one can be
29
+ * checked against the people behind the change (./involved.ts).
30
+ */
31
+ export interface ApprovalSettings {
32
+ mode?: Approval;
33
+ require_signed?: boolean;
34
+ }
35
+ /** The mode an `approval:` value names: the string, or the map's `mode`. */
36
+ export declare function approvalModeOf(v: Approval | ApprovalSettings | undefined): Approval | undefined;
37
+ /** Whether an `approval:` value refuses unsigned ledger approvals. */
38
+ export declare function requireSignedOf(v: Approval | ApprovalSettings | undefined): boolean;
23
39
  /** Every stage runs on the forge's CI. */
24
40
  export declare const RUNTIMES: readonly ["forge"];
25
41
  export declare const DEPENDENTS: readonly ["follow", "plan"];
@@ -376,8 +392,8 @@ export interface ProjectSettings {
376
392
  url?: string;
377
393
  /** When a wave waits for an approval. A loaded config holds the policy's current name: on-destroy reads as on-destructive. */
378
394
  gate?: GateName;
379
- /** What counts as a waiting wave's approval; see APPROVALS. Read from the config at base, never the applied commit's own. */
380
- approval?: Approval;
395
+ /** What counts as a waiting wave's approval; see APPROVALS, or a map with the mode and `require_signed` (ApprovalSettings). Read from the config at base, never the applied commit's own. */
396
+ approval?: Approval | ApprovalSettings;
381
397
  /** When a change applies; see ApplySettings. */
382
398
  apply?: ApplySettings;
383
399
  /** When a pull request takes its root locks; see LOCKS. */
@@ -534,6 +550,7 @@ export interface ProjectSettings {
534
550
  agent?: {
535
551
  via: (typeof AGENT_VIA)[number];
536
552
  token_env: string;
553
+ login?: string;
537
554
  comment?: boolean | AgentCommentSettings;
538
555
  drift?: boolean | AgentCommentSettings;
539
556
  };
@@ -717,6 +734,17 @@ export declare const TOKEN_PROTECTION_KEYS: string[];
717
734
  export declare const COST_KEYS: string[];
718
735
  export declare const PASS_KEYS: string[];
719
736
  export declare const AGENT_KEYS: string[];
737
+ /** A forge login, as `agent.login` takes it. */
738
+ export declare const AGENT_LOGIN: RegExp;
739
+ /**
740
+ * `config check`'s warning when `agent.token_env` is set without
741
+ * `agent.login`: a pull request's author can use the agent's secret to post a
742
+ * review as the agent's account, and without its login nothing excludes it.
743
+ */
744
+ export declare function agentLoginWarning(agent: {
745
+ token_env?: unknown;
746
+ login?: unknown;
747
+ } | undefined): string | undefined;
720
748
  export declare const MODULES_KEYS: Set<string>;
721
749
  export declare const REGISTRY_KEYS: string[];
722
750
  /** A registry namespace or module name, as the Terraform module registry protocol allows them. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/terragucci",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
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",