pepr 0.14.2 → 0.15.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.
Files changed (58) hide show
  1. package/dist/cli.js +51 -18
  2. package/dist/controller.js +1 -1
  3. package/dist/lib/assets/deploy.d.ts.map +1 -1
  4. package/dist/lib/assets/index.d.ts +1 -1
  5. package/dist/lib/assets/index.d.ts.map +1 -1
  6. package/dist/lib/assets/rbac.d.ts +2 -1
  7. package/dist/lib/assets/rbac.d.ts.map +1 -1
  8. package/dist/lib/assets/yaml.d.ts +1 -1
  9. package/dist/lib/assets/yaml.d.ts.map +1 -1
  10. package/dist/lib/helpers.d.ts +11 -0
  11. package/dist/lib/helpers.d.ts.map +1 -0
  12. package/package.json +9 -9
  13. package/src/lib/assets/deploy.ts +4 -3
  14. package/src/lib/assets/index.ts +2 -2
  15. package/src/lib/assets/rbac.ts +27 -11
  16. package/src/lib/assets/yaml.ts +2 -2
  17. package/src/lib/helpers.ts +39 -0
  18. package/src/templates/capabilities/hello-pepr.ts +16 -11
  19. package/website/.linkinator.config.json +8 -0
  20. package/website/.markdownlint.json +6 -0
  21. package/website/.prettierignore +12 -0
  22. package/website/LICENSE +201 -0
  23. package/website/README.md +50 -0
  24. package/website/archetypes/default.md +6 -0
  25. package/website/assets/img/doug.svg +345 -0
  26. package/website/assets/img/pepr.svg +212 -0
  27. package/website/assets/scss/_styles_project.scss +3 -0
  28. package/website/assets/scss/_variables_project.scss +1 -0
  29. package/website/content/en/docs/_index.md +9 -0
  30. package/website/content/en/docs/cli.md +64 -0
  31. package/website/content/en/docs/codeSample.txt +31 -0
  32. package/website/content/en/docs/concepts.md +238 -0
  33. package/website/content/en/docs/customresources.md +167 -0
  34. package/website/content/en/docs/diagrams.txt +18 -0
  35. package/website/content/en/docs/metrics.md +74 -0
  36. package/website/content/en/docs/rbac.md +153 -0
  37. package/website/content/en/docs/webassembly.md +189 -0
  38. package/website/go.mod +8 -0
  39. package/website/go.sum +4 -0
  40. package/website/package-lock.json +3907 -0
  41. package/website/package.json +30 -0
  42. package/website/renovate.json +16 -0
  43. package/website/static/favicons/android-144x144.png +0 -0
  44. package/website/static/favicons/android-192x192.png +0 -0
  45. package/website/static/favicons/android-36x36.png +0 -0
  46. package/website/static/favicons/android-48x48.png +0 -0
  47. package/website/static/favicons/android-72x72.png +0 -0
  48. package/website/static/favicons/android-96x96.png +0 -0
  49. package/website/static/favicons/android-chrome-192x192.png +0 -0
  50. package/website/static/favicons/android-chrome-512x512.png +0 -0
  51. package/website/static/favicons/android-chrome-maskable-192x192.png +0 -0
  52. package/website/static/favicons/android-chrome-maskable-512x512.png +0 -0
  53. package/website/static/favicons/apple-touch-icon-180x180.png +0 -0
  54. package/website/static/favicons/apple-touch-icon.png +0 -0
  55. package/website/static/favicons/favicon-16x16.png +0 -0
  56. package/website/static/favicons/favicon-32x32.png +0 -0
  57. package/website/static/favicons/favicon.ico +0 -0
  58. package/website/static/img/how-to-use.png +0 -0
package/dist/cli.js CHANGED
@@ -529,15 +529,45 @@ function moduleSecret(name2, data, hash) {
529
529
  };
530
530
  }
531
531
 
532
+ // src/lib/helpers.ts
533
+ var createRBACMap = (capabilities) => {
534
+ return capabilities.reduce((acc, capability) => {
535
+ capability.bindings.forEach((binding) => {
536
+ const key = `${binding.kind.group}/${binding.kind.version}/${binding.kind.kind}`;
537
+ acc["pepr.dev/v1/peprstore"] = {
538
+ verbs: ["create", "get", "patch", "watch"],
539
+ plural: "peprstores"
540
+ };
541
+ if (!acc[key] && binding.isWatch) {
542
+ acc[key] = {
543
+ verbs: ["watch"],
544
+ plural: binding.kind.plural || `${binding.kind.kind.toLowerCase()}s`
545
+ };
546
+ }
547
+ });
548
+ return acc;
549
+ }, {});
550
+ };
551
+
532
552
  // src/lib/assets/rbac.ts
