@api-client/core 0.18.57 → 0.18.59
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/build/src/decorators/observed.d.ts.map +1 -1
- package/build/src/decorators/observed.js +15 -1
- package/build/src/decorators/observed.js.map +1 -1
- package/build/src/modeling/ApiModel.d.ts +7 -5
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +35 -16
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/ExposedEntity.d.ts +5 -2
- package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
- package/build/src/modeling/ExposedEntity.js +11 -8
- package/build/src/modeling/ExposedEntity.js.map +1 -1
- package/build/src/modeling/actions/Action.d.ts +41 -0
- package/build/src/modeling/actions/Action.d.ts.map +1 -0
- package/build/src/modeling/actions/Action.js +64 -0
- package/build/src/modeling/actions/Action.js.map +1 -0
- package/build/src/modeling/actions/CreateAction.d.ts +20 -0
- package/build/src/modeling/actions/CreateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/CreateAction.js +43 -0
- package/build/src/modeling/actions/CreateAction.js.map +1 -0
- package/build/src/modeling/actions/DeleteAction.d.ts +36 -0
- package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -0
- package/build/src/modeling/actions/DeleteAction.js +63 -0
- package/build/src/modeling/actions/DeleteAction.js.map +1 -0
- package/build/src/modeling/actions/ListAction.d.ts +39 -0
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ListAction.js +76 -0
- package/build/src/modeling/actions/ListAction.js.map +1 -0
- package/build/src/modeling/actions/ReadAction.d.ts +20 -0
- package/build/src/modeling/actions/ReadAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ReadAction.js +43 -0
- package/build/src/modeling/actions/ReadAction.js.map +1 -0
- package/build/src/modeling/actions/SearchAction.d.ts +26 -0
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -0
- package/build/src/modeling/actions/SearchAction.js +53 -0
- package/build/src/modeling/actions/SearchAction.js.map +1 -0
- package/build/src/modeling/actions/UpdateAction.d.ts +29 -0
- package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/UpdateAction.js +53 -0
- package/build/src/modeling/actions/UpdateAction.js.map +1 -0
- package/build/src/modeling/actions/index.d.ts +24 -0
- package/build/src/modeling/actions/index.d.ts.map +1 -0
- package/build/src/modeling/actions/index.js +9 -0
- package/build/src/modeling/actions/index.js.map +1 -0
- package/build/src/modeling/index.d.ts +12 -0
- package/build/src/modeling/index.d.ts.map +1 -0
- package/build/src/modeling/index.js +12 -0
- package/build/src/modeling/index.js.map +1 -0
- package/build/src/modeling/rules/AccessRule.d.ts +17 -0
- package/build/src/modeling/rules/AccessRule.d.ts.map +1 -0
- package/build/src/modeling/rules/AccessRule.js +19 -0
- package/build/src/modeling/rules/AccessRule.js.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts +19 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.js +14 -0
- package/build/src/modeling/rules/AllowAuthenticated.js.map +1 -0
- package/build/src/modeling/rules/AllowPublic.d.ts +19 -0
- package/build/src/modeling/rules/AllowPublic.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowPublic.js +14 -0
- package/build/src/modeling/rules/AllowPublic.js.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts +25 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.js +40 -0
- package/build/src/modeling/rules/MatchEmailDomain.js.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts +29 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.js +40 -0
- package/build/src/modeling/rules/MatchResourceOwner.js.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts +28 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.js +49 -0
- package/build/src/modeling/rules/MatchUserProperty.js.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts +29 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.js +40 -0
- package/build/src/modeling/rules/MatchUserRole.js.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts +61 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.js +101 -0
- package/build/src/modeling/rules/RateLimitRule.js.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts +18 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js +35 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js.map +1 -0
- package/build/src/modeling/rules/index.d.ts +14 -0
- package/build/src/modeling/rules/index.d.ts.map +1 -0
- package/build/src/modeling/rules/index.js +11 -0
- package/build/src/modeling/rules/index.js.map +1 -0
- package/build/src/modeling/types.d.ts +6 -257
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/decorators/observed.ts +15 -1
- package/src/modeling/ApiModel.ts +21 -19
- package/src/modeling/ExposedEntity.ts +13 -18
- package/src/modeling/actions/Action.ts +64 -0
- package/src/modeling/actions/CreateAction.ts +38 -0
- package/src/modeling/actions/DeleteAction.ts +59 -0
- package/src/modeling/actions/ListAction.ts +66 -0
- package/src/modeling/actions/ReadAction.ts +40 -0
- package/src/modeling/actions/SearchAction.ts +46 -0
- package/src/modeling/actions/UpdateAction.ts +49 -0
- package/src/modeling/rules/AccessRule.ts +29 -0
- package/src/modeling/rules/AllowAuthenticated.ts +24 -0
- package/src/modeling/rules/AllowPublic.ts +24 -0
- package/src/modeling/rules/MatchEmailDomain.ts +39 -0
- package/src/modeling/rules/MatchResourceOwner.ts +43 -0
- package/src/modeling/rules/MatchUserProperty.ts +44 -0
- package/src/modeling/rules/MatchUserRole.ts +43 -0
- package/src/modeling/rules/RateLimitRule.ts +104 -0
- package/src/modeling/rules/RateLimitingConfiguration.ts +32 -0
- package/src/modeling/types.ts +6 -276
- package/tests/unit/decorators/observed.spec.ts +42 -0
- package/tests/unit/modeling/actions/Action.spec.ts +109 -0
- package/tests/unit/modeling/actions/CreateAction.spec.ts +65 -0
- package/tests/unit/modeling/actions/DeleteAction.spec.ts +78 -0
- package/tests/unit/modeling/actions/ListAction.spec.ts +106 -0
- package/tests/unit/modeling/actions/ReadAction.spec.ts +77 -0
- package/tests/unit/modeling/actions/SearchAction.spec.ts +73 -0
- package/tests/unit/modeling/actions/UpdateAction.spec.ts +73 -0
- package/tests/unit/modeling/api_model.spec.ts +48 -3
- package/tests/unit/modeling/exposed_entity.spec.ts +73 -0
- package/tests/unit/modeling/rules/AccessRule.spec.ts +42 -0
- package/tests/unit/modeling/rules/AllowAuthenticated.spec.ts +28 -0
- package/tests/unit/modeling/rules/AllowPublic.spec.ts +28 -0
- package/tests/unit/modeling/rules/MatchEmailDomain.spec.ts +52 -0
- package/tests/unit/modeling/rules/MatchResourceOwner.spec.ts +37 -0
- package/tests/unit/modeling/rules/MatchUserProperty.spec.ts +58 -0
- package/tests/unit/modeling/rules/MatchUserRole.spec.ts +52 -0
- package/tests/unit/modeling/rules/RateLimitRule.spec.ts +70 -0
- package/tests/unit/modeling/rules/RateLimitingConfiguration.spec.ts +61 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if the authenticated user's ID matches a specific property on the resource.
|
|
6
|
+
* This is typically used to restrict access to resources owned by the user.
|
|
7
|
+
* For example, a user can only access their own profile or documents.
|
|
8
|
+
*/
|
|
9
|
+
let MatchResourceOwnerAccessRule = (() => {
|
|
10
|
+
let _classSuper = AccessRule;
|
|
11
|
+
let _property_decorators;
|
|
12
|
+
let _property_initializers = [];
|
|
13
|
+
let _property_extraInitializers = [];
|
|
14
|
+
return class MatchResourceOwnerAccessRule extends _classSuper {
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
_property_decorators = [observed()];
|
|
18
|
+
__esDecorate(this, null, _property_decorators, { kind: "accessor", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
|
|
19
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
type;
|
|
22
|
+
#property_accessor_storage = __runInitializers(this, _property_initializers, void 0);
|
|
23
|
+
get property() { return this.#property_accessor_storage; }
|
|
24
|
+
set property(value) { this.#property_accessor_storage = value; }
|
|
25
|
+
constructor(state = {}) {
|
|
26
|
+
super(state);
|
|
27
|
+
__runInitializers(this, _property_extraInitializers);
|
|
28
|
+
this.type = 'resourceOwner';
|
|
29
|
+
this.property = state.property ?? '';
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
...super.toJSON(),
|
|
34
|
+
property: this.property,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
export { MatchResourceOwnerAccessRule };
|
|
40
|
+
//# sourceMappingURL=MatchResourceOwner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchResourceOwner.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchResourceOwner.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAmBvD;;;;GAIG;IACU,4BAA4B;sBAAS,UAAU;;;;iBAA/C,4BAA6B,SAAQ,WAAU;;;oCAGzD,QAAQ,EAAE;YAAC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAQ;;;QAFnB,IAAI,CAAiB;QAE3B,qFAAyB;QAAzB,IAAS,QAAQ,8CAAQ;QAAzB,IAAS,QAAQ,oDAAQ;QAErC,YAAY,QAAqD,EAAE;YACjE,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;YAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;SACrC;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyC;gBACzD,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAA;QACH,CAAC;;;SAhBU,4BAA4B","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport interface MatchResourceOwnerAccessRuleSchema extends AccessRuleSchema {\n type: 'resourceOwner'\n /**\n * The property on the resource that should match the authenticated user's ID.\n * This is typically the ID of the user who owns the resource.\n *\n * The domain model should annotate this property with the \"ResourceOwnerIdentifier\" semantic\n * to indicate that it is used for ownership checks.\n */\n property: string\n}\n\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport class MatchResourceOwnerAccessRule extends AccessRule implements MatchResourceOwnerAccessRuleSchema {\n override readonly type: 'resourceOwner'\n\n @observed() accessor property: string\n\n constructor(state: Partial<MatchResourceOwnerAccessRuleSchema> = {}) {\n super(state)\n this.type = 'resourceOwner'\n this.property = state.property ?? ''\n }\n\n override toJSON(): MatchResourceOwnerAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchResourceOwnerAccessRuleSchema),\n property: this.property,\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
4
|
+
* This is used to enforce other user-specific restrictions.
|
|
5
|
+
*/
|
|
6
|
+
export interface MatchUserPropertyAccessRuleSchema extends AccessRuleSchema {
|
|
7
|
+
type: 'matchUserProperty';
|
|
8
|
+
/**
|
|
9
|
+
* The property on the authenticated user that should match the expected value.
|
|
10
|
+
*/
|
|
11
|
+
property: string;
|
|
12
|
+
/**
|
|
13
|
+
* The expected value for the user property.
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
19
|
+
* This is used to enforce other user-specific restrictions.
|
|
20
|
+
*/
|
|
21
|
+
export declare class MatchUserPropertyAccessRule extends AccessRule implements MatchUserPropertyAccessRuleSchema {
|
|
22
|
+
readonly type: 'matchUserProperty';
|
|
23
|
+
accessor property: string;
|
|
24
|
+
accessor value: string;
|
|
25
|
+
constructor(state?: Partial<MatchUserPropertyAccessRuleSchema>);
|
|
26
|
+
toJSON(): MatchUserPropertyAccessRuleSchema;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=MatchUserProperty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserProperty.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,gBAAgB;IACzE,IAAI,EAAE,mBAAmB,CAAA;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,UAAW,YAAW,iCAAiC;IACtG,SAAkB,IAAI,EAAE,mBAAmB,CAAA;IAE/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEtB,KAAK,GAAE,OAAO,CAAC,iCAAiC,CAAM;IAOzD,MAAM,IAAI,iCAAiC;CAOrD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
6
|
+
* This is used to enforce other user-specific restrictions.
|
|
7
|
+
*/
|
|
8
|
+
let MatchUserPropertyAccessRule = (() => {
|
|
9
|
+
let _classSuper = AccessRule;
|
|
10
|
+
let _property_decorators;
|
|
11
|
+
let _property_initializers = [];
|
|
12
|
+
let _property_extraInitializers = [];
|
|
13
|
+
let _value_decorators;
|
|
14
|
+
let _value_initializers = [];
|
|
15
|
+
let _value_extraInitializers = [];
|
|
16
|
+
return class MatchUserPropertyAccessRule extends _classSuper {
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
_property_decorators = [observed()];
|
|
20
|
+
_value_decorators = [observed()];
|
|
21
|
+
__esDecorate(this, null, _property_decorators, { kind: "accessor", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
|
|
22
|
+
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
23
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
}
|
|
25
|
+
type;
|
|
26
|
+
#property_accessor_storage = __runInitializers(this, _property_initializers, void 0);
|
|
27
|
+
get property() { return this.#property_accessor_storage; }
|
|
28
|
+
set property(value) { this.#property_accessor_storage = value; }
|
|
29
|
+
#value_accessor_storage = (__runInitializers(this, _property_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
30
|
+
get value() { return this.#value_accessor_storage; }
|
|
31
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
32
|
+
constructor(state = {}) {
|
|
33
|
+
super(state);
|
|
34
|
+
__runInitializers(this, _value_extraInitializers);
|
|
35
|
+
this.type = 'matchUserProperty';
|
|
36
|
+
this.property = state.property ?? '';
|
|
37
|
+
this.value = state.value ?? '';
|
|
38
|
+
}
|
|
39
|
+
toJSON() {
|
|
40
|
+
return {
|
|
41
|
+
...super.toJSON(),
|
|
42
|
+
property: this.property,
|
|
43
|
+
value: this.value,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
export { MatchUserPropertyAccessRule };
|
|
49
|
+
//# sourceMappingURL=MatchUserProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserProperty.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserProperty.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAkBvD;;;GAGG;IACU,2BAA2B;sBAAS,UAAU;;;;;;;iBAA9C,2BAA4B,SAAQ,WAAU;;;oCAGxD,QAAQ,EAAE;iCACV,QAAQ,EAAE;YADC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAQ;YACzB,oKAAS,KAAK,6BAAL,KAAK,qFAAQ;;;QAHhB,IAAI,CAAqB;QAE/B,qFAAyB;QAAzB,IAAS,QAAQ,8CAAQ;QAAzB,IAAS,QAAQ,oDAAQ;QACzB,uIAAsB;QAAtB,IAAS,KAAK,2CAAQ;QAAtB,IAAS,KAAK,iDAAQ;QAElC,YAAY,QAAoD,EAAE;YAChE,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;YAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;YACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;SAC/B;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAwC;gBACxD,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAA;QACH,CAAC;;;SAnBU,2BAA2B","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport interface MatchUserPropertyAccessRuleSchema extends AccessRuleSchema {\n type: 'matchUserProperty'\n /**\n * The property on the authenticated user that should match the expected value.\n */\n property: string\n /**\n * The expected value for the user property.\n */\n value: string\n}\n\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport class MatchUserPropertyAccessRule extends AccessRule implements MatchUserPropertyAccessRuleSchema {\n override readonly type: 'matchUserProperty'\n\n @observed() accessor property: string\n @observed() accessor value: string\n\n constructor(state: Partial<MatchUserPropertyAccessRuleSchema> = {}) {\n super(state)\n this.type = 'matchUserProperty'\n this.property = state.property ?? ''\n this.value = state.value ?? ''\n }\n\n override toJSON(): MatchUserPropertyAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchUserPropertyAccessRuleSchema),\n property: this.property,\n value: this.value,\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed if the authenticated user has a specific role.
|
|
4
|
+
* This is used to enforce role-based access control (RBAC).
|
|
5
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
6
|
+
*/
|
|
7
|
+
export interface MatchUserRoleAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'matchUserRole';
|
|
9
|
+
/**
|
|
10
|
+
* The role that the authenticated user must have to access the resource.
|
|
11
|
+
* This is typically a property on the user entity that defines their role.
|
|
12
|
+
*
|
|
13
|
+
* The domain model should annotate this property with the "UserRole" semantic
|
|
14
|
+
* to indicate that it is used for role-based access control.
|
|
15
|
+
*/
|
|
16
|
+
role: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The action is allowed if the authenticated user has a specific role.
|
|
20
|
+
* This is used to enforce role-based access control (RBAC).
|
|
21
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
22
|
+
*/
|
|
23
|
+
export declare class MatchUserRoleAccessRule extends AccessRule implements MatchUserRoleAccessRuleSchema {
|
|
24
|
+
readonly type: 'matchUserRole';
|
|
25
|
+
accessor role: string[];
|
|
26
|
+
constructor(state?: Partial<MatchUserRoleAccessRuleSchema>);
|
|
27
|
+
toJSON(): MatchUserRoleAccessRuleSchema;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=MatchUserRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserRole.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACrE,IAAI,EAAE,eAAe,CAAA;IACrB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,UAAW,YAAW,6BAA6B;IAC9F,SAAkB,IAAI,EAAE,eAAe,CAAA;IAEb,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;gBAErC,KAAK,GAAE,OAAO,CAAC,6BAA6B,CAAM;IAMrD,MAAM,IAAI,6BAA6B;CAMjD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if the authenticated user has a specific role.
|
|
6
|
+
* This is used to enforce role-based access control (RBAC).
|
|
7
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
8
|
+
*/
|
|
9
|
+
let MatchUserRoleAccessRule = (() => {
|
|
10
|
+
let _classSuper = AccessRule;
|
|
11
|
+
let _role_decorators;
|
|
12
|
+
let _role_initializers = [];
|
|
13
|
+
let _role_extraInitializers = [];
|
|
14
|
+
return class MatchUserRoleAccessRule extends _classSuper {
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
_role_decorators = [observed({ deep: true })];
|
|
18
|
+
__esDecorate(this, null, _role_decorators, { kind: "accessor", name: "role", static: false, private: false, access: { has: obj => "role" in obj, get: obj => obj.role, set: (obj, value) => { obj.role = value; } }, metadata: _metadata }, _role_initializers, _role_extraInitializers);
|
|
19
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
type;
|
|
22
|
+
#role_accessor_storage = __runInitializers(this, _role_initializers, void 0);
|
|
23
|
+
get role() { return this.#role_accessor_storage; }
|
|
24
|
+
set role(value) { this.#role_accessor_storage = value; }
|
|
25
|
+
constructor(state = {}) {
|
|
26
|
+
super(state);
|
|
27
|
+
__runInitializers(this, _role_extraInitializers);
|
|
28
|
+
this.type = 'matchUserRole';
|
|
29
|
+
this.role = state.role ? [...state.role] : [];
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
...super.toJSON(),
|
|
34
|
+
role: structuredClone(toRaw(this, this.role)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
export { MatchUserRoleAccessRule };
|
|
40
|
+
//# sourceMappingURL=MatchUserRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserRole.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserRole.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAmB9D;;;;GAIG;IACU,uBAAuB;sBAAS,UAAU;;;;iBAA1C,uBAAwB,SAAQ,WAAU;;;gCAGpD,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAAC,iKAAS,IAAI,6BAAJ,IAAI,mFAAU;;;QAF/B,IAAI,CAAiB;QAEb,6EAAuB;QAAvB,IAAS,IAAI,0CAAU;QAAvB,IAAS,IAAI,gDAAU;QAEjD,YAAY,QAAgD,EAAE;YAC5D,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;YAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SAC9C;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAoC;gBACpD,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAa;aAC1D,CAAA;QACH,CAAC;;;SAhBU,uBAAuB","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if the authenticated user has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport interface MatchUserRoleAccessRuleSchema extends AccessRuleSchema {\n type: 'matchUserRole'\n /**\n * The role that the authenticated user must have to access the resource.\n * This is typically a property on the user entity that defines their role.\n *\n * The domain model should annotate this property with the \"UserRole\" semantic\n * to indicate that it is used for role-based access control.\n */\n role: string[]\n}\n\n/**\n * The action is allowed if the authenticated user has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport class MatchUserRoleAccessRule extends AccessRule implements MatchUserRoleAccessRuleSchema {\n override readonly type: 'matchUserRole'\n\n @observed({ deep: true }) accessor role: string[]\n\n constructor(state: Partial<MatchUserRoleAccessRuleSchema> = {}) {\n super(state)\n this.type = 'matchUserRole'\n this.role = state.role ? [...state.role] : []\n }\n\n override toJSON(): MatchUserRoleAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchUserRoleAccessRuleSchema),\n role: structuredClone(toRaw(this, this.role)) as string[],\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type RateLimitRuleKey = {
|
|
2
|
+
type: 'ip';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'userId';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'role';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export type RateLimitRuleInterval = 'second' | 'minute' | 'hour' | 'day';
|
|
10
|
+
/**
|
|
11
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
12
|
+
* type of client, using a token bucket algorithm.
|
|
13
|
+
*/
|
|
14
|
+
export interface RateLimitRuleSchema {
|
|
15
|
+
/**
|
|
16
|
+
* A human-readable description of what this rule is for.
|
|
17
|
+
* e.g., "Limit anonymous users to 60 requests per hour."
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Defines how to group requests for rate limiting. This determines
|
|
22
|
+
* who the limit applies to.
|
|
23
|
+
*
|
|
24
|
+
* - 'ip': Keys on the client's IP address. Best for anonymous traffic.
|
|
25
|
+
* - 'userId': Keys on the authenticated user's ID. Best for logged-in users.
|
|
26
|
+
* - 'role': Applies a shared limit to all users of a specific role.
|
|
27
|
+
*/
|
|
28
|
+
key?: RateLimitRuleKey;
|
|
29
|
+
/**
|
|
30
|
+
* The number of requests allowed over the defined interval.
|
|
31
|
+
* This is the rate at which tokens are added to the bucket.
|
|
32
|
+
*/
|
|
33
|
+
rate?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The time interval for the rate.
|
|
36
|
+
*/
|
|
37
|
+
interval?: RateLimitRuleInterval;
|
|
38
|
+
/**
|
|
39
|
+
* The maximum number of requests that can be made in a burst.
|
|
40
|
+
* This represents the "bucket size." A larger burst allows for
|
|
41
|
+
* more requests to be made in a short period before throttling begins.
|
|
42
|
+
*/
|
|
43
|
+
burst?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
47
|
+
* type of client, using a token bucket algorithm.
|
|
48
|
+
*/
|
|
49
|
+
export declare class RateLimitRule extends EventTarget implements RateLimitRuleSchema {
|
|
50
|
+
accessor description: string | undefined;
|
|
51
|
+
accessor key: RateLimitRuleKey | undefined;
|
|
52
|
+
accessor rate: number | undefined;
|
|
53
|
+
accessor interval: RateLimitRuleInterval | undefined;
|
|
54
|
+
accessor burst: number | undefined;
|
|
55
|
+
constructor(state?: Partial<RateLimitRuleSchema>);
|
|
56
|
+
toJSON(): RateLimitRuleSchema;
|
|
57
|
+
notifyChange(): void;
|
|
58
|
+
static isRateLimitRuleInterval(value: unknown): value is RateLimitRuleInterval;
|
|
59
|
+
static isRateLimitRuleKey(value: unknown): value is RateLimitRuleKey;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=RateLimitRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitRule.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitRule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AACpG,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAExE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,gBAAgB,CAAA;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAEhC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAY,YAAW,mBAAmB;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAA;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElC,KAAK,GAAE,OAAO,CAAC,mBAAmB,CAAM;IASpD,MAAM,IAAI,mBAAmB;IAoB7B,YAAY;IAIZ,MAAM,CAAC,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB;IAO9E,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB;CAOrE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
5
|
+
* type of client, using a token bucket algorithm.
|
|
6
|
+
*/
|
|
7
|
+
let RateLimitRule = (() => {
|
|
8
|
+
let _classSuper = EventTarget;
|
|
9
|
+
let _description_decorators;
|
|
10
|
+
let _description_initializers = [];
|
|
11
|
+
let _description_extraInitializers = [];
|
|
12
|
+
let _key_decorators;
|
|
13
|
+
let _key_initializers = [];
|
|
14
|
+
let _key_extraInitializers = [];
|
|
15
|
+
let _rate_decorators;
|
|
16
|
+
let _rate_initializers = [];
|
|
17
|
+
let _rate_extraInitializers = [];
|
|
18
|
+
let _interval_decorators;
|
|
19
|
+
let _interval_initializers = [];
|
|
20
|
+
let _interval_extraInitializers = [];
|
|
21
|
+
let _burst_decorators;
|
|
22
|
+
let _burst_initializers = [];
|
|
23
|
+
let _burst_extraInitializers = [];
|
|
24
|
+
return class RateLimitRule extends _classSuper {
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
27
|
+
_description_decorators = [observed()];
|
|
28
|
+
_key_decorators = [observed({ deep: true })];
|
|
29
|
+
_rate_decorators = [observed()];
|
|
30
|
+
_interval_decorators = [observed()];
|
|
31
|
+
_burst_decorators = [observed()];
|
|
32
|
+
__esDecorate(this, null, _description_decorators, { kind: "accessor", name: "description", static: false, private: false, access: { has: obj => "description" in obj, get: obj => obj.description, set: (obj, value) => { obj.description = value; } }, metadata: _metadata }, _description_initializers, _description_extraInitializers);
|
|
33
|
+
__esDecorate(this, null, _key_decorators, { kind: "accessor", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
34
|
+
__esDecorate(this, null, _rate_decorators, { kind: "accessor", name: "rate", static: false, private: false, access: { has: obj => "rate" in obj, get: obj => obj.rate, set: (obj, value) => { obj.rate = value; } }, metadata: _metadata }, _rate_initializers, _rate_extraInitializers);
|
|
35
|
+
__esDecorate(this, null, _interval_decorators, { kind: "accessor", name: "interval", static: false, private: false, access: { has: obj => "interval" in obj, get: obj => obj.interval, set: (obj, value) => { obj.interval = value; } }, metadata: _metadata }, _interval_initializers, _interval_extraInitializers);
|
|
36
|
+
__esDecorate(this, null, _burst_decorators, { kind: "accessor", name: "burst", static: false, private: false, access: { has: obj => "burst" in obj, get: obj => obj.burst, set: (obj, value) => { obj.burst = value; } }, metadata: _metadata }, _burst_initializers, _burst_extraInitializers);
|
|
37
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
38
|
+
}
|
|
39
|
+
#description_accessor_storage = __runInitializers(this, _description_initializers, void 0);
|
|
40
|
+
get description() { return this.#description_accessor_storage; }
|
|
41
|
+
set description(value) { this.#description_accessor_storage = value; }
|
|
42
|
+
#key_accessor_storage = (__runInitializers(this, _description_extraInitializers), __runInitializers(this, _key_initializers, void 0));
|
|
43
|
+
get key() { return this.#key_accessor_storage; }
|
|
44
|
+
set key(value) { this.#key_accessor_storage = value; }
|
|
45
|
+
#rate_accessor_storage = (__runInitializers(this, _key_extraInitializers), __runInitializers(this, _rate_initializers, void 0));
|
|
46
|
+
get rate() { return this.#rate_accessor_storage; }
|
|
47
|
+
set rate(value) { this.#rate_accessor_storage = value; }
|
|
48
|
+
#interval_accessor_storage = (__runInitializers(this, _rate_extraInitializers), __runInitializers(this, _interval_initializers, void 0));
|
|
49
|
+
get interval() { return this.#interval_accessor_storage; }
|
|
50
|
+
set interval(value) { this.#interval_accessor_storage = value; }
|
|
51
|
+
#burst_accessor_storage = (__runInitializers(this, _interval_extraInitializers), __runInitializers(this, _burst_initializers, void 0));
|
|
52
|
+
get burst() { return this.#burst_accessor_storage; }
|
|
53
|
+
set burst(value) { this.#burst_accessor_storage = value; }
|
|
54
|
+
constructor(state = {}) {
|
|
55
|
+
super();
|
|
56
|
+
__runInitializers(this, _burst_extraInitializers);
|
|
57
|
+
this.description = state.description;
|
|
58
|
+
this.key = RateLimitRule.isRateLimitRuleKey(state.key) ? structuredClone(state.key) : undefined;
|
|
59
|
+
this.rate = typeof state.rate === 'number' ? state.rate : undefined;
|
|
60
|
+
this.interval = RateLimitRule.isRateLimitRuleInterval(state.interval) ? state.interval : undefined;
|
|
61
|
+
this.burst = typeof state.burst === 'number' ? state.burst : undefined;
|
|
62
|
+
}
|
|
63
|
+
toJSON() {
|
|
64
|
+
const result = {};
|
|
65
|
+
if (this.description) {
|
|
66
|
+
result.description = this.description;
|
|
67
|
+
}
|
|
68
|
+
if (RateLimitRule.isRateLimitRuleKey(this.key)) {
|
|
69
|
+
result.key = structuredClone(toRaw(this, this.key));
|
|
70
|
+
}
|
|
71
|
+
if (typeof this.rate === 'number') {
|
|
72
|
+
result.rate = this.rate;
|
|
73
|
+
}
|
|
74
|
+
if (RateLimitRule.isRateLimitRuleInterval(this.interval)) {
|
|
75
|
+
result.interval = this.interval;
|
|
76
|
+
}
|
|
77
|
+
if (typeof this.burst === 'number') {
|
|
78
|
+
result.burst = this.burst;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
notifyChange() {
|
|
83
|
+
this.dispatchEvent(new Event('change'));
|
|
84
|
+
}
|
|
85
|
+
static isRateLimitRuleInterval(value) {
|
|
86
|
+
if (typeof value !== 'string') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return ['second', 'minute', 'hour', 'day'].includes(value);
|
|
90
|
+
}
|
|
91
|
+
static isRateLimitRuleKey(value) {
|
|
92
|
+
if (typeof value !== 'object' || value === null) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const key = value;
|
|
96
|
+
return 'type' in key && (key.type === 'ip' || key.type === 'userId' || key.type === 'role');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
})();
|
|
100
|
+
export { RateLimitRule };
|
|
101
|
+
//# sourceMappingURL=RateLimitRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitRule.js","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitRule.ts"],"names":[],"mappings":"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","sourcesContent":["import { observed, toRaw } from '../../decorators/observed.js'\n\nexport type RateLimitRuleKey = { type: 'ip' } | { type: 'userId' } | { type: 'role'; value: string }\nexport type RateLimitRuleInterval = 'second' | 'minute' | 'hour' | 'day'\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport interface RateLimitRuleSchema {\n /**\n * A human-readable description of what this rule is for.\n * e.g., \"Limit anonymous users to 60 requests per hour.\"\n */\n description?: string\n\n /**\n * Defines how to group requests for rate limiting. This determines\n * who the limit applies to.\n *\n * - 'ip': Keys on the client's IP address. Best for anonymous traffic.\n * - 'userId': Keys on the authenticated user's ID. Best for logged-in users.\n * - 'role': Applies a shared limit to all users of a specific role.\n */\n key?: RateLimitRuleKey\n\n /**\n * The number of requests allowed over the defined interval.\n * This is the rate at which tokens are added to the bucket.\n */\n rate?: number\n\n /**\n * The time interval for the rate.\n */\n interval?: RateLimitRuleInterval\n\n /**\n * The maximum number of requests that can be made in a burst.\n * This represents the \"bucket size.\" A larger burst allows for\n * more requests to be made in a short period before throttling begins.\n */\n burst?: number\n}\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport class RateLimitRule extends EventTarget implements RateLimitRuleSchema {\n @observed() accessor description: string | undefined\n @observed({ deep: true }) accessor key: RateLimitRuleKey | undefined\n @observed() accessor rate: number | undefined\n @observed() accessor interval: RateLimitRuleInterval | undefined\n @observed() accessor burst: number | undefined\n\n constructor(state: Partial<RateLimitRuleSchema> = {}) {\n super()\n this.description = state.description\n this.key = RateLimitRule.isRateLimitRuleKey(state.key) ? structuredClone(state.key) : undefined\n this.rate = typeof state.rate === 'number' ? state.rate : undefined\n this.interval = RateLimitRule.isRateLimitRuleInterval(state.interval) ? state.interval : undefined\n this.burst = typeof state.burst === 'number' ? state.burst : undefined\n }\n\n toJSON(): RateLimitRuleSchema {\n const result: RateLimitRuleSchema = {}\n if (this.description) {\n result.description = this.description\n }\n if (RateLimitRule.isRateLimitRuleKey(this.key)) {\n result.key = structuredClone(toRaw(this, this.key))\n }\n if (typeof this.rate === 'number') {\n result.rate = this.rate\n }\n if (RateLimitRule.isRateLimitRuleInterval(this.interval)) {\n result.interval = this.interval\n }\n if (typeof this.burst === 'number') {\n result.burst = this.burst\n }\n return result\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n\n static isRateLimitRuleInterval(value: unknown): value is RateLimitRuleInterval {\n if (typeof value !== 'string') {\n return false\n }\n return ['second', 'minute', 'hour', 'day'].includes(value)\n }\n\n static isRateLimitRuleKey(value: unknown): value is RateLimitRuleKey {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const key = value as Record<string, unknown>\n return 'type' in key && (key.type === 'ip' || key.type === 'userId' || key.type === 'role')\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the rate limiting and throttling policies for the entire API.
|
|
4
|
+
*/
|
|
5
|
+
export interface RateLimitingConfigurationSchema {
|
|
6
|
+
/**
|
|
7
|
+
* An ordered list of rules. The first rule that matches an incoming
|
|
8
|
+
* request will be applied.
|
|
9
|
+
*/
|
|
10
|
+
rules: RateLimitRuleSchema[];
|
|
11
|
+
}
|
|
12
|
+
export declare class RateLimitingConfiguration extends EventTarget implements RateLimitingConfigurationSchema {
|
|
13
|
+
accessor rules: RateLimitRule[];
|
|
14
|
+
constructor(state?: Partial<RateLimitingConfigurationSchema>);
|
|
15
|
+
toJSON(): RateLimitingConfigurationSchema;
|
|
16
|
+
notifyChange(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=RateLimitingConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitingConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitingConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B;AAED,qBAAa,yBAA0B,SAAQ,WAAY,YAAW,+BAA+B;IACzE,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAA;gBAE7C,KAAK,GAAE,OAAO,CAAC,+BAA+B,CAAM;IAKhE,MAAM,IAAI,+BAA+B;IAMzC,YAAY;CAGb"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { RateLimitRule } from './RateLimitRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
let RateLimitingConfiguration = (() => {
|
|
5
|
+
let _classSuper = EventTarget;
|
|
6
|
+
let _rules_decorators;
|
|
7
|
+
let _rules_initializers = [];
|
|
8
|
+
let _rules_extraInitializers = [];
|
|
9
|
+
return class RateLimitingConfiguration extends _classSuper {
|
|
10
|
+
static {
|
|
11
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
12
|
+
_rules_decorators = [observed({ deep: true })];
|
|
13
|
+
__esDecorate(this, null, _rules_decorators, { kind: "accessor", name: "rules", static: false, private: false, access: { has: obj => "rules" in obj, get: obj => obj.rules, set: (obj, value) => { obj.rules = value; } }, metadata: _metadata }, _rules_initializers, _rules_extraInitializers);
|
|
14
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
15
|
+
}
|
|
16
|
+
#rules_accessor_storage = __runInitializers(this, _rules_initializers, void 0);
|
|
17
|
+
get rules() { return this.#rules_accessor_storage; }
|
|
18
|
+
set rules(value) { this.#rules_accessor_storage = value; }
|
|
19
|
+
constructor(state = {}) {
|
|
20
|
+
super();
|
|
21
|
+
__runInitializers(this, _rules_extraInitializers);
|
|
22
|
+
this.rules = state.rules?.map((rule) => new RateLimitRule(rule)) || [];
|
|
23
|
+
}
|
|
24
|
+
toJSON() {
|
|
25
|
+
return {
|
|
26
|
+
rules: this.rules.map((rule) => rule.toJSON()),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
notifyChange() {
|
|
30
|
+
this.dispatchEvent(new Event('change'));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
export { RateLimitingConfiguration };
|
|
35
|
+
//# sourceMappingURL=RateLimitingConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitingConfiguration.js","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitingConfiguration.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;IAa1C,yBAAyB;sBAAS,WAAW;;;;iBAA7C,yBAA0B,SAAQ,WAAW;;;iCACvD,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAAC,oKAAS,KAAK,6BAAL,KAAK,qFAAiB;;;QAA/B,+EAA+B;QAA/B,IAAS,KAAK,2CAAiB;QAA/B,IAAS,KAAK,iDAAiB;QAEzD,YAAY,QAAkD,EAAE;YAC9D,KAAK,EAAE,CAAA;;YACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;SACvE;QAED,MAAM;YACJ,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aAC/C,CAAA;QACH,CAAC;QAED,YAAY;YACV,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;QACzC,CAAC;;;SAhBU,yBAAyB","sourcesContent":["import { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * Defines the rate limiting and throttling policies for the entire API.\n */\nexport interface RateLimitingConfigurationSchema {\n /**\n * An ordered list of rules. The first rule that matches an incoming\n * request will be applied.\n */\n rules: RateLimitRuleSchema[]\n}\n\nexport class RateLimitingConfiguration extends EventTarget implements RateLimitingConfigurationSchema {\n @observed({ deep: true }) accessor rules: RateLimitRule[]\n\n constructor(state: Partial<RateLimitingConfigurationSchema> = {}) {\n super()\n this.rules = state.rules?.map((rule) => new RateLimitRule(rule)) || []\n }\n\n toJSON(): RateLimitingConfigurationSchema {\n return {\n rules: this.rules.map((rule) => rule.toJSON()),\n }\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
export { RateLimitingConfiguration, type RateLimitingConfigurationSchema } from './RateLimitingConfiguration.js';
|
|
3
|
+
import { AllowAuthenticatedAccessRule, type AllowAuthenticatedAccessRuleSchema } from './AllowAuthenticated.js';
|
|
4
|
+
import { AllowPublicAccessRule, type AllowPublicAccessRuleSchema } from './AllowPublic.js';
|
|
5
|
+
import { MatchEmailDomainAccessRule, type MatchEmailDomainAccessRuleSchema } from './MatchEmailDomain.js';
|
|
6
|
+
import { MatchResourceOwnerAccessRule, type MatchResourceOwnerAccessRuleSchema } from './MatchResourceOwner.js';
|
|
7
|
+
import { MatchUserPropertyAccessRule, type MatchUserPropertyAccessRuleSchema } from './MatchUserProperty.js';
|
|
8
|
+
import { MatchUserRoleAccessRule, type MatchUserRoleAccessRuleSchema } from './MatchUserRole.js';
|
|
9
|
+
import { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js';
|
|
10
|
+
export { AllowAuthenticatedAccessRule, AllowPublicAccessRule, MatchEmailDomainAccessRule, MatchResourceOwnerAccessRule, MatchUserPropertyAccessRule, MatchUserRoleAccessRule, RateLimitRule, };
|
|
11
|
+
export type { AllowAuthenticatedAccessRuleSchema, AllowPublicAccessRuleSchema, MatchEmailDomainAccessRuleSchema, MatchResourceOwnerAccessRuleSchema, MatchUserPropertyAccessRuleSchema, MatchUserRoleAccessRuleSchema, RateLimitRuleSchema, };
|
|
12
|
+
export type ApiAccessRule = AllowAuthenticatedAccessRule | AllowPublicAccessRule | MatchEmailDomainAccessRule | MatchResourceOwnerAccessRule | MatchUserPropertyAccessRule | MatchUserRoleAccessRule;
|
|
13
|
+
export type ApiAccessRuleSchema = AllowAuthenticatedAccessRuleSchema | AllowPublicAccessRuleSchema | MatchEmailDomainAccessRuleSchema | MatchResourceOwnerAccessRuleSchema | MatchUserPropertyAccessRuleSchema | MatchUserRoleAccessRuleSchema;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,yBAAyB,EAAE,KAAK,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAChH,OAAO,EAAE,4BAA4B,EAAE,KAAK,kCAAkC,EAAE,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,KAAK,gCAAgC,EAAE,MAAM,uBAAuB,CAAA;AACzG,OAAO,EAAE,4BAA4B,EAAE,KAAK,kCAAkC,EAAE,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,2BAA2B,EAAE,KAAK,iCAAiC,EAAE,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,uBAAuB,EAAE,KAAK,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,aAAa,GACd,CAAA;AACD,YAAY,EACV,kCAAkC,EAClC,2BAA2B,EAC3B,gCAAgC,EAChC,kCAAkC,EAClC,iCAAiC,EACjC,6BAA6B,EAC7B,mBAAmB,GACpB,CAAA;AAED,MAAM,MAAM,aAAa,GACrB,4BAA4B,GAC5B,qBAAqB,GACrB,0BAA0B,GAC1B,4BAA4B,GAC5B,2BAA2B,GAC3B,uBAAuB,CAAA;AAC3B,MAAM,MAAM,mBAAmB,GAC3B,kCAAkC,GAClC,2BAA2B,GAC3B,gCAAgC,GAChC,kCAAkC,GAClC,iCAAiC,GACjC,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AccessRule } from './AccessRule.js';
|
|
2
|
+
export { RateLimitingConfiguration } from './RateLimitingConfiguration.js';
|
|
3
|
+
import { AllowAuthenticatedAccessRule } from './AllowAuthenticated.js';
|
|
4
|
+
import { AllowPublicAccessRule } from './AllowPublic.js';
|
|
5
|
+
import { MatchEmailDomainAccessRule } from './MatchEmailDomain.js';
|
|
6
|
+
import { MatchResourceOwnerAccessRule } from './MatchResourceOwner.js';
|
|
7
|
+
import { MatchUserPropertyAccessRule } from './MatchUserProperty.js';
|
|
8
|
+
import { MatchUserRoleAccessRule } from './MatchUserRole.js';
|
|
9
|
+
import { RateLimitRule } from './RateLimitRule.js';
|
|
10
|
+
export { AllowAuthenticatedAccessRule, AllowPublicAccessRule, MatchEmailDomainAccessRule, MatchResourceOwnerAccessRule, MatchUserPropertyAccessRule, MatchUserRoleAccessRule, RateLimitRule, };
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,yBAAyB,EAAwC,MAAM,gCAAgC,CAAA;AAChH,OAAO,EAAE,4BAA4B,EAA2C,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,qBAAqB,EAAoC,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAyC,MAAM,uBAAuB,CAAA;AACzG,OAAO,EAAE,4BAA4B,EAA2C,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,2BAA2B,EAA0C,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,uBAAuB,EAAsC,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAE5E,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACvB,aAAa,GACd,CAAA","sourcesContent":["export { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nexport { RateLimitingConfiguration, type RateLimitingConfigurationSchema } from './RateLimitingConfiguration.js'\nimport { AllowAuthenticatedAccessRule, type AllowAuthenticatedAccessRuleSchema } from './AllowAuthenticated.js'\nimport { AllowPublicAccessRule, type AllowPublicAccessRuleSchema } from './AllowPublic.js'\nimport { MatchEmailDomainAccessRule, type MatchEmailDomainAccessRuleSchema } from './MatchEmailDomain.js'\nimport { MatchResourceOwnerAccessRule, type MatchResourceOwnerAccessRuleSchema } from './MatchResourceOwner.js'\nimport { MatchUserPropertyAccessRule, type MatchUserPropertyAccessRuleSchema } from './MatchUserProperty.js'\nimport { MatchUserRoleAccessRule, type MatchUserRoleAccessRuleSchema } from './MatchUserRole.js'\nimport { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js'\n\nexport {\n AllowAuthenticatedAccessRule,\n AllowPublicAccessRule,\n MatchEmailDomainAccessRule,\n MatchResourceOwnerAccessRule,\n MatchUserPropertyAccessRule,\n MatchUserRoleAccessRule,\n RateLimitRule,\n}\nexport type {\n AllowAuthenticatedAccessRuleSchema,\n AllowPublicAccessRuleSchema,\n MatchEmailDomainAccessRuleSchema,\n MatchResourceOwnerAccessRuleSchema,\n MatchUserPropertyAccessRuleSchema,\n MatchUserRoleAccessRuleSchema,\n RateLimitRuleSchema,\n}\n\nexport type ApiAccessRule =\n | AllowAuthenticatedAccessRule\n | AllowPublicAccessRule\n | MatchEmailDomainAccessRule\n | MatchResourceOwnerAccessRule\n | MatchUserPropertyAccessRule\n | MatchUserRoleAccessRule\nexport type ApiAccessRuleSchema =\n | AllowAuthenticatedAccessRuleSchema\n | AllowPublicAccessRuleSchema\n | MatchEmailDomainAccessRuleSchema\n | MatchResourceOwnerAccessRuleSchema\n | MatchUserPropertyAccessRuleSchema\n | MatchUserRoleAccessRuleSchema\n"]}
|