xypriss-swagger 1.0.33 → 1.0.37

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.
package/README.md CHANGED
@@ -15,7 +15,7 @@ The **[XyPriss Swagger Plugin](https://github.com/Nehonix-Team/XyPriss/blob/mast
15
15
  Install the plugin via XFPM:
16
16
 
17
17
  ```bash
18
- xfpm add xypriss-swagger
18
+ xfpm add xypriss-swagger --verify
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -28,16 +28,18 @@ In your main XyPriss application, import and register the `SwaggerPlugin`:
28
28
  import { SwaggerPlugin } from "xypriss-swagger";
29
29
  import { XyPrissServer } from "xypriss";
30
30
 
31
- const server = new XyPrissServer();
32
-
33
- server.use(
34
- SwaggerPlugin({
35
- port: 7070, // Port for the documentation server
36
- path: "/docs", // Path to access the Swagger UI
37
- title: "My API", // Documentation title
38
- version: "1.0.0", // API Version
39
- }),
40
- );
31
+ const server = createServer({
32
+ plugins: {
33
+ register: [
34
+ SwaggerPlugin({
35
+ port: 7070, // Port for the documentation server
36
+ path: "/docs", // Path to access the Swagger UI
37
+ title: "My API", // Documentation title
38
+ version: "1.0.0", // API Version
39
+ }),
40
+ ],
41
+ },
42
+ });
41
43
 
42
44
  server.start();
43
45
  ```
@@ -59,6 +61,10 @@ Ensure the plugin is authorized in your `xypriss.config.jsonc`:
59
61
  },
60
62
  "permissions": {
61
63
  "allowedHooks": [
64
+ "PLG.HTTP.ON_REQUEST",
65
+ "PLG.SECURITY.ACCESS_SENSITIVE_DATA",
66
+ "PLG.LIFECYCLE.REGISTER",
67
+ "PLG.LIFECYCLE.SERVER_START",
62
68
  "PLG.OPS.AUXILIARY_SERVER",
63
69
  "PLG.SECURITY.ACCESS_CONFIGS",
64
70
  ],
@@ -128,13 +134,27 @@ server.get(
128
134
 
129
135
  ## Security & Permissions
130
136
 
131
- In order to properly analyze your project's codebase and generate accurate Swagger documentation, this plugin requires the `CWD://` (Current Working Directory) context permission.
137
+ In order to properly function and integrate safely into your Zero-Trust XyPriss environment, this plugin requires the following privileges to be strictly allowed in your `xypriss.config.jsonc`:
138
+
139
+ ### Filesystem Context (`CWD://`)
140
+
141
+ **Why?** The plugin needs to resolve the active execution directory to dynamically scan your route files, interpret comments, and compile the OpenAPI JSON structure correctly.
142
+ **Is it safe?** Absolutely. The plugin performs exclusive read-only operations targeting your router files, safely ignoring sensitive `.env` or credentials.
143
+
144
+ ### Lifecycle & Auxiliary Hooks
145
+
146
+ The Swagger plugin operates as an independent subsystem connected to the main server loop:
147
+
148
+ - `PLG.LIFECYCLE.REGISTER`: Required to negotiate initialization with the core engine.
149
+ - `PLG.LIFECYCLE.SERVER_START`: Allows the plugin to participate safely in the startup sequence.
150
+ - `PLG.OPS.AUXILIARY_SERVER`: **Crucial.** Permits the deployment of the isolated documentation HTTP server without exposing your main server loop.
151
+
152
+ ### Security Access Hooks
132
153
 
133
- **Why is `CWD://` required?**
134
- The plugin needs to resolve the active execution directory to dynamically scan your route files, interpret comments, and compile the OpenAPI JSON structure correctly.
154
+ - `PLG.HTTP.ON_REQUEST`: Used strictly on the isolated auxiliary server to mount the documentation UI and manage static assets.
155
+ - `PLG.SECURITY.ACCESS_SENSITIVE_DATA` & `PLG.SECURITY.ACCESS_CONFIGS`: Required for the plugin to introspect the router architecture and extract the internal metadata needed for documentation auto-generation.
135
156
 
136
- **Is it safe?**
137
- Absolutely. While `CWD://` grants broad access to the project root, the XyPriss Swagger plugin is an official, strictly audited core module. It **exclusively** performs safe, read-only operations targeting your router files. It explicitly ignores sensitive system files (e.g., `.env`, credentials) and does not leak or alter your business logic. Your environment remains completely secure.
157
+ By explicitly providing these permissions, you maintain complete Zero-Trust authority over what the plugin is allowed to do, preventing silent system overrides or unwanted network binding.
138
158
 
139
159
  ## License
140
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xypriss-swagger",
3
- "version": "1.0.33",
3
+ "version": "1.0.37",
4
4
  "description": "Auto-documentation plugin for XyPriss Router V2",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
@@ -45,4 +45,4 @@
45
45
  "typescript": "^5.0.0"
46
46
  },
47
47
  "peerDependencies": {}
48
- }
48
+ }
@@ -1,10 +1,10 @@
1
1
  --- XYPRISS SIGNATURE (G3) ---
2
- Manifest: xypriss-swagger@1.0.33
3
- Min-Engine: 1.0.31
4
- Fingerprint: sha256:a9c9214d55f1334ccf63cb0fd0b65ca49befb705cb9511809fd07b9f948d116b
2
+ Manifest: xypriss-swagger@1.0.37
3
+ Min-Engine: 1.0.35
4
+ Fingerprint: sha256:53f24df6e325461b5f45bdf2c1ad7dab95e6c904979af8ffc396507a543ded56
5
5
  Identity: ed25519:a58b17a3e46302dd3ae5538bc9b8b991c57f4c5fe2e7d8ac41803de818d947f4
6
- Expires: 2027-04-21T21:41:21Z
6
+ Expires: 2027-04-22T20:54:37Z
7
7
  Revision: sha256:none
8
8
  --- BEGIN CRYPTOGRAPHIC PROOF ---
9
- base64:RldJ40DNFGSMMC9msaWQjxNjRBGz6jA9+h+EcStzRFGYCsZXgpt2gNGPxchLKKVBs4A/k/1kkMJC+9BHXAfgBw==
9
+ base64:d2rumcZZmiZpCpc1TQbA1RmMnDgppcYNSv+LHuZ+SZXF0NHXotKdQeroTQaCEnqxjvRJEXyPjZsJNgt4RW8AAw==
10
10
  --- END XYPRISS SIGNATURE ---