pepr 0.3.1 → 0.4.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 (104) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +1420 -0
  5. package/dist/controller.js +157 -0
  6. package/dist/{src/lib → lib}/capability.d.ts +1 -1
  7. package/dist/lib/capability.d.ts.map +1 -0
  8. package/dist/lib/controller.d.ts.map +1 -0
  9. package/dist/{src/lib → lib}/fetch.d.ts +1 -2
  10. package/dist/lib/fetch.d.ts.map +1 -0
  11. package/dist/{src/lib → lib}/filter.d.ts +1 -1
  12. package/dist/lib/filter.d.ts.map +1 -0
  13. package/dist/lib/k8s/index.d.ts.map +1 -0
  14. package/dist/lib/k8s/kinds.d.ts.map +1 -0
  15. package/dist/lib/k8s/tls.d.ts.map +1 -0
  16. package/dist/lib/k8s/types.d.ts.map +1 -0
  17. package/dist/{src/lib → lib}/k8s/upstream.d.ts +2 -2
  18. package/dist/lib/k8s/upstream.d.ts.map +1 -0
  19. package/dist/{src/lib → lib}/k8s/webhook.d.ts +1 -1
  20. package/dist/lib/k8s/webhook.d.ts.map +1 -0
  21. package/dist/lib/logger.d.ts.map +1 -0
  22. package/dist/lib/module.d.ts.map +1 -0
  23. package/dist/lib/processor.d.ts.map +1 -0
  24. package/dist/{src/lib → lib}/request.d.ts +1 -1
  25. package/dist/lib/request.d.ts.map +1 -0
  26. package/dist/{src/lib → lib}/types.d.ts +5 -1
  27. package/dist/lib/types.d.ts.map +1 -0
  28. package/dist/{src/lib/index.d.ts → lib.d.ts} +8 -8
  29. package/dist/lib.d.ts.map +1 -0
  30. package/dist/lib.js +1150 -0
  31. package/dist/lib.js.map +7 -0
  32. package/package.json +13 -17
  33. package/src/cli.ts +37 -0
  34. package/src/lib/capability.ts +2 -1
  35. package/src/lib/controller.ts +15 -1
  36. package/src/lib/fetch.ts +3 -2
  37. package/src/lib/filter.ts +1 -1
  38. package/src/lib/k8s/upstream.ts +2 -2
  39. package/src/lib/k8s/webhook.ts +8 -3
  40. package/src/lib/module.ts +3 -2
  41. package/src/lib/processor.ts +2 -2
  42. package/src/lib/request.ts +4 -4
  43. package/src/lib/types.ts +6 -1
  44. package/src/{lib/index.ts → lib.ts} +7 -7
  45. package/dist/package.json +0 -66
  46. package/dist/src/cli/banner.js +0 -70
  47. package/dist/src/cli/build.js +0 -120
  48. package/dist/src/cli/capability.js +0 -14
  49. package/dist/src/cli/deploy.js +0 -54
  50. package/dist/src/cli/dev.js +0 -114
  51. package/dist/src/cli/index.js +0 -35
  52. package/dist/src/cli/init/index.js +0 -81
  53. package/dist/src/cli/init/templates/.prettierrc.json +0 -13
  54. package/dist/src/cli/init/templates/capabilities/hello-pepr.samples.json +0 -115
  55. package/dist/src/cli/init/templates/data.json +0 -1
  56. package/dist/src/cli/init/templates/pepr.code-snippets.json +0 -21
  57. package/dist/src/cli/init/templates/tsconfig.module.json +0 -12
  58. package/dist/src/cli/init/templates.js +0 -96
  59. package/dist/src/cli/init/utils.js +0 -56
  60. package/dist/src/cli/init/walkthrough.js +0 -84
  61. package/dist/src/cli/root.js +0 -21
  62. package/dist/src/cli/run.js +0 -58
  63. package/dist/src/cli/test.js +0 -50
  64. package/dist/src/cli/update.js +0 -58
  65. package/dist/src/lib/capability.d.ts.map +0 -1
  66. package/dist/src/lib/capability.js +0 -125
  67. package/dist/src/lib/controller.d.ts.map +0 -1
  68. package/dist/src/lib/controller.js +0 -108
  69. package/dist/src/lib/fetch.d.ts.map +0 -1
  70. package/dist/src/lib/fetch.js +0 -92
  71. package/dist/src/lib/filter.d.ts.map +0 -1
  72. package/dist/src/lib/filter.js +0 -77
  73. package/dist/src/lib/index.d.ts.map +0 -1
  74. package/dist/src/lib/index.js +0 -26
  75. package/dist/src/lib/k8s/index.d.ts.map +0 -1
  76. package/dist/src/lib/k8s/index.js +0 -39
  77. package/dist/src/lib/k8s/kinds.d.ts.map +0 -1
  78. package/dist/src/lib/k8s/kinds.js +0 -447
  79. package/dist/src/lib/k8s/tls.d.ts.map +0 -1
  80. package/dist/src/lib/k8s/tls.js +0 -74
  81. package/dist/src/lib/k8s/types.d.ts.map +0 -1
  82. package/dist/src/lib/k8s/types.js +0 -20
  83. package/dist/src/lib/k8s/upstream.d.ts.map +0 -1
  84. package/dist/src/lib/k8s/upstream.js +0 -50
  85. package/dist/src/lib/k8s/webhook.d.ts.map +0 -1
  86. package/dist/src/lib/k8s/webhook.js +0 -502
  87. package/dist/src/lib/logger.d.ts.map +0 -1
  88. package/dist/src/lib/logger.js +0 -125
  89. package/dist/src/lib/module.d.ts.map +0 -1
  90. package/dist/src/lib/module.js +0 -43
  91. package/dist/src/lib/processor.d.ts.map +0 -1
  92. package/dist/src/lib/processor.js +0 -85
  93. package/dist/src/lib/request.d.ts.map +0 -1
  94. package/dist/src/lib/request.js +0 -124
  95. package/dist/src/lib/types.d.ts.map +0 -1
  96. package/dist/src/lib/types.js +0 -34
  97. /package/dist/{src/lib → lib}/controller.d.ts +0 -0
  98. /package/dist/{src/lib → lib}/k8s/index.d.ts +0 -0
  99. /package/dist/{src/lib → lib}/k8s/kinds.d.ts +0 -0
  100. /package/dist/{src/lib → lib}/k8s/tls.d.ts +0 -0
  101. /package/dist/{src/lib → lib}/k8s/types.d.ts +0 -0
  102. /package/dist/{src/lib → lib}/logger.d.ts +0 -0
  103. /package/dist/{src/lib → lib}/module.d.ts +0 -0
  104. /package/dist/{src/lib → lib}/processor.d.ts +0 -0
