@harperfast/template-vue-studio 1.13.6 → 1.13.7

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.
Files changed (36) hide show
  1. package/.agents/skills/harper-best-practices/AGENTS.md +1260 -1113
  2. package/.agents/skills/harper-best-practices/rules/automatic-apis.md +118 -83
  3. package/.agents/skills/harper-best-practices/rules/checking-authentication.md +244 -256
  4. package/.agents/skills/harper-best-practices/rules/custom-resources.md +37 -42
  5. package/.agents/skills/harper-best-practices/rules/defining-relationships.md +86 -49
  6. package/.agents/skills/harper-best-practices/rules/deploying-from-ci.md +163 -170
  7. package/.agents/skills/harper-best-practices/rules/deploying-to-harper-fabric.md +128 -88
  8. package/.agents/skills/harper-best-practices/rules/load-env.md +27 -30
  9. package/.agents/skills/harper-best-practices/rules/programmatic-table-requests.md +184 -155
  10. package/.agents/skills/harper-best-practices/rules/querying-rest-apis.md +146 -94
  11. package/.agents/skills/harper-best-practices/rules/schema-design-tooling.md +60 -77
  12. package/.agents/skills/harper-best-practices/rules/v5-upgrade.md +52 -63
  13. package/.agents/skills/harper-best-practices/rules/vector-indexing.md +77 -68
  14. package/.agents/skills/harper-mcp/AGENTS.md +228 -155
  15. package/.agents/skills/harper-mcp/rules/custom-mcp-tools.md +35 -41
  16. package/.agents/skills/harper-mcp/rules/enabling-mcp.md +104 -92
  17. package/.agents/skills/harper-mcp/rules/rate-limiting.md +95 -28
  18. package/agent/skills/harper-best-practices/AGENTS.md +1260 -1113
  19. package/agent/skills/harper-best-practices/rules/automatic-apis.md +118 -83
  20. package/agent/skills/harper-best-practices/rules/checking-authentication.md +244 -256
  21. package/agent/skills/harper-best-practices/rules/custom-resources.md +37 -42
  22. package/agent/skills/harper-best-practices/rules/defining-relationships.md +86 -49
  23. package/agent/skills/harper-best-practices/rules/deploying-from-ci.md +163 -170
  24. package/agent/skills/harper-best-practices/rules/deploying-to-harper-fabric.md +128 -88
  25. package/agent/skills/harper-best-practices/rules/load-env.md +27 -30
  26. package/agent/skills/harper-best-practices/rules/programmatic-table-requests.md +184 -155
  27. package/agent/skills/harper-best-practices/rules/querying-rest-apis.md +146 -94
  28. package/agent/skills/harper-best-practices/rules/schema-design-tooling.md +60 -77
  29. package/agent/skills/harper-best-practices/rules/v5-upgrade.md +52 -63
  30. package/agent/skills/harper-best-practices/rules/vector-indexing.md +77 -68
  31. package/agent/skills/harper-mcp/AGENTS.md +228 -155
  32. package/agent/skills/harper-mcp/rules/custom-mcp-tools.md +35 -41
  33. package/agent/skills/harper-mcp/rules/enabling-mcp.md +104 -92
  34. package/agent/skills/harper-mcp/rules/rate-limiting.md +95 -28
  35. package/package.json +1 -1
  36. package/skills-lock.json +2 -2
@@ -19,8 +19,8 @@ metadata:
19
19
  - reference/v5/security/jwt-authentication.md#Token Expiry Configuration
20
20
  - reference/v5/security/jwt-authentication.md#When to Use JWT Auth
21
21
  - reference/v5/security/jwt-authentication.md#Security Notes
22
- sourceCommit: 9e6ecf87dd25bb488ad44dc2876ca6439ccd682e
23
- inputHash: 1837f39fdfe06fac
22
+ sourceCommit: 9628b6ae7649c6f6ba4d65465e83cf75d7a9b2bd
23
+ inputHash: e8b7023b3a3ba2b5
24
24
  ---
25
25
 
26
26
  # Checking Authentication
@@ -31,250 +31,248 @@ Instructions for the agent to handle user authentication, sessions, and JWT toke
31
31
 
32
32
  ## When to Use
33
33
 