533
- function clusterRole(name2) {
553
+ function clusterRole(name2, capabilities, rbacMode = "") {
554
+ const rbacMap = createRBACMap(capabilities);
534
555
  return {
535
556
  apiVersion: "rbac.authorization.k8s.io/v1",
536
557
  kind: "ClusterRole",
537
558
  metadata: { name: name2 },
538
- rules: [
559
+ rules: rbacMode === "scoped" ? [
560
+ ...Object.keys(rbacMap).map((key) => {
561
+ let group2;
562
+ key.split("/").length < 3 ? group2 = "" : group2 = key.split("/")[0];
563
+ return {
564
+ apiGroups: [group2],
565
+ resources: [rbacMap[key].plural],
566
+ verbs: rbacMap[key].verbs
567
+ };
568
+ })
569
+ ] : [
539
570
  {
540
- // @todo: make this configurable
541
571
  apiGroups: ["*"],
542
572
  resources: ["*"],
543
573
  verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
@@ -582,7 +612,7 @@ function storeRole(name2) {
582
612
  metadata: { name: name2, namespace: "pepr-system" },
583
613
  rules: [
584
614
  {
585
- apiGroups: ["pepr.dev/*"],
615
+ apiGroups: ["pepr.dev"],
586
616
  resources: ["peprstores"],
587
617
  resourceNames: [""],
588
618
  verbs: ["create", "get", "patch", "watch"]
@@ -790,16 +820,16 @@ async function deploy(assets, webhookTimeout) {
790
820
  if (code.length < 1) {
791
821
  throw new Error("No code provided");
792
822
  }
793
- await setupRBAC(name2);
823
+ await setupRBAC(name2, assets.capabilities);
794
824
  await setupController(assets, code, hash);
795
825
  await setupWatcher(assets, hash);
796
826
  }
797
- async function setupRBAC(name2) {
827
+ async function setupRBAC(name2, capabilities) {
798
828
  logger_default.info("Applying cluster role binding");
799
829
  const crb = clusterRoleBinding(name2);
800
830
  await (0, import_kubernetes_fluent_client2.K8s)(import_kubernetes_fluent_client2.kind.ClusterRoleBinding).Apply(crb);
801
831
  logger_default.info("Applying cluster role");
802
- const cr = clusterRole(name2);
832
+ const cr = clusterRole(name2, capabilities);
803
833
  await (0, import_kubernetes_fluent_client2.K8s)(import_kubernetes_fluent_client2.kind.ClusterRole).Apply(cr);
804
834
  logger_default.info("Applying service account");
805
835
  const sa = serviceAccount(name2);
@@ -894,7 +924,7 @@ function zarfYaml({ name: name2, image, config }, path) {
894
924
  };
895
925
  return (0, import_client_node.dumpYaml)(zarfCfg, { noRefs: true });
896
926
  }
897
- async function allYaml(assets) {
927
+ async function allYaml(assets, rbacMode) {
898
928
  const { name: name2, tls, apiToken, path } = assets;
899
929
  const code = await import_fs3.promises.readFile(path);
900
930
  const hash = import_crypto2.default.createHash("sha256").update(code).digest("hex");
@@ -903,7 +933,7 @@ async function allYaml(assets) {
903
933
  const watchDeployment = watcher(assets, hash);
904
934
  const resources = [
905
935
  namespace,
906
- clusterRole(name2),
936
+ clusterRole(name2, assets.capabilities, rbacMode),
907
937
  clusterRoleBinding(name2),
908
938
  serviceAccount(name2),
909
939
  apiTokenSecret(name2, apiToken),
@@ -949,9 +979,9 @@ var Assets = class {
949
979
  await deploy(this, webhookTimeout);
950
980
  };
951
981
  zarfYaml = (path) => zarfYaml(this, path);
952
- allYaml = async () => {
982
+ allYaml = async (rbacMode) => {
953
983
  this.capabilities = await loadCapabilities(this.path);
954
- return allYaml(this);
984
+ return allYaml(this, rbacMode);
955
985
  };
956
986
  };
957
987
 
@@ -1161,8 +1191,8 @@ var hello_pepr_samples_default = [
1161
1191
  var gitIgnore = "# Ignore node_modules and Pepr build artifacts\nnode_modules\ndist\ninsecure*\n";
1162
1192
  var readmeMd = '# Pepr Module\n\nThis is a Pepr Module. [Pepr](https://github.com/defenseunicorns/pepr) is a type-safe Kubernetes middleware system.\n\nThe `capabilities` directory contains all the capabilities for this module. By default,\na capability is a single typescript file in the format of `capability-name.ts` that is\nimported in the root `pepr.ts` file as `import { HelloPepr } from "./capabilities/hello-pepr";`.\nBecause this is typescript, you can organize this however you choose, e.g. creating a sub-folder\nper-capability or common logic in shared files or folders.\n\nExample Structure:\n\n```\nModule Root\n\u251C\u2500\u2500 package.json\n\u251C\u2500\u2500 pepr.ts\n\u2514\u2500\u2500 capabilities\n \u251C\u2500\u2500 example-one.ts\n \u251C\u2500\u2500 example-three.ts\n \u2514\u2500\u2500 example-two.ts\n```\n';
1163
1193
  var peprTS = 'import { PeprModule } from "pepr";\n// cfg loads your pepr configuration from package.json\nimport cfg from "./package.json";\n\n// HelloPepr is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\nimport { HelloPepr } from "./capabilities/hello-pepr";\n\n/**\n * This is the main entrypoint for this Pepr module. It is run when the module is started.\n * This is where you register your Pepr configurations and capabilities.\n */\nnew PeprModule(cfg, [\n // "HelloPepr" is a demo capability that is included with Pepr. Comment or delete the line below to remove it.\n HelloPepr,\n\n // Your additional capabilities go here\n]);\n';
1164
- var helloPeprTS = 'import {\n Capability,\n K8s,\n Log,\n PeprMutateRequest,\n RegisterKind,\n a,\n fetch,\n fetchStatus,\n kind,\n} from "pepr";\n\n/**\n * The HelloPepr Capability is an example capability to demonstrate some general concepts of Pepr.\n * To test this capability you run `pepr dev`and then run the following command:\n * `kubectl apply -f capabilities/hello-pepr.samples.yaml`\n */\nexport const HelloPepr = new Capability({\n name: "hello-pepr",\n description: "A simple example capability to show how things work.",\n namespaces: ["pepr-demo", "pepr-demo-2"],\n});\n\n// Use the \'When\' function to create a new action, use \'Store\' to persist data\nconst { When, Store } = HelloPepr;\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action removes the label `remove-me` when a Namespace is created.\n * Note we don\'t need to specify the namespace here, because we\'ve already specified\n * it in the Capability definition above.\n */\nWhen(a.Namespace)\n .IsCreated()\n .Mutate(ns => ns.RemoveLabel("remove-me"));\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Watch Action with K8s SSA (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action watches for the `pepr-demo-2` namespace to be created, then creates a ConfigMap with\n * the name `pepr-ssa-demo` and adds the namespace UID to the ConfigMap data. Because Pepr uses\n * server-side apply for this operation, the ConfigMap will be created or updated if it already exists.\n */\nWhen(a.Namespace)\n .IsCreated()\n .WithName("pepr-demo-2")\n .Watch(async ns => {\n Log.info("Namespace pepr-demo-2 was created.");\n\n // You can share data between actions using the Store, including between different types of actions\n Store.setItem("watch-data", "This data was stored by a Watch Action.");\n\n // Apply the ConfigMap using K8s server-side apply\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: "pepr-ssa-demo",\n namespace: "pepr-demo-2",\n },\n data: {\n "ns-uid": ns.metadata.uid,\n },\n });\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 1) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is a single action. They can be in the same file or put imported from other files.\n * In this example, when a ConfigMap is created with the name `example-1`, then add a label and annotation.\n *\n * Equivalent to manually running:\n * `kubectl label configmap example-1 pepr=was-here`\n * `kubectl annotate configmap example-1 pepr.dev=annotations-work-too`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request\n .SetLabel("pepr", "was-here")\n .SetAnnotation("pepr.dev", "annotations-work-too");\n\n // Use the Store to persist data between requests and Pepr controller pods\n Store.setItem("example-1", "was-here");\n\n // This data is written asynchronously and can be read back via `Store.getItem()` or `Store.subscribe()`\n Store.setItem("example-1-data", JSON.stringify(request.Raw.data));\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate & Validate Actions (CM Example 2) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This combines 3 different types of actions: \'Mutate\', \'Validate\', and \'Watch\'. The order\n * of the actions is required, but each action is optional. In this example, when a ConfigMap is created\n * with the name `example-2`, then add a label and annotation, validate that the ConfigMap has the label\n * `pepr`, and log the request.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n // This Mutate Action will mutate the request before it is persisted to the cluster\n\n // Use `request.Merge()` to merge the new data with the existing data\n request.Merge({\n metadata: {\n labels: {\n pepr: "was-here",\n },\n annotations: {\n "pepr.dev": "annotations-work-too",\n },\n },\n });\n })\n .Validate(request => {\n // This Validate Action will validate the request before it is persisted to the cluster\n\n // Approve the request if the ConfigMap has the label \'pepr\'\n if (request.HasLabel("pepr")) {\n return request.Approve();\n }\n\n // Otherwise, deny the request with an error message (optional)\n return request.Deny("ConfigMap must have label \'pepr\'");\n })\n .Watch((cm, phase) => {\n // This Watch Action will watch the ConfigMap after it has been persisted to the cluster\n Log.info(cm, `ConfigMap was ${phase} with the name example-2`);\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 2a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action shows a simple validation that will deny any ConfigMap that has the\n * annotation `evil`. Note that the `Deny()` function takes an optional second parameter that is a\n * user-defined status code to return.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .Validate(request => {\n if (request.HasAnnotation("evil")) {\n return request.Deny("No evil CM annotations allowed.", 400);\n }\n\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 3) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action combines different styles. Unlike the previous actions, this one will look\n * for any ConfigMap in the `pepr-demo` namespace that has the label `change=by-label` during either\n * CREATE or UPDATE. Note that all conditions added such as `WithName()`, `WithLabel()`, `InNamespace()`,\n * are ANDs so all conditions must be true for the request to be processed.\n */\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("change", "by-label")\n .Mutate(request => {\n // The K8s object e are going to mutate\n const cm = request.Raw;\n\n // Get the username and uid of the K8s request\n const { username, uid } = request.Request.userInfo;\n\n // Store some data about the request in the configmap\n cm.data["username"] = username;\n cm.data["uid"] = uid;\n\n // You can still mix other ways of making changes too\n request.SetAnnotation("pepr.dev", "making-waves");\n });\n\n// This action validates the label `change=by-label` is deleted\nWhen(a.ConfigMap)\n .IsDeleted()\n .WithLabel("change", "by-label")\n .Validate(request => {\n // Log and then always approve the request\n Log.info("CM with label \'change=by-label\' was deleted.");\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action show how you can use the `Mutate()` function without an inline function.\n * This is useful if you want to keep your actions small and focused on a single task,\n * or if you want to reuse the same function in multiple actions.\n */\nWhen(a.ConfigMap).IsCreated().WithName("example-4").Mutate(example4Cb);\n\n// This function uses the complete type definition, but is not required.\nfunction example4Cb(cm: PeprMutateRequest<a.ConfigMap>) {\n cm.SetLabel("pepr.dev/first", "true");\n cm.SetLabel("pepr.dev/second", "true");\n cm.SetLabel("pepr.dev/third", "true");\n}\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is the same as Example 4, except this only operates on a CM in the `pepr-demo-2` namespace.\n * Note because the Capability defines namespaces, the namespace specified here must be one of those.\n * Alternatively, you can remove the namespace from the Capability definition and specify it here.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .InNamespace("pepr-demo-2")\n .WithName("example-4a")\n .Mutate(example4Cb);\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 5) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action is a bit more complex. It will look for any ConfigMap in the `pepr-demo`\n * namespace that has the label `chuck-norris` during CREATE. When it finds one, it will fetch a\n * random Chuck Norris joke from the API and add it to the ConfigMap. This is a great example of how\n * you can use Pepr to make changes to your K8s objects based on external data.\n *\n * Note the use of the `async` keyword. This is required for any action that uses `await` or `fetch()`.\n *\n * Also note we are passing a type to the `fetch()` function. This is optional, but it will help you\n * avoid mistakes when working with the data returned from the API. You can also use the `as` keyword to\n * cast the data returned from the API.\n *\n * These are equivalent:\n * ```ts\n * const joke = await fetch<TheChuckNorrisJoke>("https://api.chucknorris.io/jokes/random?category=dev");\n * const joke = await fetch("https://api.chucknorris.io/jokes/random?category=dev") as TheChuckNorrisJoke;\n * ```\n *\n * Alternatively, you can drop the type completely:\n *\n * ```ts\n * fetch("https://api.chucknorris.io/jokes/random?category=dev")\n * ```\n */\ninterface TheChuckNorrisJoke {\n icon_url: string;\n id: string;\n url: string;\n value: string;\n}\n\nWhen(a.ConfigMap)\n .IsCreated()\n .WithLabel("chuck-norris")\n .Mutate(async change => {\n // Try/catch is not needed as a response object will always be returned\n const response = await fetch<TheChuckNorrisJoke>(\n "https://api.chucknorris.io/jokes/random?category=dev",\n );\n\n // Instead, check the `response.ok` field\n if (response.ok) {\n // Add the Chuck Norris joke to the configmap\n change.Raw.data["chuck-says"] = response.data.value;\n return;\n }\n\n // You can also assert on different HTTP response codes\n if (response.status === fetchStatus.NOT_FOUND) {\n // Do something else\n return;\n }\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Secret Base64 Handling) *\n * ---------------------------------------------------------------------------------------------------\n *\n * The K8s JS client provides incomplete support for base64 encoding/decoding handling for secrets,\n * unlike the GO client. To make this less painful, Pepr automatically handles base64 encoding/decoding\n * secret data before and after the action is executed.\n */\nWhen(a.Secret)\n .IsCreated()\n .WithName("secret-1")\n .Mutate(request => {\n const secret = request.Raw;\n\n // This will be encoded at the end of all processing back to base64: "Y2hhbmdlLXdpdGhvdXQtZW5jb2Rpbmc="\n secret.data.magic = "change-without-encoding";\n\n // You can modify the data directly, and it will be encoded at the end of all processing\n secret.data.example += " - modified by Pepr";\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Untyped Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * Out of the box, Pepr supports all the standard Kubernetes objects. However, you can also create\n * your own types. This is useful if you are working with an Operator that creates custom resources.\n * There are two ways to do this, the first is to use the `When()` function with a `GenericKind`,\n * the second is to create a new class that extends `GenericKind` and use the `RegisterKind()` function.\n *\n * This example shows how to use the `When()` function with a `GenericKind`. Note that you\n * must specify the `group`, `version`, and `kind` of the object (if applicable). This is how Pepr knows\n * if the action should be triggered or not. Since we are using a `GenericKind`,\n * Pepr will not be able to provide any intellisense for the object, so you will need to refer to the\n * Kubernetes API documentation for the object you are working with.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-1\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```\n */\nWhen(a.GenericKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n})\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr without type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Typed Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This example shows how to use the `RegisterKind()` function to create a new type. This is useful\n * if you are working with an Operator that creates custom resources and you want to have intellisense\n * for the object. Note that you must specify the `group`, `version`, and `kind` of the object (if applicable)\n * as this is how Pepr knows if the action should be triggered or not.\n *\n * Once you register a new Kind with Pepr, you can use the `When()` function with the new Kind. Ideally,\n * you should register custom Kinds at the top of your Capability file or Pepr Module so they are available\n * to all actions, but we are putting it here for demonstration purposes.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-2\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```*\n */\nclass UnicornKind extends a.GenericKind {\n spec: {\n /**\n * JSDoc comments can be added to explain more details about the field.\n *\n * @example\n * ```ts\n * request.Raw.spec.message = "Hello Pepr!";\n * ```\n * */\n message: string;\n counter: number;\n };\n}\n\nRegisterKind(UnicornKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n});\n\nWhen(UnicornKind)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr with type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * A callback function that is called once the Pepr Store is fully loaded.\n */\nStore.onReady(data => {\n Log.info(data, "Pepr Store Ready");\n});\n';
1165
- var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, version: "0.14.2", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0'", "test:journey:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest journey/entrypoint.test.ts", "test:journey:run-wasm": "jest journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.7.0", pino: "8.16.0", "pino-pretty": "10.2.3", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "17.8.0", "@commitlint/config-conventional": "17.8.0", "@jest/globals": "29.7.0", "@types/eslint": "8.44.6", "@types/express": "4.17.20", "@types/node": "18.x.x", "@types/node-forge": "1.3.8", "@types/prompts": "2.4.7", "@types/ramda": "0.29.7", "@types/uuid": "9.0.6", jest: "29.7.0", nock: "13.3.4", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
1194
+ var helloPeprTS = 'import {\n Capability,\n K8s,\n Log,\n PeprMutateRequest,\n RegisterKind,\n a,\n fetch,\n fetchStatus,\n kind,\n} from "pepr";\n\n/**\n * The HelloPepr Capability is an example capability to demonstrate some general concepts of Pepr.\n * To test this capability you run `pepr dev`and then run the following command:\n * `kubectl apply -f capabilities/hello-pepr.samples.yaml`\n */\nexport const HelloPepr = new Capability({\n name: "hello-pepr",\n description: "A simple example capability to show how things work.",\n namespaces: ["pepr-demo", "pepr-demo-2"],\n});\n\n// Use the \'When\' function to create a new action, use \'Store\' to persist data\nconst { When, Store } = HelloPepr;\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action removes the label `remove-me` when a Namespace is created.\n * Note we don\'t need to specify the namespace here, because we\'ve already specified\n * it in the Capability definition above.\n */\nWhen(a.Namespace)\n .IsCreated()\n .Mutate(ns => ns.RemoveLabel("remove-me"));\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Watch Action with K8s SSA (Namespace) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action watches for the `pepr-demo-2` namespace to be created, then creates a ConfigMap with\n * the name `pepr-ssa-demo` and adds the namespace UID to the ConfigMap data. Because Pepr uses\n * server-side apply for this operation, the ConfigMap will be created or updated if it already exists.\n */\nWhen(a.Namespace)\n .IsCreated()\n .WithName("pepr-demo-2")\n .Watch(async ns => {\n Log.info("Namespace pepr-demo-2 was created.");\n\n try {\n // Apply the ConfigMap using K8s server-side apply\n await K8s(kind.ConfigMap).Apply({\n metadata: {\n name: "pepr-ssa-demo",\n namespace: "pepr-demo-2",\n },\n data: {\n "ns-uid": ns.metadata.uid,\n },\n });\n } catch (error) {\n // You can use the Log object to log messages to the Pepr controller pod\n Log.error(error, "Failed to apply ConfigMap using server-side apply.");\n }\n\n // You can share data between actions using the Store, including between different types of actions\n Store.setItem("watch-data", "This data was stored by a Watch Action.");\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 1) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is a single action. They can be in the same file or put imported from other files.\n * In this example, when a ConfigMap is created with the name `example-1`, then add a label and annotation.\n *\n * Equivalent to manually running:\n * `kubectl label configmap example-1 pepr=was-here`\n * `kubectl annotate configmap example-1 pepr.dev=annotations-work-too`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request\n .SetLabel("pepr", "was-here")\n .SetAnnotation("pepr.dev", "annotations-work-too");\n\n // Use the Store to persist data between requests and Pepr controller pods\n Store.setItem("example-1", "was-here");\n\n // This data is written asynchronously and can be read back via `Store.getItem()` or `Store.subscribe()`\n Store.setItem("example-1-data", JSON.stringify(request.Raw.data));\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate & Validate Actions (CM Example 2) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This combines 3 different types of actions: \'Mutate\', \'Validate\', and \'Watch\'. The order\n * of the actions is required, but each action is optional. In this example, when a ConfigMap is created\n * with the name `example-2`, then add a label and annotation, validate that the ConfigMap has the label\n * `pepr`, and log the request.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n // This Mutate Action will mutate the request before it is persisted to the cluster\n\n // Use `request.Merge()` to merge the new data with the existing data\n request.Merge({\n metadata: {\n labels: {\n pepr: "was-here",\n },\n annotations: {\n "pepr.dev": "annotations-work-too",\n },\n },\n });\n })\n .Validate(request => {\n // This Validate Action will validate the request before it is persisted to the cluster\n\n // Approve the request if the ConfigMap has the label \'pepr\'\n if (request.HasLabel("pepr")) {\n return request.Approve();\n }\n\n // Otherwise, deny the request with an error message (optional)\n return request.Deny("ConfigMap must have label \'pepr\'");\n })\n .Watch((cm, phase) => {\n // This Watch Action will watch the ConfigMap after it has been persisted to the cluster\n Log.info(cm, `ConfigMap was ${phase} with the name example-2`);\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 2a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action shows a simple validation that will deny any ConfigMap that has the\n * annotation `evil`. Note that the `Deny()` function takes an optional second parameter that is a\n * user-defined status code to return.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .Validate(request => {\n if (request.HasAnnotation("evil")) {\n return request.Deny("No evil CM annotations allowed.", 400);\n }\n\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 3) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action combines different styles. Unlike the previous actions, this one will look\n * for any ConfigMap in the `pepr-demo` namespace that has the label `change=by-label` during either\n * CREATE or UPDATE. Note that all conditions added such as `WithName()`, `WithLabel()`, `InNamespace()`,\n * are ANDs so all conditions must be true for the request to be processed.\n */\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel("change", "by-label")\n .Mutate(request => {\n // The K8s object e are going to mutate\n const cm = request.Raw;\n\n // Get the username and uid of the K8s request\n const { username, uid } = request.Request.userInfo;\n\n // Store some data about the request in the configmap\n cm.data["username"] = username;\n cm.data["uid"] = uid;\n\n // You can still mix other ways of making changes too\n request.SetAnnotation("pepr.dev", "making-waves");\n });\n\n// This action validates the label `change=by-label` is deleted\nWhen(a.ConfigMap)\n .IsDeleted()\n .WithLabel("change", "by-label")\n .Validate(request => {\n // Log and then always approve the request\n Log.info("CM with label \'change=by-label\' was deleted.");\n return request.Approve();\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action show how you can use the `Mutate()` function without an inline function.\n * This is useful if you want to keep your actions small and focused on a single task,\n * or if you want to reuse the same function in multiple actions.\n */\nWhen(a.ConfigMap).IsCreated().WithName("example-4").Mutate(example4Cb);\n\n// This function uses the complete type definition, but is not required.\nfunction example4Cb(cm: PeprMutateRequest<a.ConfigMap>) {\n cm.SetLabel("pepr.dev/first", "true");\n cm.SetLabel("pepr.dev/second", "true");\n cm.SetLabel("pepr.dev/third", "true");\n}\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 4a) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This is the same as Example 4, except this only operates on a CM in the `pepr-demo-2` namespace.\n * Note because the Capability defines namespaces, the namespace specified here must be one of those.\n * Alternatively, you can remove the namespace from the Capability definition and specify it here.\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .InNamespace("pepr-demo-2")\n .WithName("example-4a")\n .Mutate(example4Cb);\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (CM Example 5) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This action is a bit more complex. It will look for any ConfigMap in the `pepr-demo`\n * namespace that has the label `chuck-norris` during CREATE. When it finds one, it will fetch a\n * random Chuck Norris joke from the API and add it to the ConfigMap. This is a great example of how\n * you can use Pepr to make changes to your K8s objects based on external data.\n *\n * Note the use of the `async` keyword. This is required for any action that uses `await` or `fetch()`.\n *\n * Also note we are passing a type to the `fetch()` function. This is optional, but it will help you\n * avoid mistakes when working with the data returned from the API. You can also use the `as` keyword to\n * cast the data returned from the API.\n *\n * These are equivalent:\n * ```ts\n * const joke = await fetch<TheChuckNorrisJoke>("https://api.chucknorris.io/jokes/random?category=dev");\n * const joke = await fetch("https://api.chucknorris.io/jokes/random?category=dev") as TheChuckNorrisJoke;\n * ```\n *\n * Alternatively, you can drop the type completely:\n *\n * ```ts\n * fetch("https://api.chucknorris.io/jokes/random?category=dev")\n * ```\n */\ninterface TheChuckNorrisJoke {\n icon_url: string;\n id: string;\n url: string;\n value: string;\n}\n\nWhen(a.ConfigMap)\n .IsCreated()\n .WithLabel("chuck-norris")\n .Mutate(async change => {\n // Try/catch is not needed as a response object will always be returned\n const response = await fetch<TheChuckNorrisJoke>(\n "https://api.chucknorris.io/jokes/random?category=dev",\n );\n\n // Instead, check the `response.ok` field\n if (response.ok) {\n // Add the Chuck Norris joke to the configmap\n change.Raw.data["chuck-says"] = response.data.value;\n return;\n }\n\n // You can also assert on different HTTP response codes\n if (response.status === fetchStatus.NOT_FOUND) {\n // Do something else\n return;\n }\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Secret Base64 Handling) *\n * ---------------------------------------------------------------------------------------------------\n *\n * The K8s JS client provides incomplete support for base64 encoding/decoding handling for secrets,\n * unlike the GO client. To make this less painful, Pepr automatically handles base64 encoding/decoding\n * secret data before and after the action is executed.\n */\nWhen(a.Secret)\n .IsCreated()\n .WithName("secret-1")\n .Mutate(request => {\n const secret = request.Raw;\n\n // This will be encoded at the end of all processing back to base64: "Y2hhbmdlLXdpdGhvdXQtZW5jb2Rpbmc="\n secret.data.magic = "change-without-encoding";\n\n // You can modify the data directly, and it will be encoded at the end of all processing\n secret.data.example += " - modified by Pepr";\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Untyped Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * Out of the box, Pepr supports all the standard Kubernetes objects. However, you can also create\n * your own types. This is useful if you are working with an Operator that creates custom resources.\n * There are two ways to do this, the first is to use the `When()` function with a `GenericKind`,\n * the second is to create a new class that extends `GenericKind` and use the `RegisterKind()` function.\n *\n * This example shows how to use the `When()` function with a `GenericKind`. Note that you\n * must specify the `group`, `version`, and `kind` of the object (if applicable). This is how Pepr knows\n * if the action should be triggered or not. Since we are using a `GenericKind`,\n * Pepr will not be able to provide any intellisense for the object, so you will need to refer to the\n * Kubernetes API documentation for the object you are working with.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-1\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```\n */\nWhen(a.GenericKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n})\n .IsCreated()\n .WithName("example-1")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr without type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * ---------------------------------------------------------------------------------------------------\n * Mutate Action (Typed Custom Resource) *\n * ---------------------------------------------------------------------------------------------------\n *\n * This example shows how to use the `RegisterKind()` function to create a new type. This is useful\n * if you are working with an Operator that creates custom resources and you want to have intellisense\n * for the object. Note that you must specify the `group`, `version`, and `kind` of the object (if applicable)\n * as this is how Pepr knows if the action should be triggered or not.\n *\n * Once you register a new Kind with Pepr, you can use the `When()` function with the new Kind. Ideally,\n * you should register custom Kinds at the top of your Capability file or Pepr Module so they are available\n * to all actions, but we are putting it here for demonstration purposes.\n *\n * You will need to wait for the CRD in `hello-pepr.samples.yaml` to be created, then you can apply\n *\n * ```yaml\n * apiVersion: pepr.dev/v1\n * kind: Unicorn\n * metadata:\n * name: example-2\n * namespace: pepr-demo\n * spec:\n * message: replace-me\n * counter: 0\n * ```*\n */\nclass UnicornKind extends a.GenericKind {\n spec: {\n /**\n * JSDoc comments can be added to explain more details about the field.\n *\n * @example\n * ```ts\n * request.Raw.spec.message = "Hello Pepr!";\n * ```\n * */\n message: string;\n counter: number;\n };\n}\n\nRegisterKind(UnicornKind, {\n group: "pepr.dev",\n version: "v1",\n kind: "Unicorn",\n});\n\nWhen(UnicornKind)\n .IsCreated()\n .WithName("example-2")\n .Mutate(request => {\n request.Merge({\n spec: {\n message: "Hello Pepr with type data!",\n counter: Math.random(),\n },\n });\n });\n\n/**\n * A callback function that is called once the Pepr Store is fully loaded.\n */\nStore.onReady(data => {\n Log.info(data, "Pepr Store Ready");\n});\n';
1195
+ var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, version: "0.15.0", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "test:journey:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.8.0", pino: "8.16.1", "pino-pretty": "10.2.3", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "18.2.0", "@commitlint/config-conventional": "18.1.0", "@jest/globals": "29.7.0", "@types/eslint": "8.44.6", "@types/express": "4.17.20", "@types/node": "18.x.x", "@types/node-forge": "1.3.8", "@types/prompts": "2.4.7", "@types/ramda": "0.29.7", "@types/uuid": "9.0.6", jest: "29.7.0", nock: "13.3.6", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
1166
1196
 
1167
1197
  // src/templates/pepr.code-snippets.json
1168
1198
  var pepr_code_snippets_default = {
@@ -1384,6 +1414,7 @@ async function peprFormat(validateOnly) {
1384
1414
  }
1385
1415
 
1386
1416
  // src/cli/build.ts
1417
+ var import_commander = require("commander");
1387
1418
  var peprTS2 = "pepr.ts";
1388
1419
  function build_default(program2) {
1389
1420
  program2.command("build").description("Build a Pepr Module for deployment").option(
@@ -1392,7 +1423,9 @@ function build_default(program2) {
1392
1423
  peprTS2
1393
1424
  ).option(
1394
1425
  "-r, --registry-info [<registry>/<username>]",
1395
- "Where to upload the image. Note: You must be signed into the registry"
1426
+ "Registry Info: Image registry and username. Note: You must be signed into the registry"
1427
+ ).addOption(
1428
+ new import_commander.Option("--rbac-mode [admin|scoped]", "Rbac Mode: admin, scoped (default: admin)").choices(["admin", "scoped"]).default("admin")
1396
1429
  ).action(async (opts) => {
1397
1430
  const { cfg, path, uuid } = await buildModule(void 0, opts.entryPoint);
1398
1431
  const { includedFiles } = cfg.pepr;
@@ -1423,7 +1456,7 @@ function build_default(program2) {
1423
1456
  }
1424
1457
  const yamlFile = `pepr-module-${uuid}.yaml`;
1425
1458
  const yamlPath = (0, import_path.resolve)("dist", yamlFile);
1426
- const yaml = await assets.allYaml();
1459
+ const yaml = await assets.allYaml(opts.rbacMode);
1427
1460
  const zarfPath = (0, import_path.resolve)("dist", "zarf.yaml");
1428
1461
  const zarf = assets.zarfYaml(yamlFile);
1429
1462
  await import_fs6.promises.writeFile(yamlPath, yaml);
@@ -1797,11 +1830,11 @@ function init_default(program2) {
1797
1830
  }
1798
1831
 
1799
1832
  // src/cli/root.ts
1800
- var import_commander = require("commander");
1801
- var RootCmd = class extends import_commander.Command {
1833
+ var import_commander2 = require("commander");
1834
+ var RootCmd = class extends import_commander2.Command {
1802
1835
  // eslint-disable-next-line class-methods-use-this
1803
1836
  createCommand(name2) {
1804
- const cmd = new import_commander.Command(name2);
1837
+ const cmd = new import_commander2.Command(name2);
1805
1838
  cmd.option("-l, --log-level [level]", "Log level: debug, info, warn, error", "info");
1806
1839
  cmd.hook("preAction", (run) => {
1807
1840
  logger_default.level = run.opts().logLevel;
@@ -48,7 +48,7 @@ if (process.env.LOG_LEVEL) {
48
48
  var logger_default = Log;
49
49
 
50
50
  // src/templates/data.json
51
- var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, version: "0.14.2", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0'", "test:journey:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest journey/entrypoint.test.ts", "test:journey:run-wasm": "jest journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.7.0", pino: "8.16.0", "pino-pretty": "10.2.3", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "17.8.0", "@commitlint/config-conventional": "17.8.0", "@jest/globals": "29.7.0", "@types/eslint": "8.44.6", "@types/express": "4.17.20", "@types/node": "18.x.x", "@types/node-forge": "1.3.8", "@types/prompts": "2.4.7", "@types/ramda": "0.29.7", "@types/uuid": "9.0.6", jest: "29.7.0", nock: "13.3.4", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
51
+ var packageJSON = { name: "pepr", description: "Kubernetes application engine", author: "Defense Unicorns", homepage: "https://github.com/defenseunicorns/pepr", license: "Apache-2.0", bin: "dist/cli.js", repository: "defenseunicorns/pepr", engines: { node: ">=18.0.0" }, version: "0.15.0", main: "dist/lib.js", types: "dist/lib.d.ts", scripts: { "gen-data-json": "node hack/build-template-data.js", prebuild: "rm -fr dist/* && npm run gen-data-json", build: "tsc && node build.mjs", test: "npm run test:unit && npm run test:journey", "test:unit": "npm run gen-data-json && jest src --coverage", "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run", "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm", "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system", "test:journey:build": "npm run build && npm pack", "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev", "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts", "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts", "format:check": "eslint src && prettier src --check", "format:fix": "eslint src --fix && prettier src --write" }, dependencies: { express: "4.18.2", "fast-json-patch": "3.1.1", "kubernetes-fluent-client": "1.8.0", pino: "8.16.1", "pino-pretty": "10.2.3", "prom-client": "15.0.0", ramda: "0.29.1" }, devDependencies: { "@commitlint/cli": "18.2.0", "@commitlint/config-conventional": "18.1.0", "@jest/globals": "29.7.0", "@types/eslint": "8.44.6", "@types/express": "4.17.20", "@types/node": "18.x.x", "@types/node-forge": "1.3.8", "@types/prompts": "2.4.7", "@types/ramda": "0.29.7", "@types/uuid": "9.0.6", jest: "29.7.0", nock: "13.3.6", "ts-jest": "29.1.1" }, peerDependencies: { "@typescript-eslint/eslint-plugin": "6.7.3", "@typescript-eslint/parser": "6.7.3", commander: "11.0.0", esbuild: "0.19.4", eslint: "8.50.0", "node-forge": "1.3.1", prettier: "3.0.3", prompts: "2.4.2", typescript: "5.2.2", uuid: "9.0.1" } };
52
52
 
53
53
  // src/runtime/controller.ts
54
54
  var { version } = packageJSON;
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/deploy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAQ3B,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,iBA8CnE"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/deploy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAS3B,wBAAsB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,iBA8CnE"}
@@ -13,6 +13,6 @@ export declare class Assets {
13
13
  constructor(config: ModuleConfig, path: string, host?: string | undefined);
14
14
  deploy: (webhookTimeout?: number) => Promise<void>;
15
15
  zarfYaml: (path: string) => string;
16
- allYaml: () => Promise<string>;
16
+ allYaml: (rbacMode: string) => Promise<string>;
17
17
  }
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAK5C,qBAAa,MAAM;IAQf,QAAQ,CAAC,MAAM,EAAE,YAAY;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,CAAC;IAThB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAG,gBAAgB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;gBAGH,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,oBAAQ;IAaxB,MAAM,oBAA2B,MAAM,mBAGrC;IAEF,QAAQ,SAAU,MAAM,YAA0B;IAElD,OAAO,wBAGL;CACH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAK5C,qBAAa,MAAM;IAQf,QAAQ,CAAC,MAAM,EAAE,YAAY;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,CAAC;IAThB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAG,gBAAgB,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;gBAGH,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,oBAAQ;IAaxB,MAAM,oBAA2B,MAAM,mBAGrC;IAEF,QAAQ,SAAU,MAAM,YAA0B;IAElD,OAAO,aAAoB,MAAM,qBAG/B;CACH"}
@@ -1,11 +1,12 @@
1
1
  import { kind } from "kubernetes-fluent-client";
2
+ import { CapabilityExport } from "../types";
2
3
  /**
3
4
  * Grants the controller access to cluster resources beyond the mutating webhook.
4
5
  *
5
6
  * @todo: should dynamically generate this based on resources used by the module. will also need to explore how this should work for multiple modules.
6
7
  * @returns
7
8
  */
8
- export declare function clusterRole(name: string): kind.ClusterRole;
9
+ export declare function clusterRole(name: string, capabilities: CapabilityExport[], rbacMode?: string): kind.ClusterRole;
9
10
  export declare function clusterRoleBinding(name: string): kind.ClusterRoleBinding;
10
11
  export declare function serviceAccount(name: string): kind.ServiceAccount;
11
12
  export declare function storeRole(name: string): kind.Role;
@@ -1 +1 @@
1
- {"version":3,"file":"rbac.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/rbac.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,WAAW,CAc1D;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAkBxE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,cAAc,CAShE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAejD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,WAAW,CAmB/D"}
1
+ {"version":3,"file":"rbac.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/rbac.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,QAAQ,GAAE,MAAW,GAAG,IAAI,CAAC,WAAW,CA6BnH;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAkBxE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,cAAc,CAShE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAejD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,WAAW,CAmB/D"}
@@ -1,4 +1,4 @@
1
1
  import { Assets } from ".";
2
2
  export declare function zarfYaml({ name, image, config }: Assets, path: string): string;
3
- export declare function allYaml(assets: Assets): Promise<string>;
3
+ export declare function allYaml(assets: Assets, rbacMode: string): Promise<string>;
4
4
  //# sourceMappingURL=yaml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/yaml.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAO3B,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UA0BrE;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,mBA0C3C"}
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../../src/lib/assets/yaml.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAO3B,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UA0BrE;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBA0C7D"}
@@ -0,0 +1,11 @@
1
+ import { CapabilityExport } from "./types";
2
+ type RBACMap = {
3
+ [key: string]: {
4
+ verbs: string[];
5
+ plural: string;
6
+ };
7
+ };
8
+ export declare const addVerbIfNotExists: (verbs: string[], verb: string) => void;
9
+ export declare const createRBACMap: (capabilities: CapabilityExport[]) => RBACMap;
10
+ export {};
11
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,KAAK,OAAO,GAAG;IACb,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,MAAM,EAAE,QAAQ,MAAM,SAI/D,CAAC;AAEF,eAAO,MAAM,aAAa,iBAAkB,gBAAgB,EAAE,KAAG,OAoBhE,CAAC"}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "engines": {
10
10
  "node": ">=18.0.0"
11
11
  },
12
- "version": "0.14.2",
12
+ "version": "0.15.0",
13
13
  "main": "dist/lib.js",
14
14
  "types": "dist/lib.d.ts",
15
15
  "scripts": {
@@ -20,26 +20,26 @@
20
20
  "test:unit": "npm run gen-data-json && jest src --coverage",
21
21
  "test:journey": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run",
22
22
  "test:journey-wasm": "npm run test:journey:k3d && npm run test:journey:build && npm run test:journey:image && npm run test:journey:run-wasm",
23
- "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0'",
23
+ "test:journey:k3d": "k3d cluster delete pepr-dev && k3d cluster create pepr-dev --k3s-arg '--debug@server:0' --wait && kubectl rollout status deployment -n kube-system",
24
24
  "test:journey:build": "npm run build && npm pack",
25
25
  "test:journey:image": "docker buildx build --tag pepr:dev . && k3d image import pepr:dev -c pepr-dev",
26
- "test:journey:run": "jest journey/entrypoint.test.ts",
27
- "test:journey:run-wasm": "jest journey/entrypoint-wasm.test.ts",
26
+ "test:journey:run": "jest --detectOpenHandles journey/entrypoint.test.ts",
27
+ "test:journey:run-wasm": "jest --detectOpenHandles journey/entrypoint-wasm.test.ts",
28
28
  "format:check": "eslint src && prettier src --check",
29
29
  "format:fix": "eslint src --fix && prettier src --write"
30
30
  },
31
31
  "dependencies": {
32
32
  "express": "4.18.2",
33
33
  "fast-json-patch": "3.1.1",
34
- "kubernetes-fluent-client": "1.7.0",
35
- "pino": "8.16.0",
34
+ "kubernetes-fluent-client": "1.8.0",
35
+ "pino": "8.16.1",
36
36
  "pino-pretty": "10.2.3",
37
37
  "prom-client": "15.0.0",
38
38
  "ramda": "0.29.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@commitlint/cli": "17.8.0",
42
- "@commitlint/config-conventional": "17.8.0",
41
+ "@commitlint/cli": "18.2.0",
42
+ "@commitlint/config-conventional": "18.1.0",
43
43
  "@jest/globals": "29.7.0",
44
44
  "@types/eslint": "8.44.6",
45
45
  "@types/express": "4.17.20",
@@ -49,7 +49,7 @@
49
49
  "@types/ramda": "0.29.7",
50
50
  "@types/uuid": "9.0.6",
51
51
  "jest": "29.7.0",
52
- "nock": "13.3.4",
52
+ "nock": "13.3.6",
53
53
  "ts-jest": "29.1.1"
54
54
  },
55
55
  "peerDependencies": {
@@ -12,6 +12,7 @@ import { deployment, moduleSecret, namespace, watcher } from "./pods";
12
12
  import { clusterRole, clusterRoleBinding, serviceAccount, storeRole, storeRoleBinding } from "./rbac";
13
13
  import { peprStoreCRD } from "./store";
14
14
  import { webhookConfig } from "./webhooks";
15
+ import { CapabilityExport } from "../types";
15
16
 
16
17
  export async function deploy(assets: Assets, webhookTimeout?: number) {
17
18
  Log.info("Establishing connection to Kubernetes");
@@ -56,18 +57,18 @@ export async function deploy(assets: Assets, webhookTimeout?: number) {
56
57
  throw new Error("No code provided");
57
58
  }
58
59
 
59
- await setupRBAC(name);
60
+ await setupRBAC(name, assets.capabilities);
60
61
  await setupController(assets, code, hash);
61
62
  await setupWatcher(assets, hash);
62
63
  }
63
64
 
64
- async function setupRBAC(name: string) {
65
+ async function setupRBAC(name: string, capabilities: CapabilityExport[]) {
65
66
  Log.info("Applying cluster role binding");
66
67
  const crb = clusterRoleBinding(name);
67
68
  await K8s(kind.ClusterRoleBinding).Apply(crb);
68
69
 
69
70
  Log.info("Applying cluster role");
70
- const cr = clusterRole(name);
71
+ const cr = clusterRole(name, capabilities);
71
72
  await K8s(kind.ClusterRole).Apply(cr);
72
73
 
73
74
  Log.info("Applying service account");
@@ -40,8 +40,8 @@ export class Assets {
40
40
 
41
41
  zarfYaml = (path: string) => zarfYaml(this, path);
42
42
 
43
- allYaml = async () => {
43
+ allYaml = async (rbacMode: string) => {
44
44
  this.capabilities = await loadCapabilities(this.path);
45
- return allYaml(this);
45
+ return allYaml(this, rbacMode);
46
46
  };
47
47
  }
@@ -2,26 +2,42 @@
2
2
  // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
3
3
 
4
4
  import { kind } from "kubernetes-fluent-client";
5
-
5
+ import { CapabilityExport } from "../types";
6
+ import { createRBACMap } from "../helpers";
6
7
  /**
7
8
  * Grants the controller access to cluster resources beyond the mutating webhook.
8
9
  *
9
10
  * @todo: should dynamically generate this based on resources used by the module. will also need to explore how this should work for multiple modules.
10
11
  * @returns
11
12
  */
12
- export function clusterRole(name: string): kind.ClusterRole {
13
+ export function clusterRole(name: string, capabilities: CapabilityExport[], rbacMode: string = ""): kind.ClusterRole {
14
+ const rbacMap = createRBACMap(capabilities);
13
15
  return {
14
16
  apiVersion: "rbac.authorization.k8s.io/v1",
15
17
  kind: "ClusterRole",
16
18
  metadata: { name },
17
- rules: [
18
- {
19
- // @todo: make this configurable
20
- apiGroups: ["*"],
21
- resources: ["*"],
22
- verbs: ["create", "delete", "get", "list", "patch", "update", "watch"],
23
- },
24
- ],
19
+ rules:
20
+ rbacMode === "scoped"
21
+ ? [
22
+ ...Object.keys(rbacMap).map(key => {
23
+ // let group:string, version:string, kind:string;
24
+ let group: string;
25
+ key.split("/").length < 3 ? (group = "") : (group = key.split("/")[0]);
26
+
27
+ return {
28
+ apiGroups: [group],
29
+ resources: [rbacMap[key].plural],
30
+ verbs: rbacMap[key].verbs,
31
+ };
32
+ }),
33
+ ]
34
+ : [
35
+ {
36
+ apiGroups: ["*"],
37
+ resources: ["*"],
38
+ verbs: ["create", "delete", "get", "list", "patch", "update", "watch"],
39
+ },
40
+ ],
25
41
  };
26
42
  }
27
43
 
@@ -64,7 +80,7 @@ export function storeRole(name: string): kind.Role {
64
80
  metadata: { name, namespace: "pepr-system" },
65
81
  rules: [
66
82
  {
67
- apiGroups: ["pepr.dev/*"],
83
+ apiGroups: ["pepr.dev"],
68
84
  resources: ["peprstores"],
69
85
  resourceNames: [""],
70
86
  verbs: ["create", "get", "patch", "watch"],
@@ -40,7 +40,7 @@ export function zarfYaml({ name, image, config }: Assets, path: string) {
40
40
  return dumpYaml(zarfCfg, { noRefs: true });
41
41
  }
42
42
 
43
- export async function allYaml(assets: Assets) {
43
+ export async function allYaml(assets: Assets, rbacMode: string) {
44
44
  const { name, tls, apiToken, path } = assets;
45
45
 
46
46
  const code = await fs.readFile(path);
@@ -54,7 +54,7 @@ export async function allYaml(assets: Assets) {
54
54
 
55
55
  const resources = [
56
56
  namespace,
57
- clusterRole(name),
57
+ clusterRole(name, assets.capabilities, rbacMode),
58
58
  clusterRoleBinding(name),
59
59
  serviceAccount(name),
60
60
  apiTokenSecret(name, apiToken),
@@ -0,0 +1,39 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
3
+
4
+ import { CapabilityExport } from "./types";
5
+
6
+ type RBACMap = {
7
+ [key: string]: {
8
+ verbs: string[];
9
+ plural: string;
10
+ };
11
+ };
12
+
13
+ export const addVerbIfNotExists = (verbs: string[], verb: string) => {
14
+ if (!verbs.includes(verb)) {
15
+ verbs.push(verb);
16
+ }
17
+ };
18
+
19
+ export const createRBACMap = (capabilities: CapabilityExport[]): RBACMap => {
20
+ return capabilities.reduce((acc: RBACMap, capability: CapabilityExport) => {
21
+ capability.bindings.forEach(binding => {
22
+ const key = `${binding.kind.group}/${binding.kind.version}/${binding.kind.kind}`;
23
+
24
+ acc["pepr.dev/v1/peprstore"] = {
25
+ verbs: ["create", "get", "patch", "watch"],
26
+ plural: "peprstores",
27
+ };
28
+
29
+ if (!acc[key] && binding.isWatch) {
30
+ acc[key] = {
31
+ verbs: ["watch"],
32
+ plural: binding.kind.plural || `${binding.kind.kind.toLowerCase()}s`,
33
+ };
34
+ }
35
+ });
36
+
37
+ return acc;
38
+ }, {});
39
+ };
@@ -52,19 +52,24 @@ When(a.Namespace)
52
52
  .Watch(async ns => {
53
53
  Log.info("Namespace pepr-demo-2 was created.");
54
54
 
55
+ try {
56
+ // Apply the ConfigMap using K8s server-side apply
57
+ await K8s(kind.ConfigMap).Apply({
58
+ metadata: {
59
+ name: "pepr-ssa-demo",
60
+ namespace: "pepr-demo-2",
61
+ },
62
+ data: {
63
+ "ns-uid": ns.metadata.uid,
64
+ },
65
+ });
66
+ } catch (error) {
67
+ // You can use the Log object to log messages to the Pepr controller pod
68
+ Log.error(error, "Failed to apply ConfigMap using server-side apply.");
69
+ }
70
+
55
71
  // You can share data between actions using the Store, including between different types of actions
56
72
  Store.setItem("watch-data", "This data was stored by a Watch Action.");
57
-
58
- // Apply the ConfigMap using K8s server-side apply
59
- await K8s(kind.ConfigMap).Apply({
60
- metadata: {
61
- name: "pepr-ssa-demo",
62
- namespace: "pepr-demo-2",
63
- },
64
- data: {
65
- "ns-uid": ns.metadata.uid,
66
- },
67
- });
68
73
  });
69
74
 
70
75
  /**
@@ -0,0 +1,8 @@
1
+ {
2
+ "recurse": true,
3
+ "skip": "^(https://example.com), ^(https://github.com), ^(https://twitter.com)",
4
+ "verbosity": "error",
5
+ "timeout": 0,
6
+ "markdown": true,
7
+ "directoryListing": true
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "default": true,
3
+ "MD033": false,
4
+ "MD013": false,
5
+ "MD036": false
6
+ }
@@ -0,0 +1,12 @@
1
+ public/
2
+ node_modules/
3
+ .cache
4
+ .history
5
+ dist
6
+ coverage
7
+ docs/app
8
+ __mocks__
9
+ userguide/
10
+ .release-please-manifest.json
11
+ CHANGELOG.md
12
+ .vscode/