@aooth/arbac 0.1.62 → 0.1.64

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/dist/index.cjs CHANGED
@@ -291,16 +291,24 @@ function mergeScopeFilters(scopes) {
291
291
  return { $or: scopes };
292
292
  }
293
293
  /**
294
- * Conjoin two ALREADY-UNIONED scope filters (each the output of
295
- * {@link mergeScopeFilters} for one authority pass) under `$and` semantics — a
296
- * row survives only if BOTH sides admit it. This is the credential-attenuation
297
- * combiner: it clips any widening the credential pass might introduce.
294
+ * Conjoin two filters under `$and` semantics a row survives only if BOTH
295
+ * sides admit it. The restrict-only combiner, used wherever two independent
296
+ * constraints must both hold:
297
+ *
298
+ * - **credential attenuation** — assigned authority ∧ presented authority, so
299
+ * a scoped token can only clip what the role grants (see
300
+ * `conjoinArbacDbScopes`);
301
+ * - **scope ∧ request** — the caller's scope union ∧ the user-supplied query
302
+ * filter, on both the top-level read and the per-relation `$with` overlay.
303
+ *
304
+ * Either side may be a {@link mergeScopeFilters} output or a raw filter.
298
305
  *
299
306
  * Polarity is the **opposite** of {@link mergeScopeFilters}: an empty `{}` /
300
307
  * `undefined` filter is the universe and acts as the **identity** here
301
308
  * (dropped from the `$and`, contributing NO constraint) — never the absorbing
302
- * "unrestricted wins". Never object-spreads the two filters (credential keys
303
- * could overwrite user keys and silently widen).
309
+ * "unrestricted wins". Never object-spreads the two filters: a key present on
310
+ * both sides would be overwritten rather than intersected, silently widening
311
+ * access (a caller scoped to `tenantId: 'a'` asking for `'b'` would get `'b'`).
304
312
  *
305
313
  * @returns the conjoined filter, or `undefined` when BOTH sides are unrestricted.
306
314
  */