@@ -1,85 +0,0 @@
1
- "use strict";
2
- // SPDX-License-Identifier: Apache-2.0
3
- // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.processor = void 0;
9
- const fast_json_patch_1 = require("fast-json-patch");
10
- const filter_1 = require("./filter");
11
- const logger_1 = __importDefault(require("./logger"));
12
- const request_1 = require("./request");
13
- async function processor(config, capabilities, req) {
14
- const wrapped = new request_1.PeprRequest(req);
15
- const response = {
16
- uid: req.uid,
17
- warnings: [],
18
- allowed: false,
19
- };
20
- logger_1.default.info(`Processing '${req.uid}' for '${req.kind.kind}' '${req.name}'`);
21
- for (const { name, bindings } of capabilities) {
22
- const prefix = `${req.uid} ${req.name}: ${name}`;
23
- logger_1.default.info(`Processing capability ${name}`, prefix);
24
- for (const action of bindings) {
25
- // Continue to the next action without doing anything if this one should be skipped
26
- if ((0, filter_1.shouldSkipRequest)(action, req)) {
27
- continue;
28
- }
29
- logger_1.default.info(`Processing matched action ${action.kind.kind}`, prefix);
30
- // Add annotations to the request to indicate that the capability started processing
31
- // this will allow tracking of failed mutations that were permitted to continue
32
- const updateStatus = (status) => {
33
- // Only update the status if the request is a CREATE or UPDATE (we don't use CONNECT)
34
- if (req.operation == "DELETE") {
35
- return;
36
- }
37
- const identifier = `${config.uuid}.pepr.dev/${name}`;
38
- wrapped.Raw.metadata = wrapped.Raw.metadata || {};
39
- wrapped.Raw.metadata.annotations = wrapped.Raw.metadata.annotations || {};
40
- wrapped.Raw.metadata.annotations[identifier] = status;
41
- };
42
- updateStatus("started");
43
- try {
44
- // Run the action
45
- await action.callback(wrapped);
46
- logger_1.default.info(`Action succeeded`, prefix);
47
- // Add annotations to the request to indicate that the capability succeeded
48
- updateStatus("succeeded");
49
- }
50
- catch (e) {
51
- // Annoying ts false positive
52
- response.warnings = response.warnings || [];
53
- response.warnings.push(`Action failed: ${e}`);
54
- // If errors are not allowed, note the failure in the Response
55
- if (config.onError) {
56
- logger_1.default.error(`Action failed: ${e}`, prefix);
57
- response.result = "Pepr module configured to reject on error";
58
- return response;
59
- }
60
- else {
61
- logger_1.default.warn(`Action failed: ${e}`, prefix);
62
- updateStatus("warning");
63
- }
64
- }
65
- }
66
- }
67
- // If we've made it this far, the request is allowed
68
- response.allowed = true;
69
- // Compare the original request to the modified request to get the patches
70
- const patches = (0, fast_json_patch_1.compare)(req.object, wrapped.Raw);
71
- // Only add the patch if there are patches to apply
72
- if (patches.length > 0) {
73
- response.patchType = "JSONPatch";
74
- // Webhook must be base64-encoded
75
- // https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#response
76
- response.patch = Buffer.from(JSON.stringify(patches)).toString("base64");
77
- }
78
- // Remove the warnings array if it's empty
79
- if (response.warnings && response.warnings.length < 1) {
80
- delete response.warnings;
81
- }
82
- logger_1.default.debug(patches);
83
- return response;
84
- }
85
- exports.processor = processor;
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/lib/request.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;GAGG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,gBAAgB;IACjD,OAAO,CAAC,MAAM,CAAa;IAEpB,GAAG,EAAE,CAAC,CAAC;IAEd,IAAI,iBAAiB,YAEpB;IAED;;;OAGG;IACH,IAAI,QAAQ,wBAEX;IAED;;;OAGG;IACH,IAAI,WAAW,kBAEd;IAED;;;OAGG;IACH,IAAI,OAAO,eAEV;IAED;;;OAGG;gBACS,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAO7B;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;IAIzB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAUnC;;;;;OAKG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAUxC;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM;IAOvB;;;;OAIG;IACH,gBAAgB,CAAC,GAAG,EAAE,MAAM;IAO5B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM;IAIpB;;;;;OAKG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM;CAG1B"}
@@ -1,124 +0,0 @@
1
- "use strict";
2
- // SPDX-License-Identifier: Apache-2.0
3
- // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.PeprRequest = void 0;
9
- const ramda_1 = __importDefault(require("ramda"));
10
- /**
11
- * The RequestWrapper class provides methods to modify Kubernetes objects in the context
12
- * of a mutating webhook request.
13
- */
14
- class PeprRequest {
15
- get PermitSideEffects() {
16
- return !this._input.dryRun;
17
- }
18
- /**
19
- * Indicates whether the request is a dry run.
20
- * @returns true if the request is a dry run, false otherwise.
21
- */
22
- get IsDryRun() {
23
- return this._input.dryRun;
24
- }
25
- /**
26
- * Provides access to the old resource in the request if available.
27
- * @returns The old Kubernetes resource object or null if not available.
28
- */
29
- get OldResource() {
30
- return this._input.oldObject;
31
- }
32
- /**
33
- * Provides access to the request object.
34
- * @returns The request object containing the Kubernetes resource.
35
- */
36
- get Request() {
37
- return this._input;
38
- }
39
- /**
40
- * Creates a new instance of the Action class.
41
- * @param input - The request object containing the Kubernetes resource to modify.
42
- */
43
- constructor(input) {
44
- // Deep clone the object to prevent mutation of the original object
45
- this.Raw = ramda_1.default.clone(input.object);
46
- // Store the input
47
- this._input = input;
48
- }
49
- /**
50
- * Deep merges the provided object with the current resource.
51
- *
52
- * @param obj - The object to merge with the current resource.
53
- */
54
- Merge(obj) {
55
- this.Raw = ramda_1.default.mergeDeepRight(this.Raw, obj);
56
- }
57
- /**
58
- * Updates a label on the Kubernetes resource.
59
- * @param key - The key of the label to update.
60
- * @param value - The value of the label.
61
- * @returns The current Action instance for method chaining.
62
- */
63
- SetLabel(key, value) {
64
- const ref = this.Raw;
65
- ref.metadata = ref.metadata ?? {};
66
- ref.metadata.labels = ref.metadata.labels ?? {};
67
- ref.metadata.labels[key] = value;
68
- return this;
69
- }
70
- /**
71
- * Updates an annotation on the Kubernetes resource.
72
- * @param key - The key of the annotation to update.
73
- * @param value - The value of the annotation.
74
- * @returns The current Action instance for method chaining.
75
- */
76
- SetAnnotation(key, value) {
77
- const ref = this.Raw;
78
- ref.metadata = ref.metadata ?? {};
79
- ref.metadata.annotations = ref.metadata.annotations ?? {};
80
- ref.metadata.annotations[key] = value;
81
- return this;
82
- }
83
- /**
84
- * Removes a label from the Kubernetes resource.
85
- * @param key - The key of the label to remove.
86
- * @returns The current Action instance for method chaining.
87
- */
88
- RemoveLabel(key) {
89
- if (this.Raw.metadata?.labels?.[key]) {
90
- delete this.Raw.metadata.labels[key];
91
- }
92
- return this;
93
- }
94
- /**
95
- * Removes an annotation from the Kubernetes resource.
96
- * @param key - The key of the annotation to remove.
97
- * @returns The current Action instance for method chaining.
98
- */
99
- RemoveAnnotation(key) {
100
- if (this.Raw.metadata?.annotations?.[key]) {
101
- delete this.Raw.metadata.annotations[key];
102
- }
103
- return this;
104
- }
105
- /**
106
- * Check if a label exists on the Kubernetes resource.
107
- *
108
- * @param key the label key to check
109
- * @returns
110
- */
111
- HasLabel(key) {
112
- return this.Raw?.metadata?.labels?.[key] !== undefined;
113
- }
114
- /**
115
- * Check if an annotation exists on the Kubernetes resource.
116
- *
117
- * @param key the annotation key to check
118
- * @returns
119
- */
120
- HasAnnotation(key) {
121
- return this.Raw?.metadata?.annotations?.[key] !== undefined;
122
- }
123
- }
124
- exports.PeprRequest = PeprRequest;
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,oBAAY,aAAa;I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-FileCopyrightText: 2023-Present The Pepr Authors
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Event = exports.HookPhase = exports.ErrorBehavior = void 0;
6
- /**
7
- * The behavior of this module when an error occurs.
8
- */
9
- var ErrorBehavior;
10
- (function (ErrorBehavior) {
11
- ErrorBehavior["ignore"] = "ignore";
12
- ErrorBehavior["audit"] = "audit";
13
- ErrorBehavior["reject"] = "reject";
14
- })(ErrorBehavior = exports.ErrorBehavior || (exports.ErrorBehavior = {}));
15
- /**
16
- * The phase of the Kubernetes admission webhook that the capability is registered for.
17
- *
18
- * Currently only `mutate` is supported.
19
- */
20
- var HookPhase;
21
- (function (HookPhase) {
22
- HookPhase["mutate"] = "mutate";
23
- HookPhase["validate"] = "validate";
24
- })(HookPhase = exports.HookPhase || (exports.HookPhase = {}));
25
- /**
26
- * The type of Kubernetes mutating webhook event that the capability action is registered for.
27
- */
28
- var Event;
29
- (function (Event) {
30
- Event["Create"] = "CREATE";
31
- Event["Update"] = "UPDATE";
32
- Event["Delete"] = "DELETE";
33
- Event["CreateOrUpdate"] = "CREATEORUPDATE";
34
- })(Event = exports.Event || (exports.Event = {}));
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes