@frontmcp/plugin-approval 0.0.1 → 0.7.1
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/approval/errors.d.ts +149 -0
- package/approval/errors.d.ts.map +1 -0
- package/approval/factories.d.ts +251 -0
- package/approval/factories.d.ts.map +1 -0
- package/approval/guards.d.ts +61 -0
- package/approval/guards.d.ts.map +1 -0
- package/approval/index.d.ts +43 -0
- package/approval/index.d.ts.map +1 -0
- package/approval/schemas.d.ts +179 -0
- package/approval/schemas.d.ts.map +1 -0
- package/approval/types.d.ts +252 -0
- package/approval/types.d.ts.map +1 -0
- package/approval.context-extension.d.ts +21 -0
- package/approval.context-extension.d.ts.map +1 -0
- package/approval.plugin.d.ts +128 -0
- package/approval.plugin.d.ts.map +1 -0
- package/approval.symbols.d.ts +22 -0
- package/approval.symbols.d.ts.map +1 -0
- package/esm/index.mjs +1228 -0
- package/esm/package.json +66 -0
- package/flows/index.d.ts +9 -0
- package/flows/index.d.ts.map +1 -0
- package/hooks/approval-check.hook.d.ts +25 -0
- package/hooks/approval-check.hook.d.ts.map +1 -0
- package/hooks/index.d.ts +7 -0
- package/hooks/index.d.ts.map +1 -0
- package/index.d.ts +44 -0
- package/index.d.ts.map +1 -0
- package/index.js +1279 -0
- package/package.json +3 -3
- package/services/approval.service.d.ts +85 -0
- package/services/approval.service.d.ts.map +1 -0
- package/services/challenge.service.d.ts +115 -0
- package/services/challenge.service.d.ts.map +1 -0
- package/services/index.d.ts +8 -0
- package/services/index.d.ts.map +1 -0
- package/stores/approval-storage.store.d.ts +71 -0
- package/stores/approval-storage.store.d.ts.map +1 -0
- package/stores/approval-store.interface.d.ts +121 -0
- package/stores/approval-store.interface.d.ts.map +1 -0
- package/stores/index.d.ts +8 -0
- package/stores/index.d.ts.map +1 -0
- package/types/approval.types.d.ts +98 -0
- package/types/approval.types.d.ts.map +1 -0
- package/types/index.d.ts +7 -0
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod validation schemas for approval types.
|
|
3
|
+
*
|
|
4
|
+
* @module @frontmcp/utils/approval
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { ApprovalScope, ApprovalState } from './types';
|
|
8
|
+
export declare const approvalScopeSchema: z.ZodEnum<typeof ApprovalScope>;
|
|
9
|
+
export declare const approvalStateSchema: z.ZodEnum<typeof ApprovalState>;
|
|
10
|
+
export declare const approvalMethodSchema: z.ZodEnum<{
|
|
11
|
+
api: "api";
|
|
12
|
+
interactive: "interactive";
|
|
13
|
+
implicit: "implicit";
|
|
14
|
+
delegation: "delegation";
|
|
15
|
+
batch: "batch";
|
|
16
|
+
}>;
|
|
17
|
+
export declare const approvalSourceTypeSchema: z.ZodString;
|
|
18
|
+
export declare const revocationMethodSchema: z.ZodEnum<{
|
|
19
|
+
policy: "policy";
|
|
20
|
+
interactive: "interactive";
|
|
21
|
+
implicit: "implicit";
|
|
22
|
+
expiry: "expiry";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const approvalCategorySchema: z.ZodEnum<{
|
|
25
|
+
admin: "admin";
|
|
26
|
+
read: "read";
|
|
27
|
+
write: "write";
|
|
28
|
+
delete: "delete";
|
|
29
|
+
execute: "execute";
|
|
30
|
+
}>;
|
|
31
|
+
export declare const riskLevelSchema: z.ZodEnum<{
|
|
32
|
+
low: "low";
|
|
33
|
+
medium: "medium";
|
|
34
|
+
high: "high";
|
|
35
|
+
critical: "critical";
|
|
36
|
+
}>;
|
|
37
|
+
export declare const approvalContextSchema: z.ZodObject<{
|
|
38
|
+
type: z.ZodString;
|
|
39
|
+
identifier: z.ZodString;
|
|
40
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const delegationContextSchema: z.ZodObject<{
|
|
43
|
+
delegatorId: z.ZodString;
|
|
44
|
+
delegateId: z.ZodString;
|
|
45
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
46
|
+
constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const approvalGrantorSchema: z.ZodObject<{
|
|
49
|
+
source: z.ZodString;
|
|
50
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
51
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
52
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
api: "api";
|
|
54
|
+
interactive: "interactive";
|
|
55
|
+
implicit: "implicit";
|
|
56
|
+
delegation: "delegation";
|
|
57
|
+
batch: "batch";
|
|
58
|
+
}>>;
|
|
59
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
60
|
+
delegationContext: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
delegatorId: z.ZodString;
|
|
62
|
+
delegateId: z.ZodString;
|
|
63
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
64
|
+
constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export declare const approvalRevokerSchema: z.ZodObject<{
|
|
68
|
+
source: z.ZodString;
|
|
69
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
70
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
71
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
policy: "policy";
|
|
73
|
+
interactive: "interactive";
|
|
74
|
+
implicit: "implicit";
|
|
75
|
+
expiry: "expiry";
|
|
76
|
+
}>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export declare const approvalRecordSchema: z.ZodObject<{
|
|
79
|
+
toolId: z.ZodString;
|
|
80
|
+
state: z.ZodEnum<typeof ApprovalState>;
|
|
81
|
+
scope: z.ZodEnum<typeof ApprovalScope>;
|
|
82
|
+
grantedAt: z.ZodNumber;
|
|
83
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
ttlMs: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
87
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
type: z.ZodString;
|
|
89
|
+
identifier: z.ZodString;
|
|
90
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
grantedBy: z.ZodObject<{
|
|
93
|
+
source: z.ZodString;
|
|
94
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
95
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
96
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
97
|
+
api: "api";
|
|
98
|
+
interactive: "interactive";
|
|
99
|
+
implicit: "implicit";
|
|
100
|
+
delegation: "delegation";
|
|
101
|
+
batch: "batch";
|
|
102
|
+
}>>;
|
|
103
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
104
|
+
delegationContext: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
delegatorId: z.ZodString;
|
|
106
|
+
delegateId: z.ZodString;
|
|
107
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
108
|
+
constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
approvalChain: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
112
|
+
source: z.ZodString;
|
|
113
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
114
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
115
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
api: "api";
|
|
117
|
+
interactive: "interactive";
|
|
118
|
+
implicit: "implicit";
|
|
119
|
+
delegation: "delegation";
|
|
120
|
+
batch: "batch";
|
|
121
|
+
}>>;
|
|
122
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
123
|
+
delegationContext: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
delegatorId: z.ZodString;
|
|
125
|
+
delegateId: z.ZodString;
|
|
126
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
127
|
+
constraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
}, z.core.$strip>>>;
|
|
130
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
131
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
132
|
+
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
revokedBy: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
source: z.ZodString;
|
|
135
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
136
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
137
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
policy: "policy";
|
|
139
|
+
interactive: "interactive";
|
|
140
|
+
implicit: "implicit";
|
|
141
|
+
expiry: "expiry";
|
|
142
|
+
}>>;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
revocationReason: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
export declare const toolApprovalRequirementSchema: z.ZodObject<{
|
|
147
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
defaultScope: z.ZodOptional<z.ZodEnum<typeof ApprovalScope>>;
|
|
149
|
+
allowedScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof ApprovalScope>>>;
|
|
150
|
+
maxTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
alwaysPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
skipApproval: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
approvalMessage: z.ZodOptional<z.ZodString>;
|
|
154
|
+
category: z.ZodOptional<z.ZodEnum<{
|
|
155
|
+
admin: "admin";
|
|
156
|
+
read: "read";
|
|
157
|
+
write: "write";
|
|
158
|
+
delete: "delete";
|
|
159
|
+
execute: "execute";
|
|
160
|
+
}>>;
|
|
161
|
+
riskLevel: z.ZodOptional<z.ZodEnum<{
|
|
162
|
+
low: "low";
|
|
163
|
+
medium: "medium";
|
|
164
|
+
high: "high";
|
|
165
|
+
critical: "critical";
|
|
166
|
+
}>>;
|
|
167
|
+
preApprovedContexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
168
|
+
type: z.ZodString;
|
|
169
|
+
identifier: z.ZodString;
|
|
170
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
|
+
}, z.core.$strip>>>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export type ApprovalContextInput = z.input<typeof approvalContextSchema>;
|
|
174
|
+
export type DelegationContextInput = z.input<typeof delegationContextSchema>;
|
|
175
|
+
export type ApprovalGrantorInput = z.input<typeof approvalGrantorSchema>;
|
|
176
|
+
export type ApprovalRevokerInput = z.input<typeof approvalRevokerSchema>;
|
|
177
|
+
export type ApprovalRecordInput = z.input<typeof approvalRecordSchema>;
|
|
178
|
+
export type ToolApprovalRequirementInput = z.input<typeof toolApprovalRequirementSchema>;
|
|
179
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/approval/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMvD,eAAO,MAAM,mBAAmB,iCAA8B,CAAC;AAE/D,eAAO,MAAM,mBAAmB,iCAA8B,CAAC;AAE/D,eAAO,MAAM,oBAAoB;;;;;;EAAoE,CAAC;AAEtG,eAAO,MAAM,wBAAwB,aAAoB,CAAC;AAE1D,eAAO,MAAM,sBAAsB;;;;;EAA0D,CAAC;AAE9F,eAAO,MAAM,sBAAsB;;;;;;EAA0D,CAAC;AAE9F,eAAO,MAAM,eAAe;;;;;EAAgD,CAAC;AAM7E,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAC;AAMH,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iBAOhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAKhC,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB/B,CAAC;AAMH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWxC,CAAC;AAMH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Approval type definitions for tool authorization flows.
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure for approval records, grantors, and revokers
|
|
5
|
+
* used in tool permission systems.
|
|
6
|
+
*
|
|
7
|
+
* @module @frontmcp/utils/approval
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Approval scope determines the lifetime and visibility of an approval.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum ApprovalScope {
|
|
13
|
+
/** Valid only for current session - cleared on session end */
|
|
14
|
+
SESSION = "session",
|
|
15
|
+
/** Persists for user across sessions - stored with user identity */
|
|
16
|
+
USER = "user",
|
|
17
|
+
/** Time-limited approval - expires after TTL regardless of session */
|
|
18
|
+
TIME_LIMITED = "time_limited",
|
|
19
|
+
/** Tool-specific approval - tied to specific tool only */
|
|
20
|
+
TOOL_SPECIFIC = "tool_specific",
|
|
21
|
+
/** Context-specific approval - tied to context (e.g., repo, project) */
|
|
22
|
+
CONTEXT_SPECIFIC = "context_specific"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Approval state for a tool.
|
|
26
|
+
*/
|
|
27
|
+
export declare enum ApprovalState {
|
|
28
|
+
/** No approval decision made yet */
|
|
29
|
+
PENDING = "pending",
|
|
30
|
+
/** User approved the tool for execution */
|
|
31
|
+
APPROVED = "approved",
|
|
32
|
+
/** User denied the tool for execution */
|
|
33
|
+
DENIED = "denied",
|
|
34
|
+
/** Approval expired (TTL or session end) */
|
|
35
|
+
EXPIRED = "expired"
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Context for context-specific approvals.
|
|
39
|
+
* Similar to Claude Code's repo-based permissions.
|
|
40
|
+
*/
|
|
41
|
+
export interface ApprovalContext {
|
|
42
|
+
/** Context type (e.g., 'repository', 'project', 'workspace') */
|
|
43
|
+
type: string;
|
|
44
|
+
/** Context identifier (e.g., repo path, project ID) */
|
|
45
|
+
identifier: string;
|
|
46
|
+
/** Optional additional context data */
|
|
47
|
+
metadata?: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Built-in source types for approval grants.
|
|
51
|
+
* The `(string & {})` union allows custom vendor-specific source types.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Built-in sources
|
|
56
|
+
* grantedBy: { source: 'user' }
|
|
57
|
+
* grantedBy: { source: 'policy' }
|
|
58
|
+
*
|
|
59
|
+
* // Custom vendor sources
|
|
60
|
+
* grantedBy: { source: 'frontcloud-rbac' }
|
|
61
|
+
* grantedBy: { source: 'my-custom-auth' }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export type ApprovalSourceType = 'user' | 'policy' | 'admin' | 'system' | 'agent' | 'api' | 'oauth' | 'test' | (string & {});
|
|
65
|
+
/**
|
|
66
|
+
* How the approval was obtained.
|
|
67
|
+
*/
|
|
68
|
+
export type ApprovalMethod = 'interactive' | 'implicit' | 'delegation' | 'batch' | 'api';
|
|
69
|
+
/**
|
|
70
|
+
* Context for delegated approvals (e.g., AI agent with delegated authority).
|
|
71
|
+
* Per MCP spec, tracks the delegation chain for audit purposes.
|
|
72
|
+
*/
|
|
73
|
+
export interface DelegationContext {
|
|
74
|
+
/** Who authorized the delegate (user ID, admin ID) */
|
|
75
|
+
delegatorId: string;
|
|
76
|
+
/** Who was authorized (agent ID, service account) */
|
|
77
|
+
delegateId: string;
|
|
78
|
+
/** Purpose of the delegation */
|
|
79
|
+
purpose?: string;
|
|
80
|
+
/** Constraints on the delegation (paths, actions, etc.) */
|
|
81
|
+
constraints?: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Full audit trail for who/what granted an approval.
|
|
85
|
+
* Supports MCP spec requirements for explicit consent tracking and accountability.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* // Simple usage - just source type
|
|
90
|
+
* grantedBy: { source: 'user' }
|
|
91
|
+
*
|
|
92
|
+
* // Full audit trail
|
|
93
|
+
* grantedBy: {
|
|
94
|
+
* source: 'user',
|
|
95
|
+
* identifier: 'user-123',
|
|
96
|
+
* displayName: 'John Doe',
|
|
97
|
+
* method: 'interactive',
|
|
98
|
+
* origin: 'ui',
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* // Agent with delegation
|
|
102
|
+
* grantedBy: {
|
|
103
|
+
* source: 'agent',
|
|
104
|
+
* identifier: 'claude-code',
|
|
105
|
+
* displayName: 'Claude Code Assistant',
|
|
106
|
+
* method: 'delegation',
|
|
107
|
+
* delegationContext: {
|
|
108
|
+
* delegatorId: 'user-123',
|
|
109
|
+
* delegateId: 'claude-code',
|
|
110
|
+
* purpose: 'code editing',
|
|
111
|
+
* },
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export interface ApprovalGrantor {
|
|
116
|
+
/** Source type - who/what granted this */
|
|
117
|
+
source: ApprovalSourceType;
|
|
118
|
+
/** Unique identifier (user ID, policy ID, API key prefix, etc.) */
|
|
119
|
+
identifier?: string;
|
|
120
|
+
/** Human-readable name for display */
|
|
121
|
+
displayName?: string;
|
|
122
|
+
/** How the approval was obtained */
|
|
123
|
+
method?: ApprovalMethod;
|
|
124
|
+
/** Where the approval originated (oauth, config, ui, cli, api) */
|
|
125
|
+
origin?: string;
|
|
126
|
+
/** For delegated approvals - who authorized the delegate */
|
|
127
|
+
delegationContext?: DelegationContext;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Revocation source types (includes approval sources + revocation-specific).
|
|
131
|
+
*/
|
|
132
|
+
export type RevocationSourceType = ApprovalSourceType | 'expiry' | 'session_end';
|
|
133
|
+
/**
|
|
134
|
+
* Revocation method types.
|
|
135
|
+
*/
|
|
136
|
+
export type RevocationMethod = 'interactive' | 'implicit' | 'policy' | 'expiry';
|
|
137
|
+
/**
|
|
138
|
+
* Tracking for who/what revoked an approval.
|
|
139
|
+
*/
|
|
140
|
+
export interface ApprovalRevoker {
|
|
141
|
+
/** Source type - who/what revoked this */
|
|
142
|
+
source: RevocationSourceType;
|
|
143
|
+
/** Unique identifier (user ID, etc.) */
|
|
144
|
+
identifier?: string;
|
|
145
|
+
/** Human-readable name for display */
|
|
146
|
+
displayName?: string;
|
|
147
|
+
/** How the revocation was triggered */
|
|
148
|
+
method?: RevocationMethod;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Approval record stored in memory/storage.
|
|
152
|
+
* Enhanced with full audit trail support per MCP spec requirements.
|
|
153
|
+
*/
|
|
154
|
+
export interface ApprovalRecord {
|
|
155
|
+
/** Tool identifier (fullName or name) */
|
|
156
|
+
toolId: string;
|
|
157
|
+
/** Current approval state */
|
|
158
|
+
state: ApprovalState;
|
|
159
|
+
/** Scope of this approval */
|
|
160
|
+
scope: ApprovalScope;
|
|
161
|
+
/** When the approval was granted (timestamp) */
|
|
162
|
+
grantedAt: number;
|
|
163
|
+
/** When the approval expires (timestamp) */
|
|
164
|
+
expiresAt?: number;
|
|
165
|
+
/** Time-to-live in milliseconds (for time-limited approvals) */
|
|
166
|
+
ttlMs?: number;
|
|
167
|
+
/** Session ID (for session-scoped approvals) */
|
|
168
|
+
sessionId?: string;
|
|
169
|
+
/** User ID (for user-scoped approvals) */
|
|
170
|
+
userId?: string;
|
|
171
|
+
/** Context (for context-specific approvals) */
|
|
172
|
+
context?: ApprovalContext;
|
|
173
|
+
/** Who/what granted the approval (full audit trail) */
|
|
174
|
+
grantedBy: ApprovalGrantor;
|
|
175
|
+
/** Approval chain for multi-step approvals */
|
|
176
|
+
approvalChain?: ApprovalGrantor[];
|
|
177
|
+
/** Optional reason for the approval */
|
|
178
|
+
reason?: string;
|
|
179
|
+
/** Approval metadata (e.g., IP, user agent) */
|
|
180
|
+
metadata?: Record<string, unknown>;
|
|
181
|
+
/** When the approval was revoked (timestamp) */
|
|
182
|
+
revokedAt?: number;
|
|
183
|
+
/** Who/what revoked the approval */
|
|
184
|
+
revokedBy?: ApprovalRevoker;
|
|
185
|
+
/** Reason for revocation */
|
|
186
|
+
revocationReason?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Approval category for grouping UX.
|
|
190
|
+
*/
|
|
191
|
+
export type ApprovalCategory = 'read' | 'write' | 'delete' | 'execute' | 'admin';
|
|
192
|
+
/**
|
|
193
|
+
* Risk level hint for UI.
|
|
194
|
+
*/
|
|
195
|
+
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
196
|
+
/**
|
|
197
|
+
* Approval requirement for a tool.
|
|
198
|
+
* Declares what approval is needed before tool execution.
|
|
199
|
+
*/
|
|
200
|
+
export interface ToolApprovalRequirement {
|
|
201
|
+
/**
|
|
202
|
+
* Whether this tool requires approval before execution.
|
|
203
|
+
* @default true if any approval options specified
|
|
204
|
+
*/
|
|
205
|
+
required?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Default scope for approvals (if user doesn't specify).
|
|
208
|
+
* @default 'session'
|
|
209
|
+
*/
|
|
210
|
+
defaultScope?: ApprovalScope;
|
|
211
|
+
/**
|
|
212
|
+
* Allowed scopes for this tool.
|
|
213
|
+
* User cannot grant approval with a scope not in this list.
|
|
214
|
+
* @default all scopes allowed
|
|
215
|
+
*/
|
|
216
|
+
allowedScopes?: ApprovalScope[];
|
|
217
|
+
/**
|
|
218
|
+
* Maximum TTL in milliseconds for time-limited approvals.
|
|
219
|
+
* Prevents users from setting very long TTLs for sensitive tools.
|
|
220
|
+
*/
|
|
221
|
+
maxTtlMs?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Whether to prompt on each call even if approved.
|
|
224
|
+
* For highly sensitive operations.
|
|
225
|
+
* @default false
|
|
226
|
+
*/
|
|
227
|
+
alwaysPrompt?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Whether to skip approval prompt entirely.
|
|
230
|
+
* For safe, read-only operations.
|
|
231
|
+
* @default false
|
|
232
|
+
*/
|
|
233
|
+
skipApproval?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Approval message shown to user when prompting.
|
|
236
|
+
*/
|
|
237
|
+
approvalMessage?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Categories for grouping approval UX.
|
|
240
|
+
*/
|
|
241
|
+
category?: ApprovalCategory;
|
|
242
|
+
/**
|
|
243
|
+
* Risk level hint for UI.
|
|
244
|
+
*/
|
|
245
|
+
riskLevel?: RiskLevel;
|
|
246
|
+
/**
|
|
247
|
+
* Contexts where this tool is pre-approved.
|
|
248
|
+
* E.g., "allow without approval in repo Z"
|
|
249
|
+
*/
|
|
250
|
+
preApprovedContexts?: ApprovalContext[];
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/approval/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,oBAAY,aAAa;IACvB,8DAA8D;IAC9D,OAAO,YAAY;IAEnB,oEAAoE;IACpE,IAAI,SAAS;IAEb,sEAAsE;IACtE,YAAY,iBAAiB;IAE7B,0DAA0D;IAC1D,aAAa,kBAAkB;IAE/B,wEAAwE;IACxE,gBAAgB,qBAAqB;CACtC;AAMD;;GAEG;AACH,oBAAY,aAAa;IACvB,oCAAoC;IACpC,OAAO,YAAY;IAEnB,2CAA2C;IAC3C,QAAQ,aAAa;IAErB,yCAAyC;IACzC,MAAM,WAAW;IAEjB,4CAA4C;IAC5C,OAAO,YAAY;CACpB;AAMD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IAEb,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAMD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,KAAK,GACL,OAAO,GACP,MAAM,GACN,CA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OAIG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,eAAe,EAAE,CAAC;CACzC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context extension that adds `this.approval` to ExecutionContextBase.
|
|
3
|
+
*
|
|
4
|
+
* @module @frontmcp/plugin-approval
|
|
5
|
+
*/
|
|
6
|
+
import type { ApprovalService } from './services/approval.service';
|
|
7
|
+
declare module '@frontmcp/sdk' {
|
|
8
|
+
interface ExecutionContextBase {
|
|
9
|
+
/**
|
|
10
|
+
* Approval service for managing tool authorizations.
|
|
11
|
+
* Provided by @frontmcp/plugin-approval.
|
|
12
|
+
*/
|
|
13
|
+
readonly approval: ApprovalService;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Install the approval context extension.
|
|
18
|
+
* Adds `this.approval` property to ExecutionContextBase.
|
|
19
|
+
*/
|
|
20
|
+
export declare function installApprovalContextExtension(): void;
|
|
21
|
+
//# sourceMappingURL=approval.context-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval.context-extension.d.ts","sourceRoot":"","sources":["../src/approval.context-extension.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAOnE,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,oBAAoB;QAC5B;;;WAGG;QACH,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;KACpC;CACF;AAQD;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CActD"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ApprovalPlugin - Tool authorization workflow with PKCE webhook security.
|
|
3
|
+
*
|
|
4
|
+
* @module @frontmcp/plugin-approval
|
|
5
|
+
*/
|
|
6
|
+
import { DynamicPlugin, ProviderType } from '@frontmcp/sdk';
|
|
7
|
+
import type { StorageConfig, RootStorage, NamespacedStorage } from '@frontmcp/utils';
|
|
8
|
+
import type { ApprovalMode } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Configuration options for ApprovalPlugin.
|
|
11
|
+
*/
|
|
12
|
+
export interface ApprovalPluginOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Storage configuration for approvals.
|
|
15
|
+
* @default { type: 'auto' }
|
|
16
|
+
*/
|
|
17
|
+
storage?: StorageConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Use existing storage instance.
|
|
20
|
+
*/
|
|
21
|
+
storageInstance?: RootStorage | NamespacedStorage;
|
|
22
|
+
/**
|
|
23
|
+
* Namespace for approval keys.
|
|
24
|
+
* @default 'approval'
|
|
25
|
+
*/
|
|
26
|
+
namespace?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Approval workflow mode.
|
|
29
|
+
* - 'recheck': Poll external API for approval status
|
|
30
|
+
* - 'webhook': Use PKCE-secured webhooks for approval
|
|
31
|
+
* @default 'recheck'
|
|
32
|
+
*/
|
|
33
|
+
mode?: ApprovalMode;
|
|
34
|
+
/**
|
|
35
|
+
* Recheck mode configuration.
|
|
36
|
+
*/
|
|
37
|
+
recheck?: {
|
|
38
|
+
/** URL to check for approval status */
|
|
39
|
+
url?: string;
|
|
40
|
+
/** Authentication method */
|
|
41
|
+
auth?: 'jwt' | 'bearer' | 'none' | 'custom';
|
|
42
|
+
/** Interval between rechecks (ms) */
|
|
43
|
+
interval?: number;
|
|
44
|
+
/** Maximum recheck attempts */
|
|
45
|
+
maxAttempts?: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Webhook mode configuration.
|
|
49
|
+
*/
|
|
50
|
+
webhook?: {
|
|
51
|
+
/** URL to send approval requests */
|
|
52
|
+
url?: string;
|
|
53
|
+
/** Include JWT in webhook payload */
|
|
54
|
+
includeJwt?: boolean;
|
|
55
|
+
/** Challenge TTL in seconds */
|
|
56
|
+
challengeTtl?: number;
|
|
57
|
+
/** Callback path for approval responses */
|
|
58
|
+
callbackPath?: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Enable approval audit logging.
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
enableAudit?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Maximum delegation depth for delegated approvals.
|
|
67
|
+
* @default 3
|
|
68
|
+
*/
|
|
69
|
+
maxDelegationDepth?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Cleanup interval for expired approvals (seconds).
|
|
72
|
+
* @default 60
|
|
73
|
+
*/
|
|
74
|
+
cleanupIntervalSeconds?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* ApprovalPlugin for tool authorization workflows.
|
|
78
|
+
*
|
|
79
|
+
* Features:
|
|
80
|
+
* - Tool approval checking via hook
|
|
81
|
+
* - Multiple approval scopes (session, user, time-limited, context-specific)
|
|
82
|
+
* - PKCE webhook security for external approval systems
|
|
83
|
+
* - Recheck mode for polling approval status
|
|
84
|
+
* - Full audit trail support
|
|
85
|
+
*
|
|
86
|
+
* @example Basic usage
|
|
87
|
+
* ```typescript
|
|
88
|
+
* import { ApprovalPlugin } from '@frontmcp/plugin-approval';
|
|
89
|
+
*
|
|
90
|
+
* @FrontMcp({
|
|
91
|
+
* plugins: [ApprovalPlugin.init()],
|
|
92
|
+
* })
|
|
93
|
+
* class MyServer {}
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example With webhook mode
|
|
97
|
+
* ```typescript
|
|
98
|
+
* @FrontMcp({
|
|
99
|
+
* plugins: [
|
|
100
|
+
* ApprovalPlugin.init({
|
|
101
|
+
* mode: 'webhook',
|
|
102
|
+
* webhook: {
|
|
103
|
+
* url: 'https://approval.example.com/webhook',
|
|
104
|
+
* challengeTtl: 300,
|
|
105
|
+
* },
|
|
106
|
+
* }),
|
|
107
|
+
* ],
|
|
108
|
+
* })
|
|
109
|
+
* class MyServer {}
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export default class ApprovalPlugin extends DynamicPlugin<ApprovalPluginOptions> {
|
|
113
|
+
static defaultOptions: ApprovalPluginOptions;
|
|
114
|
+
options: ApprovalPluginOptions;
|
|
115
|
+
constructor(options?: ApprovalPluginOptions);
|
|
116
|
+
/**
|
|
117
|
+
* Dynamic providers based on plugin options.
|
|
118
|
+
*/
|
|
119
|
+
static dynamicProviders: (options: ApprovalPluginOptions) => ProviderType[];
|
|
120
|
+
/**
|
|
121
|
+
* Get plugin metadata including nested plugins.
|
|
122
|
+
*/
|
|
123
|
+
static getPluginMetadata(_options: ApprovalPluginOptions): {
|
|
124
|
+
plugins?: unknown[];
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export { ApprovalPlugin };
|
|
128
|
+
//# sourceMappingURL=approval.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval.plugin.d.ts","sourceRoot":"","sources":["../src/approval.plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAU,YAAY,EAAoD,MAAM,eAAe,CAAC;AACtH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAOrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAM5C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OA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EG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE;CAInF;AAGD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency injection symbols for ApprovalPlugin.
|
|
3
|
+
*
|
|
4
|
+
* @module @frontmcp/plugin-approval
|
|
5
|
+
*/
|
|
6
|
+
import { Reference } from '@frontmcp/sdk';
|
|
7
|
+
import type { ApprovalStore } from './stores/approval-store.interface';
|
|
8
|
+
import type { ApprovalService } from './services/approval.service';
|
|
9
|
+
import type { ChallengeService } from './services/challenge.service';
|
|
10
|
+
/**
|
|
11
|
+
* Token for injecting the ApprovalStore.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ApprovalStoreToken: Reference<ApprovalStore>;
|
|
14
|
+
/**
|
|
15
|
+
* Token for injecting the ApprovalService.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ApprovalServiceToken: Reference<ApprovalService>;
|
|
18
|
+
/**
|
|
19
|
+
* Token for injecting the ChallengeService (PKCE challenge management).
|
|
20
|
+
*/
|
|
21
|
+
export declare const ChallengeServiceToken: Reference<ChallengeService>;
|
|
22
|
+
//# sourceMappingURL=approval.symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval.symbols.d.ts","sourceRoot":"","sources":["../src/approval.symbols.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,aAAa,CAE3B,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAAC,eAAe,CAE7B,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,CAAC,gBAAgB,CAE9B,CAAC"}
|