@fuzdev/fuz_app 0.54.0 → 0.55.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/dist/actions/CLAUDE.md +68 -13
- package/dist/actions/action_codegen.d.ts +13 -0
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +15 -1
- package/dist/actions/action_rpc.d.ts +60 -7
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +158 -44
- package/dist/actions/register_action_ws.d.ts +4 -4
- package/dist/actions/register_action_ws.js +6 -6
- package/dist/actions/register_ws_endpoint.d.ts +20 -7
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +30 -5
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +0 -4
- package/dist/auth/CLAUDE.md +219 -66
- package/dist/auth/account_actions.d.ts +6 -6
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +8 -11
- package/dist/auth/account_queries.d.ts +6 -3
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +14 -5
- package/dist/auth/account_routes.d.ts +7 -10
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +70 -23
- package/dist/auth/account_schema.d.ts +19 -0
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +20 -0
- package/dist/auth/admin_action_specs.d.ts +45 -11
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +23 -8
- package/dist/auth/admin_actions.d.ts +8 -7
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +11 -18
- package/dist/auth/audit_log_queries.d.ts +53 -14
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +45 -2
- package/dist/auth/audit_log_schema.d.ts +55 -1
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +19 -3
- package/dist/auth/bearer_auth.d.ts +9 -7
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +13 -21
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +5 -0
- package/dist/auth/daemon_token_middleware.d.ts +23 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +26 -20
- package/dist/auth/deps.d.ts +14 -0
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +4 -2
- package/dist/auth/migrations.d.ts +15 -7
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +15 -7
- package/dist/auth/permit_offer_action_specs.d.ts +45 -6
- package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/permit_offer_action_specs.js +38 -7
- package/dist/auth/permit_offer_actions.d.ts +2 -2
- package/dist/auth/permit_offer_actions.d.ts.map +1 -1
- package/dist/auth/permit_offer_actions.js +98 -90
- package/dist/auth/permit_offer_notifications.d.ts +10 -0
- package/dist/auth/permit_offer_notifications.d.ts.map +1 -1
- package/dist/auth/permit_offer_queries.d.ts +68 -9
- package/dist/auth/permit_offer_queries.d.ts.map +1 -1
- package/dist/auth/permit_offer_queries.js +147 -35
- package/dist/auth/permit_offer_schema.d.ts +23 -1
- package/dist/auth/permit_offer_schema.d.ts.map +1 -1
- package/dist/auth/permit_offer_schema.js +5 -0
- package/dist/auth/permit_queries.d.ts +17 -5
- package/dist/auth/permit_queries.d.ts.map +1 -1
- package/dist/auth/permit_queries.js +19 -8
- package/dist/auth/request_context.d.ts +321 -38
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +393 -66
- package/dist/auth/route_guards.d.ts +10 -4
- package/dist/auth/route_guards.d.ts.map +1 -1
- package/dist/auth/route_guards.js +14 -8
- package/dist/auth/self_service_role_action_specs.d.ts +2 -0
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +2 -0
- package/dist/auth/self_service_role_actions.d.ts +6 -5
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +18 -8
- package/dist/db/migrate.d.ts +11 -7
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +9 -6
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +5 -3
- package/dist/hono_context.d.ts +77 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +50 -0
- package/dist/http/CLAUDE.md +80 -17
- package/dist/http/error_schemas.d.ts +92 -1
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +73 -16
- package/dist/http/jsonrpc_errors.d.ts +27 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +26 -2
- package/dist/http/route_spec.d.ts +62 -4
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +117 -21
- package/dist/http/schema_helpers.d.ts +13 -1
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +21 -2
- package/dist/http/surface.d.ts +10 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +2 -2
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +11 -1
- package/dist/testing/CLAUDE.md +23 -17
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +15 -13
- package/dist/testing/adversarial_headers.js +1 -1
- package/dist/testing/app_server.js +2 -2
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +21 -7
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +6 -3
- package/dist/testing/entities.d.ts +2 -1
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +1 -0
- package/dist/testing/integration_helpers.d.ts +4 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +9 -5
- package/dist/testing/middleware.d.ts +12 -8
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +67 -25
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +5 -1
- package/dist/ui/CLAUDE.md +16 -10
- package/dist/ui/PermitOfferForm.svelte +14 -0
- package/dist/ui/PermitOfferForm.svelte.d.ts +6 -0
- package/dist/ui/PermitOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +8 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +14 -3
- package/dist/ui/permit_offers_state.svelte.d.ts +9 -1
- package/dist/ui/permit_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/permit_offers_state.svelte.js +7 -1
- package/package.json +1 -1
package/dist/auth/cleanup.js
CHANGED
|
@@ -38,10 +38,15 @@ export const cleanup_expired_permit_offers = async (deps) => {
|
|
|
38
38
|
const { on_audit_event, audit_log_config } = deps;
|
|
39
39
|
for (const offer of expired) {
|
|
40
40
|
try {
|
|
41
|
+
// `permit_offer_expire` populates `target_actor_id` only when the
|
|
42
|
+
// offer was actor-targeted (`to_actor_id` set at create time).
|
|
43
|
+
// Account-grain offers (no `to_actor_id`) never bound to a
|
|
44
|
+
// specific actor and leave the field null.
|
|
41
45
|
const event = await query_audit_log(deps, {
|
|
42
46
|
event_type: 'permit_offer_expire',
|
|
43
47
|
actor_id: offer.from_actor_id,
|
|
44
48
|
target_account_id: offer.to_account_id,
|
|
49
|
+
target_actor_id: offer.to_actor_id,
|
|
45
50
|
ip: null,
|
|
46
51
|
metadata: {
|
|
47
52
|
offer_id: offer.id,
|
|
@@ -41,10 +41,16 @@ export declare const get_daemon_token_path: (runtime: Pick<EnvDeps, "env_get">,
|
|
|
41
41
|
*/
|
|
42
42
|
export declare const write_daemon_token: (runtime: DaemonTokenWriteDeps, token_path: string, token: string) => Promise<void>;
|
|
43
43
|
/**
|
|
44
|
-
* Resolve the keeper account ID by querying for the account with an active
|
|
44
|
+
* Resolve the keeper account ID by querying for the account with an active
|
|
45
|
+
* keeper permit.
|
|
45
46
|
*
|
|
46
|
-
* There is exactly one keeper account (the bootstrap account). Runs once
|
|
47
|
-
* server startup — the result is cached in
|
|
47
|
+
* There is exactly one keeper account (the bootstrap account). Runs once
|
|
48
|
+
* at server startup — the result is cached in
|
|
49
|
+
* `DaemonTokenState.keeper_account_id`. The acting actor is resolved
|
|
50
|
+
* per-request by the dispatcher's authorization phase (which runs
|
|
51
|
+
* `resolve_acting_actor` against this account id), so multi-actor keeper
|
|
52
|
+
* accounts surface `actor_required` if a daemon caller doesn't pass an
|
|
53
|
+
* explicit `acting`.
|
|
48
54
|
*
|
|
49
55
|
* @param deps - query dependencies
|
|
50
56
|
* @returns the keeper account ID, or `null` if no keeper exists yet (pre-bootstrap)
|
|
@@ -83,15 +89,21 @@ export declare const start_daemon_token_rotation: (runtime: DaemonTokenWriteDeps
|
|
|
83
89
|
* Create middleware that authenticates via daemon token.
|
|
84
90
|
*
|
|
85
91
|
* Checks the `X-Daemon-Token` header. Behavior:
|
|
86
|
-
* - No header: pass through (don't touch existing context)
|
|
87
|
-
* - Header present +
|
|
88
|
-
*
|
|
89
|
-
* - Header present +
|
|
90
|
-
* - Header present + valid
|
|
92
|
+
* - No header: pass through (don't touch existing context).
|
|
93
|
+
* - Header present + Zod-invalid: return 401 (fail-closed).
|
|
94
|
+
* - Header present + invalid value: return 401 (fail-closed, no downgrade).
|
|
95
|
+
* - Header present + valid + `keeper_account_id` null: return 503.
|
|
96
|
+
* - Header present + valid + ok: set `c.var.auth_account_id =
|
|
97
|
+
* state.keeper_account_id`, `CREDENTIAL_TYPE_KEY = 'daemon_token'`
|
|
98
|
+
* (overrides any existing session / bearer identity).
|
|
99
|
+
*
|
|
100
|
+
* Acting-actor resolution + `RequestContext` construction are deferred
|
|
101
|
+
* to the dispatcher's authorization phase. Multi-actor keeper accounts
|
|
102
|
+
* surface `actor_required` from there if a daemon caller doesn't pass
|
|
103
|
+
* an explicit `acting` value.
|
|
91
104
|
*
|
|
92
105
|
* @param state - the daemon token runtime state
|
|
93
|
-
* @
|
|
94
|
-
* @mutates Hono context - sets `REQUEST_CONTEXT_KEY`, `CREDENTIAL_TYPE_KEY`, and `AUTH_API_TOKEN_ID_KEY` on a valid token
|
|
106
|
+
* @mutates Hono context - sets `ACCOUNT_ID_KEY`, `CREDENTIAL_TYPE_KEY`, and `AUTH_API_TOKEN_ID_KEY` on a valid token
|
|
95
107
|
*/
|
|
96
|
-
export declare const create_daemon_token_middleware: (state: DaemonTokenState,
|
|
108
|
+
export declare const create_daemon_token_middleware: (state: DaemonTokenState, _deps: QueryDeps) => MiddlewareHandler;
|
|
97
109
|
//# sourceMappingURL=daemon_token_middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon_token_middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/daemon_token_middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"daemon_token_middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/daemon_token_middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,MAA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IAC3E,KAAK,EAAE,gBAAgB,CAAC;IACxB,kGAAkG;IAClG,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,GACvC,SAAS,oBAAoB,GAAG,YAAY,EAC5C,MAAM,SAAS,EACf,SAAS,0BAA0B,EACnC,KAAK,MAAM,KACT,OAAO,CAAC,mBAAmB,CAwD7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,8BAA8B,GAC1C,OAAO,gBAAgB,EACvB,OAAO,SAAS,KACd,iBA+BF,CAAC"}
|
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
import {} from '../runtime/deps.js';
|
|
13
13
|
import { write_file_atomic } from '../runtime/fs.js';
|
|
14
14
|
import { get_app_dir } from '../cli/config.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { ERROR_INVALID_DAEMON_TOKEN, ERROR_KEEPER_ACCOUNT_NOT_CONFIGURED, ERROR_KEEPER_ACCOUNT_NOT_FOUND, } from '../http/error_schemas.js';
|
|
15
|
+
import { ACCOUNT_ID_KEY, AUTH_API_TOKEN_ID_KEY, CREDENTIAL_TYPE_KEY } from '../hono_context.js';
|
|
16
|
+
import { ERROR_INVALID_DAEMON_TOKEN, ERROR_KEEPER_ACCOUNT_NOT_CONFIGURED, } from '../http/error_schemas.js';
|
|
18
17
|
import { query_permit_find_account_id_for_role } from './permit_queries.js';
|
|
19
18
|
import { ROLE_KEEPER } from './role_schema.js';
|
|
20
19
|
import { DaemonToken, DAEMON_TOKEN_HEADER, generate_daemon_token, validate_daemon_token, } from './daemon_token.js';
|
|
@@ -48,10 +47,16 @@ export const write_daemon_token = async (runtime, token_path, token) => {
|
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
/**
|
|
51
|
-
* Resolve the keeper account ID by querying for the account with an active
|
|
50
|
+
* Resolve the keeper account ID by querying for the account with an active
|
|
51
|
+
* keeper permit.
|
|
52
52
|
*
|
|
53
|
-
* There is exactly one keeper account (the bootstrap account). Runs once
|
|
54
|
-
* server startup — the result is cached in
|
|
53
|
+
* There is exactly one keeper account (the bootstrap account). Runs once
|
|
54
|
+
* at server startup — the result is cached in
|
|
55
|
+
* `DaemonTokenState.keeper_account_id`. The acting actor is resolved
|
|
56
|
+
* per-request by the dispatcher's authorization phase (which runs
|
|
57
|
+
* `resolve_acting_actor` against this account id), so multi-actor keeper
|
|
58
|
+
* accounts surface `actor_required` if a daemon caller doesn't pass an
|
|
59
|
+
* explicit `acting`.
|
|
55
60
|
*
|
|
56
61
|
* @param deps - query dependencies
|
|
57
62
|
* @returns the keeper account ID, or `null` if no keeper exists yet (pre-bootstrap)
|
|
@@ -129,17 +134,23 @@ export const start_daemon_token_rotation = async (runtime, deps, options, log) =
|
|
|
129
134
|
* Create middleware that authenticates via daemon token.
|
|
130
135
|
*
|
|
131
136
|
* Checks the `X-Daemon-Token` header. Behavior:
|
|
132
|
-
* - No header: pass through (don't touch existing context)
|
|
133
|
-
* - Header present +
|
|
134
|
-
*
|
|
135
|
-
* - Header present +
|
|
136
|
-
* - Header present + valid
|
|
137
|
+
* - No header: pass through (don't touch existing context).
|
|
138
|
+
* - Header present + Zod-invalid: return 401 (fail-closed).
|
|
139
|
+
* - Header present + invalid value: return 401 (fail-closed, no downgrade).
|
|
140
|
+
* - Header present + valid + `keeper_account_id` null: return 503.
|
|
141
|
+
* - Header present + valid + ok: set `c.var.auth_account_id =
|
|
142
|
+
* state.keeper_account_id`, `CREDENTIAL_TYPE_KEY = 'daemon_token'`
|
|
143
|
+
* (overrides any existing session / bearer identity).
|
|
144
|
+
*
|
|
145
|
+
* Acting-actor resolution + `RequestContext` construction are deferred
|
|
146
|
+
* to the dispatcher's authorization phase. Multi-actor keeper accounts
|
|
147
|
+
* surface `actor_required` from there if a daemon caller doesn't pass
|
|
148
|
+
* an explicit `acting` value.
|
|
137
149
|
*
|
|
138
150
|
* @param state - the daemon token runtime state
|
|
139
|
-
* @
|
|
140
|
-
* @mutates Hono context - sets `REQUEST_CONTEXT_KEY`, `CREDENTIAL_TYPE_KEY`, and `AUTH_API_TOKEN_ID_KEY` on a valid token
|
|
151
|
+
* @mutates Hono context - sets `ACCOUNT_ID_KEY`, `CREDENTIAL_TYPE_KEY`, and `AUTH_API_TOKEN_ID_KEY` on a valid token
|
|
141
152
|
*/
|
|
142
|
-
export const create_daemon_token_middleware = (state,
|
|
153
|
+
export const create_daemon_token_middleware = (state, _deps) => {
|
|
143
154
|
return async (c, next) => {
|
|
144
155
|
const token_header = c.req.header(DAEMON_TOKEN_HEADER);
|
|
145
156
|
if (!token_header) {
|
|
@@ -159,12 +170,7 @@ export const create_daemon_token_middleware = (state, deps) => {
|
|
|
159
170
|
if (!state.keeper_account_id) {
|
|
160
171
|
return c.json({ error: ERROR_KEEPER_ACCOUNT_NOT_CONFIGURED }, 503);
|
|
161
172
|
}
|
|
162
|
-
|
|
163
|
-
const ctx = await build_request_context(deps, state.keeper_account_id);
|
|
164
|
-
if (!ctx) {
|
|
165
|
-
return c.json({ error: ERROR_KEEPER_ACCOUNT_NOT_FOUND }, 500);
|
|
166
|
-
}
|
|
167
|
-
c.set(REQUEST_CONTEXT_KEY, ctx);
|
|
173
|
+
c.set(ACCOUNT_ID_KEY, state.keeper_account_id);
|
|
168
174
|
c.set(CREDENTIAL_TYPE_KEY, 'daemon_token');
|
|
169
175
|
c.set(AUTH_API_TOKEN_ID_KEY, null);
|
|
170
176
|
await next();
|
package/dist/auth/deps.d.ts
CHANGED
|
@@ -61,4 +61,18 @@ export interface AppDeps {
|
|
|
61
61
|
* via `RouteContext`, so factories don't capture a pool-level `Db`.
|
|
62
62
|
*/
|
|
63
63
|
export type RouteFactoryDeps = Omit<AppDeps, 'db'>;
|
|
64
|
+
/**
|
|
65
|
+
* Capabilities required by anything that emits audit events.
|
|
66
|
+
*
|
|
67
|
+
* The slice every audit-emitting site needs: `log` for sibling failure
|
|
68
|
+
* reporting, `on_audit_event` for SSE/WS fan-out, and the optional
|
|
69
|
+
* `audit_log_config` for consumer-extended event-type validation. Used
|
|
70
|
+
* by `audit_log_fire_and_forget` / `emit_permit_target_event` (the
|
|
71
|
+
* primitives) and by every action-factory deps type in `auth/`
|
|
72
|
+
* (`AdminActionDeps`, `AccountActionDeps`, `PermitOfferActionDeps`,
|
|
73
|
+
* `SelfServiceRoleActionDeps`) that runs through them. Lifted here so
|
|
74
|
+
* the five factory deps stop spelling the same `Pick<RouteFactoryDeps,
|
|
75
|
+
* 'log' | 'on_audit_event' | 'audit_log_config'>` independently.
|
|
76
|
+
*/
|
|
77
|
+
export type AuditEmitDeps = Pick<AppDeps, 'log' | 'on_audit_event' | 'audit_log_config'>;
|
|
64
78
|
//# sourceMappingURL=deps.d.ts.map
|
package/dist/auth/deps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACvB,+DAA+D;IAC/D,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACnD,2BAA2B;IAC3B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,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AC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,oFAAoF;IACpF,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,GACxC,MAAM,OAAO,EACb,SAAS,qBAAqB,KAC5B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAG/D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,oFAAoF;IACpF,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,GACxC,MAAM,OAAO,EACb,SAAS,qBAAqB,KAC5B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAqE/B,CAAC"}
|
package/dist/auth/middleware.js
CHANGED
|
@@ -49,8 +49,10 @@ export const create_auth_middleware_specs = async (deps, options) => {
|
|
|
49
49
|
handler: bearer_auth_middleware,
|
|
50
50
|
// Bearer middleware soft-fails for invalid/expired tokens (calls next()
|
|
51
51
|
// without setting context). Only 429 is a hard-fail from this layer.
|
|
52
|
-
// Auth enforcement (401/403) happens downstream
|
|
53
|
-
//
|
|
52
|
+
// Auth enforcement (401/403) happens downstream — the RPC dispatcher's
|
|
53
|
+
// pre-validation / post-authorization auth gates, or `require_auth` /
|
|
54
|
+
// `require_role` on REST — producing consistent JSON-RPC or
|
|
55
|
+
// route-level errors.
|
|
54
56
|
errors: { 429: RateLimitError },
|
|
55
57
|
},
|
|
56
58
|
];
|
|
@@ -4,14 +4,22 @@
|
|
|
4
4
|
* Ordered list of `{name, up}` migrations for the fuz identity system tables.
|
|
5
5
|
* Consumed by `run_migrations` with namespace `'fuz_auth'`.
|
|
6
6
|
*
|
|
7
|
-
* **
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* **Schema is not stabilized yet — append-only is NOT the rule.** While
|
|
8
|
+
* fuz_app is pre-stable, migration bodies, names, and positions can change
|
|
9
|
+
* freely between versions; consumers upgrading across a schema change are
|
|
10
|
+
* expected to drop and re-bootstrap their dev/test databases (production
|
|
11
|
+
* deployments are not yet a supported use case). Once the schema is
|
|
12
|
+
* declared stable a hard append-only-after-publish rule will apply and the
|
|
13
|
+
* cliff will be called out in the release notes for that version. Until
|
|
14
|
+
* then: edit, rename, reorder, or replace migrations as needed; bias toward
|
|
15
|
+
* collapsing work into the existing v0/v1 entries rather than appending v2
|
|
16
|
+
* patch migrations.
|
|
13
17
|
*
|
|
14
|
-
* To add a migration
|
|
18
|
+
* To add a migration in the pre-stable phase, prefer extending an existing
|
|
19
|
+
* entry's body (consumers will re-bootstrap on upgrade). If you do append
|
|
20
|
+
* a new entry to `AUTH_MIGRATIONS`, the runner will apply it on existing
|
|
21
|
+
* tracker rows — the same shape that will become mandatory once the
|
|
22
|
+
* schema stabilizes:
|
|
15
23
|
*
|
|
16
24
|
* ```ts
|
|
17
25
|
* // v2: add display_name to account
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/migrations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AA6BH,OAAO,KAAK,EAAC,SAAS,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,wDAAwD;AACxD,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,SAAS,CA6D5C,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,EAAE,kBAG/B,CAAC"}
|
package/dist/auth/migrations.js
CHANGED
|
@@ -4,14 +4,22 @@
|
|
|
4
4
|
* Ordered list of `{name, up}` migrations for the fuz identity system tables.
|
|
5
5
|
* Consumed by `run_migrations` with namespace `'fuz_auth'`.
|
|
6
6
|
*
|
|
7
|
-
* **
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* **Schema is not stabilized yet — append-only is NOT the rule.** While
|
|
8
|
+
* fuz_app is pre-stable, migration bodies, names, and positions can change
|
|
9
|
+
* freely between versions; consumers upgrading across a schema change are
|
|
10
|
+
* expected to drop and re-bootstrap their dev/test databases (production
|
|
11
|
+
* deployments are not yet a supported use case). Once the schema is
|
|
12
|
+
* declared stable a hard append-only-after-publish rule will apply and the
|
|
13
|
+
* cliff will be called out in the release notes for that version. Until
|
|
14
|
+
* then: edit, rename, reorder, or replace migrations as needed; bias toward
|
|
15
|
+
* collapsing work into the existing v0/v1 entries rather than appending v2
|
|
16
|
+
* patch migrations.
|
|
13
17
|
*
|
|
14
|
-
* To add a migration
|
|
18
|
+
* To add a migration in the pre-stable phase, prefer extending an existing
|
|
19
|
+
* entry's body (consumers will re-bootstrap on upgrade). If you do append
|
|
20
|
+
* a new entry to `AUTH_MIGRATIONS`, the runner will apply it on existing
|
|
21
|
+
* tracker rows — the same shape that will become mandatory once the
|
|
22
|
+
* schema stabilizes:
|
|
15
23
|
*
|
|
16
24
|
* ```ts
|
|
17
25
|
* // v2: add display_name to account
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* policy checks (e.g. `permit_offer_list`/`_history` elevate to admin only
|
|
12
12
|
* when inspecting another account — an input-dependent check that can't be
|
|
13
13
|
* expressed at the spec level). `permit_revoke` declares
|
|
14
|
-
* `auth: {role: 'admin'}` — the RPC dispatcher's per-spec
|
|
15
|
-
*
|
|
14
|
+
* `auth: {role: 'admin'}` — the RPC dispatcher's per-spec post-authorization
|
|
15
|
+
* auth gate (`check_action_auth_post_authorization`) rejects non-admin
|
|
16
|
+
* callers before the handler runs even though the endpoint hosts non-admin
|
|
16
17
|
* methods alongside.
|
|
17
18
|
*
|
|
18
19
|
* @module
|
|
@@ -31,33 +32,53 @@ export declare const ERROR_OFFER_NOT_FOUND: "offer_not_found";
|
|
|
31
32
|
export declare const ERROR_OFFER_ROLE_NOT_GRANTABLE: "offer_role_not_grantable";
|
|
32
33
|
/** Error reason — caller is not authorized to offer this role (default policy: caller lacks the role; consumer `authorize` callback may add further policy). */
|
|
33
34
|
export declare const ERROR_OFFER_NOT_AUTHORIZED: "offer_not_authorized";
|
|
34
|
-
/**
|
|
35
|
+
/** Error reason — actor-targeted offer was accepted by an actor other than `to_actor_id`. */
|
|
36
|
+
export declare const ERROR_OFFER_ACTOR_MISMATCH: "offer_actor_mismatch";
|
|
37
|
+
/** Error reason — `permit_offer_create` was called with a `to_actor_id` that does not belong to `to_account_id`. */
|
|
38
|
+
export declare const ERROR_OFFER_ACTOR_ACCOUNT_MISMATCH: "offer_actor_account_mismatch";
|
|
39
|
+
/**
|
|
40
|
+
* Input for `permit_offer_create`.
|
|
41
|
+
*
|
|
42
|
+
* `to_actor_id` (optional) narrows the offer to a specific actor on the
|
|
43
|
+
* recipient account. When supplied, `permit_offer_accept` will only admit
|
|
44
|
+
* the named actor — wrong-actor accepts reject with
|
|
45
|
+
* `offer_actor_mismatch`. The audit envelope's `target_actor_id` is
|
|
46
|
+
* stamped from this column on the create / supersede / expire / retract
|
|
47
|
+
* events. Omit (or pass null) for the account-grain default — any actor
|
|
48
|
+
* on `to_account_id` may accept.
|
|
49
|
+
*/
|
|
35
50
|
export declare const PermitOfferCreateInput: z.ZodObject<{
|
|
36
51
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
52
|
+
to_actor_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
37
53
|
role: z.ZodString;
|
|
38
54
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
39
55
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
40
57
|
}, z.core.$strict>;
|
|
41
58
|
export type PermitOfferCreateInput = z.infer<typeof PermitOfferCreateInput>;
|
|
42
59
|
/** Input for `permit_offer_accept`. */
|
|
43
60
|
export declare const PermitOfferAcceptInput: z.ZodObject<{
|
|
44
61
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
62
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
45
63
|
}, z.core.$strict>;
|
|
46
64
|
export type PermitOfferAcceptInput = z.infer<typeof PermitOfferAcceptInput>;
|
|
47
65
|
/** Input for `permit_offer_decline`. */
|
|
48
66
|
export declare const PermitOfferDeclineInput: z.ZodObject<{
|
|
49
67
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
50
68
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
51
70
|
}, z.core.$strict>;
|
|
52
71
|
export type PermitOfferDeclineInput = z.infer<typeof PermitOfferDeclineInput>;
|
|
53
72
|
/** Input for `permit_offer_retract`. */
|
|
54
73
|
export declare const PermitOfferRetractInput: z.ZodObject<{
|
|
55
74
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
75
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
56
76
|
}, z.core.$strict>;
|
|
57
77
|
export type PermitOfferRetractInput = z.infer<typeof PermitOfferRetractInput>;
|
|
58
78
|
/** Input for `permit_offer_list`. `account_id` is admin-only (inspect another account's inbox). */
|
|
59
79
|
export declare const PermitOfferListInput: z.ZodObject<{
|
|
60
80
|
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
81
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
61
82
|
}, z.core.$strict>;
|
|
62
83
|
export type PermitOfferListInput = z.infer<typeof PermitOfferListInput>;
|
|
63
84
|
/**
|
|
@@ -71,6 +92,7 @@ export declare const PermitRevokeInput: z.ZodObject<{
|
|
|
71
92
|
actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
72
93
|
permit_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
73
94
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
74
96
|
}, z.core.$strict>;
|
|
75
97
|
export type PermitRevokeInput = z.infer<typeof PermitRevokeInput>;
|
|
76
98
|
/**
|
|
@@ -82,6 +104,7 @@ export declare const PermitOfferHistoryInput: z.ZodObject<{
|
|
|
82
104
|
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
83
105
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
84
106
|
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
107
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
85
108
|
}, z.core.$strict>;
|
|
86
109
|
export type PermitOfferHistoryInput = z.infer<typeof PermitOfferHistoryInput>;
|
|
87
110
|
/** Output for `permit_offer_create`. */
|
|
@@ -90,6 +113,7 @@ export declare const PermitOfferCreateOutput: z.ZodObject<{
|
|
|
90
113
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
91
114
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
92
115
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
116
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
93
117
|
role: z.ZodString;
|
|
94
118
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
95
119
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -111,6 +135,7 @@ export declare const PermitOfferAcceptOutput: z.ZodObject<{
|
|
|
111
135
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
112
136
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
113
137
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
138
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
114
139
|
role: z.ZodString;
|
|
115
140
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
116
141
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -137,6 +162,7 @@ export declare const PermitOfferListOutput: z.ZodObject<{
|
|
|
137
162
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
138
163
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
139
164
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
165
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
140
166
|
role: z.ZodString;
|
|
141
167
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
142
168
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -157,6 +183,7 @@ export declare const PermitOfferHistoryOutput: z.ZodObject<{
|
|
|
157
183
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
158
184
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
159
185
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
186
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
160
187
|
role: z.ZodString;
|
|
161
188
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
162
189
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -185,15 +212,18 @@ export declare const permit_offer_create_action_spec: {
|
|
|
185
212
|
side_effects: true;
|
|
186
213
|
input: z.ZodObject<{
|
|
187
214
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
215
|
+
to_actor_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
188
216
|
role: z.ZodString;
|
|
189
217
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
190
218
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
219
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
191
220
|
}, z.core.$strict>;
|
|
192
221
|
output: z.ZodObject<{
|
|
193
222
|
offer: z.ZodObject<{
|
|
194
223
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
195
224
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
196
225
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
226
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
197
227
|
role: z.ZodString;
|
|
198
228
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
199
229
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -209,7 +239,7 @@ export declare const permit_offer_create_action_spec: {
|
|
|
209
239
|
}, z.core.$strict>;
|
|
210
240
|
async: true;
|
|
211
241
|
description: string;
|
|
212
|
-
error_reasons: ("offer_self_target" | "offer_role_not_grantable" | "offer_not_authorized")[];
|
|
242
|
+
error_reasons: ("offer_self_target" | "offer_role_not_grantable" | "offer_not_authorized" | "offer_actor_account_mismatch")[];
|
|
213
243
|
};
|
|
214
244
|
export declare const permit_offer_accept_action_spec: {
|
|
215
245
|
method: string;
|
|
@@ -219,6 +249,7 @@ export declare const permit_offer_accept_action_spec: {
|
|
|
219
249
|
side_effects: true;
|
|
220
250
|
input: z.ZodObject<{
|
|
221
251
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
252
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
222
253
|
}, z.core.$strict>;
|
|
223
254
|
output: z.ZodObject<{
|
|
224
255
|
permit_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -226,6 +257,7 @@ export declare const permit_offer_accept_action_spec: {
|
|
|
226
257
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
227
258
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
228
259
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
260
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
229
261
|
role: z.ZodString;
|
|
230
262
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
231
263
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -242,7 +274,7 @@ export declare const permit_offer_accept_action_spec: {
|
|
|
242
274
|
}, z.core.$strict>;
|
|
243
275
|
async: true;
|
|
244
276
|
description: string;
|
|
245
|
-
error_reasons: ("offer_terminal" | "offer_expired" | "offer_not_found")[];
|
|
277
|
+
error_reasons: ("offer_terminal" | "offer_expired" | "offer_not_found" | "offer_actor_mismatch")[];
|
|
246
278
|
};
|
|
247
279
|
export declare const permit_offer_decline_action_spec: {
|
|
248
280
|
method: string;
|
|
@@ -253,6 +285,7 @@ export declare const permit_offer_decline_action_spec: {
|
|
|
253
285
|
input: z.ZodObject<{
|
|
254
286
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
255
287
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
256
289
|
}, z.core.$strict>;
|
|
257
290
|
output: z.ZodObject<{
|
|
258
291
|
ok: z.ZodLiteral<true>;
|
|
@@ -269,6 +302,7 @@ export declare const permit_offer_retract_action_spec: {
|
|
|
269
302
|
side_effects: true;
|
|
270
303
|
input: z.ZodObject<{
|
|
271
304
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
305
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
272
306
|
}, z.core.$strict>;
|
|
273
307
|
output: z.ZodObject<{
|
|
274
308
|
ok: z.ZodLiteral<true>;
|
|
@@ -285,12 +319,14 @@ export declare const permit_offer_list_action_spec: {
|
|
|
285
319
|
side_effects: false;
|
|
286
320
|
input: z.ZodObject<{
|
|
287
321
|
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
322
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
288
323
|
}, z.core.$strict>;
|
|
289
324
|
output: z.ZodObject<{
|
|
290
325
|
offers: z.ZodArray<z.ZodObject<{
|
|
291
326
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
292
327
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
293
328
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
329
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
294
330
|
role: z.ZodString;
|
|
295
331
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
296
332
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -317,12 +353,14 @@ export declare const permit_offer_history_action_spec: {
|
|
|
317
353
|
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
318
354
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
319
355
|
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
356
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
320
357
|
}, z.core.$strict>;
|
|
321
358
|
output: z.ZodObject<{
|
|
322
359
|
offers: z.ZodArray<z.ZodObject<{
|
|
323
360
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
324
361
|
from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
325
362
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
363
|
+
to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
326
364
|
role: z.ZodString;
|
|
327
365
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
328
366
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -351,6 +389,7 @@ export declare const permit_revoke_action_spec: {
|
|
|
351
389
|
actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
352
390
|
permit_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
353
391
|
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
354
393
|
}, z.core.$strict>;
|
|
355
394
|
output: z.ZodObject<{
|
|
356
395
|
ok: z.ZodLiteral<true>;
|
|
@@ -358,7 +397,7 @@ export declare const permit_revoke_action_spec: {
|
|
|
358
397
|
}, z.core.$strict>;
|
|
359
398
|
async: true;
|
|
360
399
|
description: string;
|
|
361
|
-
error_reasons: ("
|
|
400
|
+
error_reasons: ("role_not_web_grantable" | "permit_not_found")[];
|
|
362
401
|
rate_limit: "account";
|
|
363
402
|
};
|
|
364
403
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permit_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/permit_offer_action_specs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"permit_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/permit_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,O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