34
- Apply this rule when implementing login/logout flows, reading the current authenticated user, issuing or refreshing JWT tokens, or minting scoped tokens from a custom Resource. Use it whenever a Resource must gate behavior on identity or credentials. See [custom-resources.md](custom-resources.md) for the broader Resource authoring model.
34
+ Apply this rule when implementing sign-in/sign-out flows, reading the current authenticated user, issuing or refreshing JWT tokens, or minting scoped tokens from a custom Resource. Use it whenever a Resource must inspect, establish, or delegate authentication state. See [custom-resources.md](custom-resources.md) for the broader Resource authoring context.
35
35
 
36
36
  ## How It Works
37
37
 
38
- ### 1. Reading the Current Authenticated User
39
-
40
- **In an instance method**, call `getCurrentUser()` to get the user associated with the current request, or `undefined` if unauthenticated. The returned object exposes `username`, `role`, and `role.permission` flags.
41
-
42
- **In a static verb**, read the user from the `context` argument instead — `context.user`:
43
-
44
- ```javascript
45
- static async get(_target, context) {
46
- const user = context?.user;
47
- if (!user) return new Response(null, { status: 401 });
48
- return { username: user.username, role: user.role };
49
- }
50
- ```
51
-
52
- ### 2. Reading the Full Context
53
-
54
- **In an instance method**, call `getContext()` to retrieve the current context, which includes:
55
-
56
- - `user` — User object with username, role, and authorization information
57
- - `transaction` — The current transaction
58
-
59
- **In a static verb**, the context is the trailing argument:
60
-
61
- - `(target, context)` for `get`/`delete`
62
- - `(target, data, context)` for `put`/`patch`/`post`
63
-
64
- When triggered by HTTP, the context also exposes `url`, `method`, `headers`, `responseHeaders`, `pathname`, `host`, `ip`, `body`, `data`, `lastModified`, and `requestContext`.
65
-
66
- ### 3. Handling Sessions and Login
67
-
68
- Enable sessions in `harper-config.yaml`:
69
-
70
- ```yaml
71
- authentication:
72
- enableSessions: true
73
- ```
74
-
75
- Use `context.login` in a static `post` verb to verify credentials and establish a session cookie:
76
-
77
- ```javascript
78
- export class SignIn extends Resource {
79
- static async post(_target, data, context) {
80
- const { username, password } = (await data) ?? {};
81
- try {
82
- await context.login(username, password);
83
- } catch {
84
- return new Response('Invalid credentials', { status: 403 });
85
- }
86
- return new Response('Logged in', { status: 200 });
87
- }
88
- }
89
-
90
- export class SignOut extends Resource {
91
- static async post(_target, _data, context) {
92
- if (!context?.session?.user) return new Response(null, { status: 401 });
93
- await context.session.update({ user: null });
94
- return new Response('Logged out', { status: 200 });
95
- }
96
- }
97
- ```
98
-
99
- - `context.login(username, password)` verifies credentials and sets the session cookie on success.
100
- - To end a session, call `context.session.update({ user: null })` — `update` is the session's only mutator.
101
- - `context.session` is an empty object (not `undefined`) when sessions are enabled and no session cookie is present; test `context?.session?.user` to detect an established session.
102
- - Cookie-based sessions are for browser clients. For non-browser clients, use JWT issuance.
103
-
104
- ### 4. Creating Authentication Tokens
105
-
106
- Call `create_authentication_tokens` with credentials in the body — no `Authorization` header is required when `username` and `password` are supplied:
107
-
108
- ```json
109
- {
110
- "operation": "create_authentication_tokens",
111
- "username": "username",
112
- "password": "password"
113
- }
114
- ```
115
-
116
- Response:
117
-
118
- ```json
119
- {
120
- "operation_token": "<jwt-operation-token>",
121
- "refresh_token": "<jwt-refresh-token>"
122
- }
123
- ```
124
-
125
- Pass the `operation_token` as a `Bearer` token on subsequent requests:
126
-
127
- ```bash
128
- curl --location --request POST 'http://localhost:9925' \
129
- --header 'Content-Type: application/json' \
130
- --header 'Authorization: Bearer <operation_token>' \
131
- --data-raw '{
132
- "operation": "search_by_hash",
133
- "schema": "dev",
134
- "table": "dog",
135
- "hash_values": [1],
136
- "get_attributes": ["*"]
137
- }'
138
- ```
139
-
140
- ### 5. Refreshing the Operation Token
141
-
142
- When the `operation_token` expires, pass the `refresh_token` as `Bearer <refresh_token>` and call `refresh_operation_token`:
143
-
144
- ```bash
145
- curl --location --request POST 'http://localhost:9925' \
146
- --header 'Content-Type: application/json' \
147
- --header 'Authorization: Bearer <refresh_token>' \
148
- --data-raw '{
149
- "operation": "refresh_operation_token"
150
- }'
151
- ```
152
-
153
- Response:
154
-
155
- ```json
156
- {
157
- "operation_token": "<new-jwt-operation-token>"
158
- }
159
- ```
160
-
161
- When both tokens have expired, call `create_authentication_tokens` again with username and password.
162
-
163
- ### 6. Minting Scoped Tokens
164
-
165
- A `super_user` can mint a scoped token with embedded permissions using `create_authentication_tokens` with an inline `role`. The minter must be authenticated; no `password` may be included in the body. Use `add_role`-style `permission` structure:
166
-
167
- ```json
168
- {
169
- "operation": "create_authentication_tokens",
170
- "username": "reporting-service",
171
- "role": {
172
- "permission": {
173
- "operations": ["read_only"],
174
- "dev": {
175
- "tables": {
176
- "dog": {
177
- "read": true,
178
- "insert": false,
179
- "update": false,
180
- "delete": false,
181
- "attribute_permissions": []
182
- }
183
- }
184
- }
185
- }
186
- },
187
- "expires_in": "7d"
188
- }
189
- ```
190
-
191
- Authenticate the mint request with Basic Authentication or an existing `super_user` `operation_token`:
192
-
193
- ```bash
194
- curl --location --request POST 'http://localhost:9925' \
195
- --header 'Content-Type: application/json' \
196
- --header 'Authorization: Basic <base64 of super_user:password>' \
197
- --data-raw '{
198
- "operation": "create_authentication_tokens",
199
- "username": "reporting-service",
200
- "role": { "permission": { "operations": ["read_only"] } },
201
- "expires_in": "7d"
202
- }'
203
- ```
204
-
205
- Key constraints for scoped tokens:
206
-
207
- - `username` is attribution only and must not name an existing user.
208
- - No refresh token is issued; no user record is created.
209
- - Scoped tokens cannot be revoked before expiry — choose `expires_in` carefully and prefer short lifetimes.
210
- - `super_user` and `cluster_user` are always forced to `false` in the embedded role.
211
- - In **mixed-version** clusters, only nodes with scoped-token support accept these tokens; older nodes reject them with 401.
212
-
213
- ### 7. Issuing Tokens from a Custom Resource
214
-
215
- Use `server.operation()` to mint tokens programmatically inside a Resource. Pass `authorize: true` as the **third argument** when the operation should run as the current authenticated user:
216
-
217
- ```javascript
218
- import { Resource, server } from 'harper';
219
-
220
- export class IssueTokens extends Resource {
221
- static async get(_target, context) {
222
- // Issue tokens for the current authenticated user
223
- const { operation_token, refresh_token } = await server.operation(
224
- { operation: 'create_authentication_tokens' },
225
- context,
226
- true, // third argument: authorize as current user
227
- );
228
- return { operation_token, refresh_token };
229
- }
230
-
231
- static async post(_target, data) {
232
- // Issue tokens from credentials supplied in the body
233
- const { username, password } = await data;
234
- if (!username || !password) {
235
- return new Response('username and password required', { status: 400 });
236
- }
237
- const { operation_token, refresh_token } = await server.operation({
238
- operation: 'create_authentication_tokens',
239
- username,
240
- password,
241
- });
242
- return { operation_token, refresh_token };
243
- }
244
- }
245
-
246
- export class RefreshJWT extends Resource {
247
- static async post(_target, data) {
248
- const { refresh_token } = await data;
249
- if (!refresh_token) {
250
- return new Response('refresh_token required', { status: 400 });
251
- }
252
- const { operation_token } = await server.operation({
253
- operation: 'refresh_operation_token',
254
- refresh_token,
255
- });
256
- return { operation_token };
257
- }
258
- }
259
- ```
260
-
261
- Omit the third argument (or pass `false`) when the operation supplies its own credentials.
262
-
263
- ### 8. Configuring Token Expiry
264
-
265
- Set timeouts in `harper-config.yaml` under the `authentication` section:
266
-
267
- ```yaml
268
- authentication:
269
- operationTokenTimeout: 1d # Default: 1 day
270
- refreshTokenTimeout: 30d # Default: 30 days
271
- ```
272
-
273
- Valid duration strings follow the `jsonwebtoken` package format (e.g., `1d`, `12h`, `60m`). The `expires_in` field on scoped token minting accepts the same format.
38
+ ### Reading the Current User
39
+
40
+ 1. **Use `getCurrentUser()` in instance methods**: Call `getCurrentUser()` on a Resource instance to get the current authenticated user, or `undefined` if no user is authenticated. The returned object exposes `username`, `role`, and `role.permission` flags.
41
+
42
+ 2. **Use `context.user` in static verbs**: Static verbs receive the context as a trailing argument. Read the current authenticated user from `context?.user`:
43
+
44
+ ```javascript
45
+ static async get(_target, context) {
46
+ const user = context?.user;
47
+ if (!user) return new Response(null, { status: 401 });
48
+ return { username: user.username, role: user.role };
49
+ }
50
+ ```
51
+
52
+ 3. **Use `getContext()` for dual-path static methods**: `getContext()` is a Resource instance method. For static methods that must work both via HTTP and direct server-side calls, import `getContext()` from the `harper` module. Static verbs receive context as the trailing argument — `(target, context)` for `get`/`delete`, `(target, data, context)` for `put`/`patch`/`post`.
53
+
54
+ 4. **Access HTTP-specific context properties**: When triggered by HTTP, the context is the `Request` object with additional properties. Use these to read request metadata or set response headers:
55
+
56
+ | Property | Description |
57
+ | ----------------- | -------------------------------------------------------------------------------- |
58
+ | `url` | Full local path including query string |
59
+ | `method` | HTTP method |
60
+ | `headers` | Request headers (`context.headers.get(name)`) |
61
+ | `responseHeaders` | Response headers (`context.responseHeaders.set(name, value)`) |
62
+ | `pathname` | Path without query string |
63
+ | `host` | Host from the `Host` header |
64
+ | `ip` | Client IP address |
65
+ | `body` | Raw Node.js `Readable` stream (if a request body exists) |
66
+ | `data` | Promise resolving to the deserialized request body |
67
+ | `lastModified` | Controls `ETag`/`Last-Modified` response header |
68
+ | `requestContext` | (Source resources only) Context of the upstream resource making the data request |
69
+ | `transaction` | Current transaction |
70
+
71
+ When triggered by HTTP, the context also exposes `url`, `method`, `headers`, `responseHeaders`, `pathname`, `host`, `ip`, `body`, `data`, `lastModified`, and `requestContext`.
72
+
73
+ ### Session-Based Login and Logout
74
+
75
+ 5. **Enable sessions in config**: Set `authentication.enableSessions: true` in `harperdb-config.yaml` before using `context.login` or `context.session`.
76
+
77
+ 6. **Implement sign-in with `context.login`**: Call `context.login(username, password)` in a static `post` verb. It verifies credentials and establishes the session cookie on success:
78
+
79
+ ```javascript
80
+ export class SignIn extends Resource {
81
+ static async post(_target, data, context) {
82
+ const { username, password } = (await data) ?? {};
83
+ try {
84
+ await context.login(username, password);
85
+ } catch {
86
+ return new Response('Invalid credentials', { status: 403 });
87
+ }
88
+ return new Response('Logged in', { status: 200 });
89
+ }
90
+ }
91
+ ```
92
+
93
+ 7. **Implement sign-out by clearing the session user**: Use `context.session.update({ user: null })` — `update` is the session's only mutator. Test `context?.session?.user` to detect an established session, because `context.session` is an empty object (not `undefined`) when sessions are enabled and no session cookie is present:
94
+
95
+ ```javascript
96
+ export class SignOut extends Resource {
97
+ static async post(_target, _data, context) {
98
+ if (!context?.session?.user) return new Response(null, { status: 401 });
99
+ await context.session.update({ user: null });
100
+ return new Response('Logged out', { status: 200 });
101
+ }
102
+ }
103
+ ```
104
+
105
+ Cookie-based sessions are intended for browser clients. For non-browser clients, use JWT issuance.
106
+
107
+ ### JWT Token Issuance
108
+
109
+ 8. **Call `create_authentication_tokens` with credentials**: Send `username` and `password` in the request body. No `Authorization` header is required when credentials are in the body:
110
+
111
+ ```json
112
+ {
113
+ "operation": "create_authentication_tokens",
114
+ "username": "username",
115
+ "password": "password"
116
+ }
117
+ ```
118
+
119
+ Response:
120
+
121
+ ```json
122
+ {
123
+ "operation_token": "<jwt-operation-token>",
124
+ "refresh_token": "<jwt-refresh-token>"
125
+ }
126
+ ```
127
+
128
+ 9. **Pass the `operation_token` as a Bearer token** on subsequent requests:
129
+
130
+ ```bash
131
+ curl --location --request POST 'http://localhost:9925' \
132
+ --header 'Content-Type: application/json' \
133
+ --header 'Authorization: Bearer <operation_token>' \
134
+ --data-raw '{
135
+ "operation": "search_by_hash",
136
+ "schema": "dev",
137
+ "table": "dog",
138
+ "hash_values": [1],
139
+ "get_attributes": ["*"]
140
+ }'
141
+ ```
142
+
143
+ 10. **Refresh an expired `operation_token`** using `refresh_operation_token`. Pass the `refresh_token` as `Bearer <refresh_token>`:
144
+
145
+ ```bash
146
+ curl --location --request POST 'http://localhost:9925' \
147
+ --header 'Content-Type: application/json' \
148
+ --header 'Authorization: Bearer <refresh_token>' \
149
+ --data-raw '{
150
+ "operation": "refresh_operation_token"
151
+ }'
152
+ ```
153
+
154
+ Response:
155
+
156
+ ```json
157
+ {
158
+ "operation_token": "<new-jwt-operation-token>"
159
+ }
160
+ ```
161
+
162
+ When both tokens have expired, call `create_authentication_tokens` again with username and password.
163
+
164
+ ### Scoped Tokens (Inline Role)
165
+
166
+ 11. **Mint a scoped token as a `super_user`**: Pass `role` as an inline role-shaped object using the same `permission` structure as `add_role`. The minter must be authenticated as a `super_user`; no `password` may be included in the body. Use `expires_in` to set the token lifetime:
167
+
168
+ ```json
169
+ {
170
+ "operation": "create_authentication_tokens",
171
+ "username": "reporting-service",
172
+ "role": {
173
+ "permission": {
174
+ "operations": ["read_only"],
175
+ "dev": {
176
+ "tables": {
177
+ "dog": {
178
+ "read": true,
179
+ "insert": false,
180
+ "update": false,
181
+ "delete": false,
182
+ "attribute_permissions": []
183
+ }
184
+ }
185
+ }
186
+ }
187
+ },
188
+ "expires_in": "7d"
189
+ }
190
+ ```
191
+
192
+ Authenticate the mint request with Basic Authentication or an existing `super_user` `operation_token`:
193
+
194
+ ```bash
195
+ curl --location --request POST 'http://localhost:9925' \
196
+ --header 'Content-Type: application/json' \
197
+ --header 'Authorization: Basic <base64 of super_user:password>' \
198
+ --data-raw '{
199
+ "operation": "create_authentication_tokens",
200
+ "username": "reporting-service",
201
+ "role": { "permission": { "operations": ["read_only"] } },
202
+ "expires_in": "7d"
203
+ }'
204
+ ```
205
+
206
+ Key constraints:
207
+ - `username` is attribution only and must not name an existing user.
208
+ - No refresh token is issued; no user record is created.
209
+ - Scoped tokens cannot be revoked before expiry — prefer short lifetimes.
210
+ - `super_user` and `cluster_user` are always forced to `false` in the embedded role.
211
+ - In **mixed-version** clusters, only nodes with scoped-token support accept these tokens; older nodes reject them with a 401.
212
+
213
+ ### Issuing Tokens from a Custom Resource
214
+
215
+ 12. **Use `server.operation()` to mint tokens programmatically**: Import `server` from `harper` and call `server.operation(operation, context, authorize)`. Pass `authorize: true` as the **third argument** when the operation should run as the current authenticated user; omit it or pass `false` when the operation supplies its own credentials:
216
+
217
+ ```javascript
218
+ import { Resource, server } from 'harper';
219
+
220
+ export class IssueTokens extends Resource {
221
+ static async get(_target, context) {
222
+ // Caller is already authenticated — issue tokens for the current authenticated user.
223
+ const { operation_token, refresh_token } = await server.operation(
224
+ { operation: 'create_authentication_tokens' },
225
+ context,
226
+ true,
227
+ );
228
+ return { operation_token, refresh_token };
229
+ }
230
+
231
+ static async post(_target, data) {
232
+ // Caller provides credentials in the body.
233
+ const { username, password } = await data;
234
+ if (!username || !password) {
235
+ return new Response('username and password required', { status: 400 });
236
+ }
237
+ const { operation_token, refresh_token } = await server.operation({
238
+ operation: 'create_authentication_tokens',
239
+ username,
240
+ password,
241
+ });
242
+ return { operation_token, refresh_token };
243
+ }
244
+ }
245
+
246
+ export class RefreshJWT extends Resource {
247
+ static async post(_target, data) {
248
+ const { refresh_token } = await data;
249
+ if (!refresh_token) {
250
+ return new Response('refresh_token required', { status: 400 });
251
+ }
252
+ const { operation_token } = await server.operation({
253
+ operation: 'refresh_operation_token',
254
+ refresh_token,
255
+ });
256
+ return { operation_token };
257
+ }
258
+ }
259
+ ```
260
+
261
+ ### Token Expiry Configuration
262
+
263
+ 13. **Configure token timeouts** in `harper-config.yaml` under the `authentication` section:
264
+
265
+ ```yaml
266
+ authentication:
267
+ operationTokenTimeout: 1d # Default: 1 day
268
+ refreshTokenTimeout: 30d # Default: 30 days
269
+ ```
270
+
271
+ Valid duration strings follow the `jsonwebtoken` package format (e.g., `1d`, `12h`, `60m`).
274
272
 
