@mcpg-dev/pulumi-policy 0.1.0-canary.732 → 0.1.0-rc.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.
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Security report
4
+ url: mailto:security@mcpg.dev
5
+ about: Please report vulnerabilities privately by email, not as a public issue.
6
+ - name: Pull requests
7
+ url: https://github.com/mcpg-dev
8
+ about: PRs cannot be merged here — development happens upstream. File an issue instead.
@@ -0,0 +1,51 @@
1
+ # Per-push checks for the npm package. Publishing lives in release.yml.
2
+ name: CI
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+ jobs:
9
+ check:
10
+ name: install · build · typecheck · test
11
+ if: vars.OSS_CI_ENABLED == 'true'
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
16
+ with:
17
+ node-version: 22
18
+ - name: Wait for sibling packages on the registry
19
+ # Sibling deps are exact pins re-stated at the release cut, and a
20
+ # release wave pushes every sibling within seconds of each other:
21
+ # this CI runs on that push while the sibling's own release lane is
22
+ # still queued, so the pin it installs may not exist yet. Bounded
23
+ # above the release lane's wait because CI starts earlier than the
24
+ # two hosted jobs that publish the sibling.
25
+ run: |
26
+ set -euo pipefail
27
+ deps=$(jq -r '((.dependencies // {}) + (.peerDependencies // {}))
28
+ | to_entries[] | select(.key | startswith("@mcpg-dev/"))
29
+ | "\(.key)@\(.value)"' package.json)
30
+ [ -z "$deps" ] && { echo "no sibling packages"; exit 0; }
31
+ for d in $deps; do
32
+ echo "waiting for $d"
33
+ found=""
34
+ for _ in $(seq 1 120); do
35
+ if npm view "$d" version >/dev/null 2>&1; then found=1; break; fi
36
+ sleep 10
37
+ done
38
+ [ -n "$found" ] || { echo "::error::$d never appeared on the registry"; exit 1; }
39
+ done
40
+ # Unlocked on purpose: no lockfile ships with the source, so the
41
+ # install resolves fresh.
42
+ - run: npm install --no-audit --no-fund
43
+ - run: npm run build
44
+ - name: Typecheck
45
+ run: |
46
+ set -euo pipefail
47
+ if jq -e '.scripts.typecheck' package.json >/dev/null; then npm run typecheck; fi
48
+ - name: Test
49
+ run: |
50
+ set -euo pipefail
51
+ if jq -e '.scripts.test' package.json >/dev/null; then npm test; fi
@@ -0,0 +1,16 @@
1
+ # Thin shim: fires on the v{version} release tag and calls the shared
2
+ # non-Rust release workflow with this repo's tier. Managed by the release
3
+ # pipeline — changes made here are overwritten.
4
+ name: Release
5
+ on:
6
+ push:
7
+ tags: ["v*"]
8
+ workflow_dispatch:
9
+ permissions:
10
+ contents: write
11
+ id-token: write
12
+ packages: write
13
+ jobs:
14
+ release:
15
+ uses: mcpg-dev/.github/.github/workflows/release-npm.yml@main
16
+ secrets: inherit
@@ -0,0 +1,24 @@
1
+ # Contributing
2
+
3
+ Development of this project happens upstream; this repository publishes
4
+ each release as a tagged snapshot.
5
+
6
+ ## What this means
7
+
8
+ - **Pull requests cannot be merged here.** The contents are replaced
9
+ wholesale at every release, so a PR opened against this repository has
10
+ nothing durable to land on. PRs are closed automatically with a link to
11
+ this page.
12
+ - **Issues are very welcome.** Bug reports, feature requests, and questions
13
+ filed here are read and triaged. Please include the release version you
14
+ are using and a minimal reproduction.
15
+ - **Security reports:** please email **security@mcpg.dev** rather than
16
+ opening a public issue.
17
+
18
+ ## Versions
19
+
20
+ Releases are git tags (`v{version}`); each tagged commit is a complete
21
+ snapshot of this project at that release. Dependency updates arrive with
22
+ the next release; this repository runs no Dependabot/Renovate.
23
+
24
+ Thanks for using MCPG.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed" page as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024-2026 MCPG, Inc. and MCPG contributors.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -37,7 +37,7 @@ npm install && npm run build # tsc → bin/
37
37
  | `MCPGPlugin` | `pluginId` non-empty and reverse-DNS; `version` non-empty; `pluginClass` is a known plugin class; `oci.image` carries a registry component and a tag or digest; the artifact is digest-pinned **or** carries a cosign identity; `trust.signingKeyRef.secretName` present (Ed25519 signing is the mandatory baseline); a cosign block has a non-empty, anchored `certificateIdentityRegexp` and an `oidcIssuer`; an SLSA block sets `configMapName`, `sourceUri` and `sourceTag`. |
38
38
  | `MCPGPluginSet` | `entries` non-empty; each entry has a reverse-DNS `id` and a `pluginRef.name`; ids unique; `capabilityGrants` keys name a declared entry and grant a non-empty capability list. |
39
39
  | `MCPGRevocationList` | `version == 1`; every `artifactSha256` is 64 hex characters; every revocation carries a `reason`; no duplicate hashes. |
40
- | `MCPGCluster` | the `single_node` backend takes no `config`; every other backend requires one; a plaintext coordinator address (`redis://`, `http://` Consul, non-`https://` etcd endpoints, NATS with `tls.require_tls: false`) is rejected unless `config.allow_insecure_transport: true`; `credentialRefs` entries carry `name` + `secretName` and unique names. |
40
+ | `MCPGCluster` | the `single_node` backend takes no `config`; every other backend requires one; a plaintext coordinator address (`redis://`, or NATS with `tls.require_tls: false`) is rejected unless `config.allow_insecure_transport: true`; `credentialRefs` entries carry `name` + `secretName` and unique names. |
41
41
  | `MCPGRoute` | `gatewayRef.name` non-empty; `match.tools` lists at least one tool; tool ids non-empty and unique; no empty entry in `identityChain` / `policyChain` / `auditChain`. |
42
42
  | `MCPGTenant` | `namespaces` non-empty, with entries non-empty and unique; each `allowedPlugins` entry sets `name` or `registryPrefix`; quota fields are non-negative; `identityAttribute.key` non-empty when that block is set. |
43
43
  | `MCPGPluginMirror` | `endpoint.service.{namespace,name,port}` set; `upstream.registry` present and shaped like a registry host; `upstream.namespace` present; `auth.secretRef.secretName` present when `auth` is set. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpg-dev/pulumi-policy",
3
- "version": "0.1.0-canary.732",
3
+ "version": "0.1.0-rc.1",
4
4
  "repository": "https://github.com/mcpg-dev/pulumi-mcpg-policy",
5
5
  "description": "Pulumi CrossGuard policy pack mirroring MCPG operator admission rules.",
6
6
  "license": "Apache-2.0",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@pulumi/policy": "^1.13.0",
15
- "@pulumi/pulumi": "^3.142.0"
15
+ "@pulumi/pulumi": "^3.272.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^20",
package/BUILD.bazel DELETED
@@ -1,24 +0,0 @@
1
- load("@aspect_rules_js//js:defs.bzl", "js_library")
2
- load("@npm//:defs.bzl", "npm_link_all_packages")
3
-
4
- # This package's npm dependencies, linked the way node resolves them.
5
- npm_link_all_packages(name = "node_modules")
6
-
7
- # Every workspace package needs a `pkg` target: npm_link_all_packages resolves
8
- # a `workspace:*` dependency to one, and the root link covers the whole
9
- # workspace — so a package without it breaks the graph for everyone, not just
10
- # for itself.
11
- js_library(
12
- name = "pkg",
13
- srcs = glob(
14
- ["**/*"],
15
- allow_empty = True,
16
- exclude = [
17
- "node_modules/**",
18
- "dist/**",
19
- ".next/**",
20
- "BUILD.bazel",
21
- ],
22
- ),
23
- visibility = ["//visibility:public"],
24
- )
package/copy.bara.sky DELETED
@@ -1,87 +0,0 @@
1
- # GENERATED by tools/open-source/gen-copybara.mjs — DO NOT EDIT.
2
- # One-way mirror of the @mcpg-dev/pulumi-policy npm package from the mcpg monorepo to
3
- # its own public repository. Contains NO version literals — regenerate
4
- # (`--write-npm`) only when the package's identity or layout changes.
5
- #
6
- # Licence: Apache-2.0. Repo: github.com/mcpg-dev/pulumi-mcpg-policy.
7
- # History is SQUASHED and re-authored to the bot, so no internal commit
8
- # history, subjects, or contributor identities are exposed.
9
-
10
- # Reads "version" from the package's own package.json at MIRROR time: sets
11
- # the public release message and the PKG_VERSION label the destination
12
- # resolves in tag_name — so no version is baked into this file. Matched at
13
- # two-space indentation so a nested "version" (the CRD SDK's generated
14
- # provider block carries one) can never be mistaken for the package's.
15
- def _release_meta(ctx):
16
- content = ctx.read_path(ctx.new_path("package.json"))
17
- version = ""
18
- for line in content.split("\n"):
19
- if not line.startswith(' "version"'):
20
- continue
21
- rest = line.split(":", 1)
22
- if len(rest) < 2:
23
- continue
24
- version = rest[1].strip().strip(",").strip('"')
25
- break
26
- if version == "":
27
- fail("mirror: could not read top-level \"version\" from package.json")
28
- ctx.set_message("Release v" + version + "\n")
29
- ctx.add_label("PKG_VERSION", version, hidden = True)
30
-
31
- core.workflow(
32
- name = "default",
33
- mode = "SQUASH",
34
-
35
- origin = git.origin(
36
- url = "https://github.com/mcpg-dev/source-code.git",
37
- ref = "main",
38
- ),
39
- # push the code to main AND create the v{version} tag the public repo's
40
- # release.yml fires on to self-publish to npm.
41
- destination = git.github_destination(
42
- url = "https://github.com/mcpg-dev/pulumi-mcpg-policy.git",
43
- push = "main",
44
- tag_name = "v${PKG_VERSION}",
45
- tag_msg = "Release v${PKG_VERSION}",
46
- ),
47
-
48
- # The package subtree, minus internal artifacts: nx project.json,
49
- # CHANGELOG.md (internal commits/PRs), AI-agent working rules, build
50
- # output, and installed dependencies. Sources and tests DO travel — the
51
- # tests use only node:test and node:assert, so they build and run in the
52
- # public repo with nothing extra.
53
- origin_files = glob(["iac/pulumi/policy/**"], exclude = [
54
- "iac/pulumi/policy/copy.bara.sky", "iac/pulumi/policy/project.json",
55
- "iac/pulumi/policy/BUILD.bazel", "iac/pulumi/policy/**/BUILD.bazel",
56
- "iac/pulumi/policy/CHANGELOG.md", "iac/pulumi/policy/**/AGENTS.md",
57
- "iac/pulumi/policy/bin/**", "iac/pulumi/policy/node_modules/**",
58
- "iac/pulumi/policy/**/*.tsbuildinfo",
59
- # Destination-managed names never travel from the origin (the
60
- # destination excludes them, and Copybara refuses uncovered writes).
61
- "iac/pulumi/policy/.gitignore", "iac/pulumi/policy/CONTRIBUTING.md",
62
- "iac/pulumi/policy/package-lock.json", "iac/pulumi/policy/.github/**",
63
- "iac/pulumi/policy/**/DEFERRED.md", "iac/pulumi/policy/**/TODO.md",
64
- "iac/pulumi/policy/**/NOTES.md", "iac/pulumi/policy/**/ROADMAP.md",
65
- "iac/pulumi/policy/**/INTERNAL*.md",
66
- ]),
67
-
68
- # Repo-only scaffold (CI, release shim, CONTRIBUTING, .gitignore) is
69
- # seeded at bootstrap and excluded here so the mirror never deletes or
70
- # clobbers it. LICENSE is NOT excluded — the mirror manages it.
71
- destination_files = glob(["**"], exclude = [
72
- ".github/**", ".gitignore", "CONTRIBUTING.md", "package-lock.json",
73
- ]),
74
-
75
- # Re-author every commit to the bot — no real contributor identity leaks.
76
- authoring = authoring.overwrite("mcpg-bot <oss-bot@mcpg.dev>"),
77
-
78
- transformations = [
79
- # 1) subdir -> repo root.
80
- core.move("iac/pulumi/policy", ""),
81
-
82
- # 2) release message + PKG_VERSION label from the mirrored
83
- # manifest — replaces the squashed history's message entirely: NO
84
- # commit list, NO authors, NO subjects.
85
- _release_meta,
86
- ],
87
- )