package/dist/index.d.cts CHANGED
@@ -206,16 +206,24 @@ declare function restrictProjection(desired: TProjection, accessControl: TProjec
206
206
  */
207
207
  declare function mergeScopeFilters(scopes: TScopeFilter[]): TScopeFilter | undefined;
208
208
  /**
209
- * Conjoin two ALREADY-UNIONED scope filters (each the output of
210
- * {@link mergeScopeFilters} for one authority pass) under `$and` semantics — a
211
- * row survives only if BOTH sides admit it. This is the credential-attenuation
212
- * combiner: it clips any widening the credential pass might introduce.
209
+ * Conjoin two filters under `$and` semantics a row survives only if BOTH
210
+ * sides admit it. The restrict-only combiner, used wherever two independent
211
+ * constraints must both hold:
212
+ *
213
+ * - **credential attenuation** — assigned authority ∧ presented authority, so
214
+ * a scoped token can only clip what the role grants (see
215
+ * `conjoinArbacDbScopes`);
216
+ * - **scope ∧ request** — the caller's scope union ∧ the user-supplied query
217
+ * filter, on both the top-level read and the per-relation `$with` overlay.
218
+ *
219
+ * Either side may be a {@link mergeScopeFilters} output or a raw filter.
213
220
  *
214
221
  * Polarity is the **opposite** of {@link mergeScopeFilters}: an empty `{}` /
215
222
  * `undefined` filter is the universe and acts as the **identity** here
216
223
  * (dropped from the `$and`, contributing NO constraint) — never the absorbing
217
- * "unrestricted wins". Never object-spreads the two filters (credential keys
218
- * could overwrite user keys and silently widen).
224
+ * "unrestricted wins". Never object-spreads the two filters: a key present on
225
+ * both sides would be overwritten rather than intersected, silently widening
226
+ * access (a caller scoped to `tenantId: 'a'` asking for `'b'` would get `'b'`).
219
227
  *
220
228
  * @returns the conjoined filter, or `undefined` when BOTH sides are unrestricted.
221
229
  */
package/dist/index.d.mts CHANGED
@@ -206,16 +206,24 @@ declare function restrictProjection(desired: TProjection, accessControl: TProjec
206
206
  */
207
207
  declare function mergeScopeFilters(scopes: TScopeFilter[]): TScopeFilter | undefined;
208
208
  /**
209
- * Conjoin two ALREADY-UNIONED scope filters (each the output of
210
- * {@link mergeScopeFilters} for one authority pass) under `$and` semantics — a
211
- * row survives only if BOTH sides admit it. This is the credential-attenuation
212
- * combiner: it clips any widening the credential pass might introduce.
209
+ * Conjoin two filters under `$and` semantics a row survives only if BOTH
210
+ * sides admit it. The restrict-only combiner, used wherever two independent
211
+ * constraints must both hold:
212
+ *
213
+ * - **credential attenuation** — assigned authority ∧ presented authority, so
214
+ * a scoped token can only clip what the role grants (see
215
+ * `conjoinArbacDbScopes`);
216
+ * - **scope ∧ request** — the caller's scope union ∧ the user-supplied query
217
+ * filter, on both the top-level read and the per-relation `$with` overlay.
218
+ *
219
+ * Either side may be a {@link mergeScopeFilters} output or a raw filter.
213
220
  *
214
221
  * Polarity is the **opposite** of {@link mergeScopeFilters}: an empty `{}` /
215
222
  * `undefined` filter is the universe and acts as the **identity** here
216
223
  * (dropped from the `$and`, contributing NO constraint) — never the absorbing
217
- * "unrestricted wins". Never object-spreads the two filters (credential keys
218
- * could overwrite user keys and silently widen).
224
+ * "unrestricted wins". Never object-spreads the two filters: a key present on
225
+ * both sides would be overwritten rather than intersected, silently widening
226
+ * access (a caller scoped to `tenantId: 'a'` asking for `'b'` would get `'b'`).
219
227
  *
220
228
  * @returns the conjoined filter, or `undefined` when BOTH sides are unrestricted.
221
229
  */
package/dist/index.mjs CHANGED
@@ -291,16 +291,24 @@ function mergeScopeFilters(scopes) {
291
291
  return { $or: scopes };
292
292
  }
293
293
  /**
294
- * Conjoin two ALREADY-UNIONED scope filters (each the output of
295
- * {@link mergeScopeFilters} for one authority pass) under `$and` semantics — a
296
- * row survives only if BOTH sides admit it. This is the credential-attenuation
297
- * combiner: it clips any widening the credential pass might introduce.
294
+ * Conjoin two filters under `$and` semantics a row survives only if BOTH
295
+ * sides admit it. The restrict-only combiner, used wherever two independent
296
+ * constraints must both hold:
297
+ *
298
+ * - **credential attenuation** — assigned authority ∧ presented authority, so
299
+ * a scoped token can only clip what the role grants (see
300
+ * `conjoinArbacDbScopes`);
301
+ * - **scope ∧ request** — the caller's scope union ∧ the user-supplied query
302
+ * filter, on both the top-level read and the per-relation `$with` overlay.
303
+ *
304
+ * Either side may be a {@link mergeScopeFilters} output or a raw filter.
298
305
  *
299
306
  * Polarity is the **opposite** of {@link mergeScopeFilters}: an empty `{}` /
300
307
  * `undefined` filter is the universe and acts as the **identity** here
301
308
  * (dropped from the `$and`, contributing NO constraint) — never the absorbing
302
- * "unrestricted wins". Never object-spreads the two filters (credential keys
303
- * could overwrite user keys and silently widen).
309
+ * "unrestricted wins". Never object-spreads the two filters: a key present on
310
+ * both sides would be overwritten rather than intersected, silently widening
311
+ * access (a caller scoped to `tenantId: 'a'` asking for `'b'` would get `'b'`).
304
312
  *
305
313
  * @returns the conjoined filter, or `undefined` when BOTH sides are unrestricted.
306
314
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aooth/arbac",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "Batteries-included RBAC: builder API, privilege factories, scope merge utilities",
5
5
  "keywords": [
6
6
  "access-control",
@@ -45,7 +45,7 @@
45
45
  "access": "public"
46
46
  },
47
47
  "dependencies": {
48
- "@aooth/arbac-core": "0.1.62"
48
+ "@aooth/arbac-core": "0.1.64"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vp pack",