275
273
  ## Examples
276
274
 
277
- ### Full Sign-In / Sign-Out Resource
275
+ ### Full sign-in/sign-out Resource pair
278
276
 
279
277
  ```javascript
280
278
  export class SignIn extends Resource {
@@ -298,17 +296,7 @@ export class SignOut extends Resource {
298
296
  }
299
297
  ```
300
298
 
301
- ### Reading the Current Authenticated User in a Static Verb
302
-
303
- ```javascript
304
- static async get(_target, context) {
305
- const user = context?.user;
306
- if (!user) return new Response(null, { status: 401 });
307
- return { username: user.username, role: user.role };
308
- }
309
- ```
310
-
311
- ### Minting Tokens via cURL
299
+ ### Minting tokens via the Operations API
312
300
 
313
301
  ```bash
314
302
  curl --location --request POST 'http://localhost:9925' \
@@ -322,9 +310,9 @@ curl --location --request POST 'http://localhost:9925' \
322
310
 
323
311
  ## Notes
324
312
 
325
- - JWT authentication is **preferred over Basic Auth** when you want to avoid sending credentials on every request, your client can store tokens, or you have multiple sequential requests. For simple or **server-to-server** scenarios, use **Basic Authentication**.
313
+ - **JWT is preferred over Basic Auth** for clients that can store tokens, want to avoid sending credentials on every request, or make multiple sequential requests. For simple or **server-to-server** scenarios, use Basic Authentication.
326
314
  - Always use **HTTPS** in production to protect tokens in transit.
327
- - Treat tokens like passwords. If a token is compromised, it remains valid until expiry — use shorter `operationTokenTimeout` values in high-security environments.
328
- - `context.login` and `context.session` require `enableSessions: true` in `harperdb-config.yaml`; they are for browser clients only.
329
- - The `server.operation()` third argument (`authorize: true`) attributes the operation to — and permission-checks against — the current authenticated user. Omit it when supplying credentials directly in the operation body.
330
- - In **mixed-version** clusters, scoped tokens are only accepted by nodes that support them; older nodes return 401.
315
+ - Treat tokens like passwords. Because scoped tokens cannot be revoked before expiry, set short `expires_in` values in high-security environments and consider lowering `operationTokenTimeout`.
316
+ - A caller authenticated by a Bearer validator cannot mint tokens via the passwordless form — it must supply `username` and `password`.
317
+ - `enableSessions` is required in `harperdb-config.yaml` for `context.login` and `context.session` to be available.
318
+ - The **third argument** (`authorize: true`) to `server.operation()` attributes the operation to — and permission-checks against — the calling user.