You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <sub>publishAuth</sub> | object | no | - | Authentication strategy for component publishing. When `undefined`, no authorization is required |
145
+
| <sub>publishAuth.type</sub> | string | no | - | Authentication type. Supports `"basic"` or custom authentication objects |
146
+
| <sub>publishAuth.username</sub> | string | no | - | Username for basic authentication (when type is `"basic"`) |
147
+
| <sub>publishAuth.password</sub> | string | no | - | Password for basic authentication (when type is `"basic"`) |
148
+
| <sub>publishAuth.logins</sub> | array | no | - | Array of login objects for multiple users: `[{ username: "user1", password: "pass1" }, ...]` (when type is `"basic"`) |
149
+
| <sub>publishValidation</sub> | function | no | - | Custom validation logic executed during component publishing. Function signature: `(pkgJson: unknown, context: { user?: string }) => { isValid: boolean; error?: string } \| boolean`. [See example](#publish-validation-example)|
150
+
| <sub>publishRateLimit</sub> | object | no | - | Rate-limiting configuration for component publishing. When `undefined`, no throttling is applied |
151
+
| <sub>publishRateLimit.windowMs</sub> | number (milliseconds) | no |`900000`| Size of the sliding window used for rate limiting. Defaults to 15 minutes |
152
+
| <sub>publishRateLimit.max</sub> | number | no |`100`| Maximum number of publish requests allowed within `windowMs`|
153
+
| <sub>publishRateLimit.keyGenerator</sub> | function | no | - | Function that returns the identifier used for counting hits (defaults to `${req.ip}:${req.user ?? 'anon'}`). Signature: `(req: Request) => string`|
154
+
| <sub>publishRateLimit.skip</sub> | function | no | - | Predicate to bypass throttling for specific requests/users. Signature: `(req: Request) => boolean`|
155
+
| <sub>publishRateLimit.store</sub> | object | no | In-memory | Custom storage backend implementing the `RateLimitStore` interface |
156
+
| <sub>publishRateLimit.maxCacheSize</sub> | number | no |`1000`| Maximum number of rate-limit entries the default in-memory store keeps |
150
157
151
158
### Component and Template Options
152
159
@@ -294,6 +301,31 @@ var registry = new oc.Registry(configuration);
294
301
registry.start();
295
302
```
296
303
304
+
### Publish Rate Limit Configuration
305
+
306
+
```js
307
+
var oc =require("oc");
308
+
309
+
var configuration = {
310
+
baseUrl:"https://components.mycompany.com/",
311
+
port:3000,
312
+
313
+
// Throttle component publishing to max 50 requests per 10-minute window
0 commit comments