@cosmicdrift/kumiko-bundled-features 0.260.0 → 0.262.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.260.0",
3
+ "version": "0.262.0",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -129,12 +129,12 @@
129
129
  "./workflow-runner": "./src/workflow-runner/index.ts"
130
130
  },
131
131
  "dependencies": {
132
- "@cosmicdrift/kumiko-dispatcher-live": "0.260.0",
133
- "@cosmicdrift/kumiko-framework": "0.260.0",
134
- "@cosmicdrift/kumiko-headless": "0.260.0",
135
- "@cosmicdrift/kumiko-renderer": "0.260.0",
136
- "@cosmicdrift/kumiko-renderer-web": "0.260.0",
137
- "@cosmicdrift/kumiko-types": "0.260.0",
132
+ "@cosmicdrift/kumiko-dispatcher-live": "0.262.0",
133
+ "@cosmicdrift/kumiko-framework": "0.262.0",
134
+ "@cosmicdrift/kumiko-headless": "0.262.0",
135
+ "@cosmicdrift/kumiko-renderer": "0.262.0",
136
+ "@cosmicdrift/kumiko-renderer-web": "0.262.0",
137
+ "@cosmicdrift/kumiko-types": "0.262.0",
138
138
  "@mollie/api-client": "^4.5.0",
139
139
  "@node-rs/argon2": "^2.0.2",
140
140
  "@types/mailparser": "^3.4.6",
@@ -163,7 +163,7 @@
163
163
  ],
164
164
  "devDependencies": {
165
165
  "@testing-library/user-event": "^14.6.1",
166
- "@cosmicdrift/kumiko-locale-de": "0.260.0",
167
- "@cosmicdrift/kumiko-locale-es": "0.260.0"
166
+ "@cosmicdrift/kumiko-locale-de": "0.262.0",
167
+ "@cosmicdrift/kumiko-locale-es": "0.262.0"
168
168
  }
169
169
  }
@@ -0,0 +1,35 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { SECURITY_BASELINE_FEATURE_NAMES } from "@cosmicdrift/kumiko-framework/engine";
3
+ import { dsgvoSelfServiceFeatures } from "../dsgvo-self-service";
4
+ import { securityBaselineFeatures } from "../security-baseline";
5
+
6
+ describe("securityBaselineFeatures", () => {
7
+ test("returns exactly the SECURITY_BASELINE_FEATURE_NAMES feature names", () => {
8
+ const names = securityBaselineFeatures().map((f) => f.name);
9
+ expect(names).toEqual([...SECURITY_BASELINE_FEATURE_NAMES]);
10
+ });
11
+
12
+ test("includeSessions:false omits sessions but keeps the other three", () => {
13
+ const names = securityBaselineFeatures({ includeSessions: false }).map((f) => f.name);
14
+ expect(names).not.toContain("sessions");
15
+ expect(names).toEqual(["crypto-shredding", "rate-limiting", "audit"]);
16
+ });
17
+
18
+ test("combined with dsgvoSelfServiceFeatures({ includeSessions: false }) has no duplicate names and covers the baseline", () => {
19
+ const combined = [
20
+ ...dsgvoSelfServiceFeatures(),
21
+ ...securityBaselineFeatures({ includeSessions: false }),
22
+ ];
23
+ const names = combined.map((f) => f.name);
24
+ expect(new Set(names).size).toBe(names.length);
25
+ for (const name of SECURITY_BASELINE_FEATURE_NAMES) {
26
+ expect(names).toContain(name);
27
+ }
28
+ });
29
+
30
+ test("each call yields fresh feature instances (no shared mutable state)", () => {
31
+ const a = securityBaselineFeatures();
32
+ const b = securityBaselineFeatures();
33
+ expect(a[0]).not.toBe(b[0]);
34
+ });
35
+ });
@@ -1 +1,8 @@
1
- []
1
+ [
2
+ {
3
+ "version": "0.262.0",
4
+ "type": "improvement",
5
+ "title": "securityBaselineFeatures() preset: sessions, crypto-shredding, rate-limiting, audit (fw#2857).",
6
+ "detail": "`securityBaselineFeatures(opts?: { includeSessions?: boolean })` (`@cosmicdrift/kumiko-bundled-features/presets`) returns `[createSessionsFeature(), createCryptoShreddingFeature(), createRateLimitingFeature(), createAuditFeature()]` in that order — fresh instances per call, mirroring `dsgvoSelfServiceFeatures()`. `includeSessions: false` drops `createSessionsFeature()` from the returned array for apps that already mount `sessions` via `dsgvoSelfServiceFeatures()` (mounting the same feature name twice throws at boot). The host app still needs to mount `user`, `tenant`, and `auth-foundation` itself — `sessions` requires `user`/`auth-foundation`, `audit` requires `tenant`. Pairs with the new boot-validator warning that fires at `NODE_ENV=production` when any of the four feature names (`SECURITY_BASELINE_FEATURE_NAMES`, `@cosmicdrift/kumiko-framework/engine`) is missing from the mounted feature list."
7
+ }
8
+ ]
@@ -1 +1,2 @@
1
1
  export { type DsgvoSelfServiceOptions, dsgvoSelfServiceFeatures } from "./dsgvo-self-service";
2
+ export { type SecurityBaselineOptions, securityBaselineFeatures } from "./security-baseline";
@@ -0,0 +1,20 @@
1
+ import type { FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
2
+ import { createAuditFeature } from "../audit";
3
+ import { createCryptoShreddingFeature } from "../crypto-shredding";
4
+ import { createRateLimitingFeature } from "../rate-limiting";
5
+ import { createSessionsFeature } from "../sessions";
6
+
7
+ export type SecurityBaselineOptions = {
8
+ readonly includeSessions?: boolean;
9
+ };
10
+
11
+ // includeSessions: false when dsgvoSelfServiceFeatures() already mounts sessions (duplicate
12
+ // feature names throw); host app must mount user, tenant, auth-foundation (sessions/audit requires).
13
+ export function securityBaselineFeatures(opts: SecurityBaselineOptions = {}): FeatureDefinition[] {
14
+ return [
15
+ ...(opts.includeSessions !== false ? [createSessionsFeature()] : []),
16
+ createCryptoShreddingFeature(),
17
+ createRateLimitingFeature(),
18
+ createAuditFeature(),
19
+ ];
20
+ }