@iris-mcp/admin 0.0.0-stage → 1.1.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +248 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1030 -2
  4. package/dist/index.d.ts +11 -0
  5. package/dist/index.js +33 -0
  6. package/dist/prompts/auditSecurityPosture.d.ts +12 -0
  7. package/dist/prompts/auditSecurityPosture.js +52 -0
  8. package/dist/prompts/index.d.ts +12 -0
  9. package/dist/prompts/index.js +16 -0
  10. package/dist/prompts/provisionProjectEnvironment.d.ts +11 -0
  11. package/dist/prompts/provisionProjectEnvironment.js +48 -0
  12. package/dist/tools/audit.d.ts +42 -0
  13. package/dist/tools/audit.js +394 -0
  14. package/dist/tools/database.d.ts +14 -0
  15. package/dist/tools/database.js +179 -0
  16. package/dist/tools/index.d.ts +12 -0
  17. package/dist/tools/index.js +52 -0
  18. package/dist/tools/ldap.d.ts +33 -0
  19. package/dist/tools/ldap.js +252 -0
  20. package/dist/tools/mapping.d.ts +15 -0
  21. package/dist/tools/mapping.js +175 -0
  22. package/dist/tools/namespace.d.ts +14 -0
  23. package/dist/tools/namespace.js +145 -0
  24. package/dist/tools/oauth.d.ts +17 -0
  25. package/dist/tools/oauth.js +269 -0
  26. package/dist/tools/permission.d.ts +13 -0
  27. package/dist/tools/permission.js +70 -0
  28. package/dist/tools/presets.d.ts +20 -0
  29. package/dist/tools/presets.js +84 -0
  30. package/dist/tools/resource.d.ts +81 -0
  31. package/dist/tools/resource.js +402 -0
  32. package/dist/tools/role.d.ts +14 -0
  33. package/dist/tools/role.js +139 -0
  34. package/dist/tools/service.d.ts +19 -0
  35. package/dist/tools/service.js +199 -0
  36. package/dist/tools/ssl.d.ts +14 -0
  37. package/dist/tools/ssl.js +201 -0
  38. package/dist/tools/user.d.ts +20 -0
  39. package/dist/tools/user.js +326 -0
  40. package/dist/tools/webapp.d.ts +20 -0
  41. package/dist/tools/webapp.js +268 -0
  42. package/dist/tools/x509.d.ts +42 -0
  43. package/dist/tools/x509.js +224 -0
  44. package/package.json +58 -3
@@ -0,0 +1,326 @@
1
+ /**
2
+ * User and password management tools for the IRIS Administration MCP server.
3
+ *
4
+ * Provides four tools for managing IRIS user accounts via the custom REST endpoint:
5
+ * - {@link userManageTool} — Create, modify, or delete a user account
6
+ * - {@link userGetTool} — Get a single user or list all users
7
+ * - {@link userRolesTool} — Add or remove roles from a user
8
+ * - {@link userPasswordTool} — Change or validate a password
9
+ *
10
+ * All tools call the custom REST service at `/api/executemcp/v2/security/user`.
11
+ * Operations execute in %SYS namespace on the IRIS server.
12
+ *
13
+ * CRITICAL: Password values are never included in log output or error messages (NFR6).
14
+ */
15
+ import { IrisApiError } from "@iris-mcp/shared";
16
+ import { z } from "zod";
17
+ /** Base URL for the custom ExecuteMCPv2 REST service. */
18
+ const BASE_URL = "/api/executemcp/v2";
19
+ // ── iris_user_manage ───────────────────────────────────────────
20
+ export const userManageTool = {
21
+ name: "iris_user_manage",
22
+ title: "Manage User",
23
+ description: "Create, modify, or delete an IRIS user account. For 'create', name and password are " +
24
+ "required. For 'modify', only provided fields are updated. For 'delete', only the name is needed. " +
25
+ "Passwords are never returned in responses.",
26
+ inputSchema: z.object({
27
+ action: z
28
+ .enum(["create", "modify", "delete"])
29
+ .describe("Action to perform on the user account"),
30
+ name: z
31
+ .string()
32
+ .describe("Username for the account"),
33
+ password: z
34
+ .string()
35
+ .optional()
36
+ .describe("Password (required for create, never returned in responses)"),
37
+ fullName: z
38
+ .string()
39
+ .optional()
40
+ .describe("Display name for the user"),
41
+ roles: z
42
+ .string()
43
+ .optional()
44
+ .describe("Comma-separated list of roles to assign"),
45
+ enabled: z
46
+ .union([z.boolean(), z.number()])
47
+ .optional()
48
+ .describe("Whether the account is enabled (1/true or 0/false)"),
49
+ namespace: z
50
+ .string()
51
+ .optional()
52
+ .describe("Default namespace for the user"),
53
+ routine: z
54
+ .string()
55
+ .optional()
56
+ .describe("Default routine for the user"),
57
+ comment: z
58
+ .string()
59
+ .optional()
60
+ .describe("Comment/description for the user account"),
61
+ expirationDate: z
62
+ .string()
63
+ .optional()
64
+ .describe("Account expiration date"),
65
+ changePasswordOnNextLogin: z
66
+ .union([z.boolean(), z.number()])
67
+ .optional()
68
+ .describe("Force password change on next login (1/true or 0/false)"),
69
+ }),
70
+ annotations: {
71
+ destructiveHint: true,
72
+ readOnlyHint: false,
73
+ idempotentHint: false,
74
+ openWorldHint: false,
75
+ },
76
+ scope: "SYS",
77
+ handler: async (args, ctx) => {
78
+ const { action, name, password, fullName, roles, enabled, namespace, routine, comment, expirationDate, changePasswordOnNextLogin, } = args;
79
+ const body = { action, name };
80
+ if (password)
81
+ body.password = password;
82
+ if (fullName)
83
+ body.fullName = fullName;
84
+ if (roles)
85
+ body.roles = roles;
86
+ if (enabled !== undefined)
87
+ body.enabled = enabled ? 1 : 0;
88
+ if (namespace)
89
+ body.namespace = namespace;
90
+ if (routine)
91
+ body.routine = routine;
92
+ if (comment)
93
+ body.comment = comment;
94
+ if (expirationDate)
95
+ body.expirationDate = expirationDate;
96
+ if (changePasswordOnNextLogin !== undefined)
97
+ body.changePasswordOnNextLogin = changePasswordOnNextLogin ? 1 : 0;
98
+ const path = `${BASE_URL}/security/user`;
99
+ try {
100
+ const response = await ctx.http.post(path, body);
101
+ const result = response.result;
102
+ return {
103
+ content: [
104
+ { type: "text", text: JSON.stringify(result, null, 2) },
105
+ ],
106
+ structuredContent: result,
107
+ };
108
+ }
109
+ catch (error) {
110
+ if (error instanceof IrisApiError) {
111
+ return {
112
+ content: [
113
+ {
114
+ type: "text",
115
+ text: `Error managing user '${name}': ${error.message}`,
116
+ },
117
+ ],
118
+ isError: true,
119
+ };
120
+ }
121
+ throw error;
122
+ }
123
+ },
124
+ };
125
+ // ── iris_user_get ──────────────────────────────────────────────
126
+ export const userGetTool = {
127
+ name: "iris_user_get",
128
+ title: "Get User",
129
+ description: "Get an IRIS user account by name, or list all users when name is omitted. " +
130
+ "Returns user properties including roles, namespace, and enabled status. " +
131
+ "Passwords are never included in the response.",
132
+ inputSchema: z.object({
133
+ name: z
134
+ .string()
135
+ .optional()
136
+ .describe("Username to retrieve. If omitted, lists all users."),
137
+ cursor: z
138
+ .string()
139
+ .optional()
140
+ .describe("Pagination cursor from a previous response's nextCursor field"),
141
+ }),
142
+ annotations: {
143
+ readOnlyHint: true,
144
+ destructiveHint: false,
145
+ idempotentHint: true,
146
+ openWorldHint: false,
147
+ },
148
+ scope: "SYS",
149
+ handler: async (args, ctx) => {
150
+ const { name, cursor } = args;
151
+ try {
152
+ if (name) {
153
+ // Get single user
154
+ const path = `${BASE_URL}/security/user/${encodeURIComponent(name)}`;
155
+ const response = await ctx.http.get(path);
156
+ const result = response.result;
157
+ return {
158
+ content: [
159
+ { type: "text", text: JSON.stringify(result, null, 2) },
160
+ ],
161
+ structuredContent: result,
162
+ };
163
+ }
164
+ else {
165
+ // List all users
166
+ const path = `${BASE_URL}/security/user`;
167
+ const response = await ctx.http.get(path);
168
+ const rawResult = response.result;
169
+ const allUsers = Array.isArray(rawResult) ? rawResult : [];
170
+ const { page, nextCursor } = ctx.paginate(allUsers, cursor);
171
+ const result = {
172
+ users: page,
173
+ count: page.length,
174
+ ...(nextCursor ? { nextCursor } : {}),
175
+ };
176
+ return {
177
+ content: [
178
+ { type: "text", text: JSON.stringify(result, null, 2) },
179
+ ],
180
+ structuredContent: result,
181
+ };
182
+ }
183
+ }
184
+ catch (error) {
185
+ if (error instanceof IrisApiError) {
186
+ return {
187
+ content: [
188
+ {
189
+ type: "text",
190
+ text: name
191
+ ? `Error getting user '${name}': ${error.message}`
192
+ : `Error listing users: ${error.message}`,
193
+ },
194
+ ],
195
+ isError: true,
196
+ };
197
+ }
198
+ throw error;
199
+ }
200
+ },
201
+ };
202
+ // ── iris_user_roles ────────────────────────────────────────────
203
+ export const userRolesTool = {
204
+ name: "iris_user_roles",
205
+ title: "Manage User Roles",
206
+ description: "Add or remove a role from an IRIS user account. Returns the updated role list " +
207
+ "after the operation.",
208
+ inputSchema: z.object({
209
+ action: z
210
+ .enum(["add", "remove"])
211
+ .describe("Action to perform: add or remove a role"),
212
+ username: z
213
+ .string()
214
+ .describe("Username to modify roles for"),
215
+ role: z
216
+ .string()
217
+ .describe("Role name to add or remove (e.g., '%All', '%Developer')"),
218
+ }),
219
+ annotations: {
220
+ destructiveHint: true,
221
+ readOnlyHint: false,
222
+ idempotentHint: false,
223
+ openWorldHint: false,
224
+ },
225
+ scope: "SYS",
226
+ handler: async (args, ctx) => {
227
+ const { action, username, role } = args;
228
+ const body = { action, username, role };
229
+ const path = `${BASE_URL}/security/user/roles`;
230
+ try {
231
+ const response = await ctx.http.post(path, body);
232
+ const result = response.result;
233
+ return {
234
+ content: [
235
+ { type: "text", text: JSON.stringify(result, null, 2) },
236
+ ],
237
+ structuredContent: result,
238
+ };
239
+ }
240
+ catch (error) {
241
+ if (error instanceof IrisApiError) {
242
+ return {
243
+ content: [
244
+ {
245
+ type: "text",
246
+ text: `Error managing roles for user '${username}': ${error.message}`,
247
+ },
248
+ ],
249
+ isError: true,
250
+ };
251
+ }
252
+ throw error;
253
+ }
254
+ },
255
+ };
256
+ // ── iris_user_password ─────────────────────────────────────────
257
+ export const userPasswordTool = {
258
+ name: "iris_user_password",
259
+ title: "Manage User Password",
260
+ description: "Change a user's password or validate a candidate password against IRIS password rules. " +
261
+ "For 'change', username and password are required. Optional changePasswordOnNextLogin boolean " +
262
+ "forces the user to change their password at next login (sets the ChangePassword flag alongside " +
263
+ "the new password in the same Security.Users.Modify() call). " +
264
+ "For 'validate', only password is needed; the response includes the active password policy " +
265
+ "(policy.minLength and policy.pattern) so callers can see what rules are being enforced. " +
266
+ "Passwords are never included in responses.",
267
+ inputSchema: z.object({
268
+ action: z
269
+ .enum(["change", "validate"])
270
+ .describe("Action: 'change' to set a new password, 'validate' to check password rules"),
271
+ username: z
272
+ .string()
273
+ .optional()
274
+ .describe("Username whose password to change (required for 'change' action)"),
275
+ password: z
276
+ .string()
277
+ .describe("New password to set or candidate password to validate"),
278
+ changePasswordOnNextLogin: z
279
+ .boolean()
280
+ .optional()
281
+ .describe("When true, force the user to change their password on next login " +
282
+ "(sets Security.Users.ChangePassword flag alongside the new password). " +
283
+ "Only valid for 'change' action. Default: leave existing flag unchanged."),
284
+ }),
285
+ annotations: {
286
+ destructiveHint: true,
287
+ readOnlyHint: false,
288
+ idempotentHint: false,
289
+ openWorldHint: false,
290
+ },
291
+ scope: "SYS",
292
+ handler: async (args, ctx) => {
293
+ const { action, username, password, changePasswordOnNextLogin } = args;
294
+ const body = { action, password };
295
+ if (username)
296
+ body.username = username;
297
+ if (changePasswordOnNextLogin !== undefined)
298
+ body.changePasswordOnNextLogin = changePasswordOnNextLogin ? 1 : 0;
299
+ const path = `${BASE_URL}/security/user/password`;
300
+ try {
301
+ const response = await ctx.http.post(path, body);
302
+ const result = response.result;
303
+ return {
304
+ content: [
305
+ { type: "text", text: JSON.stringify(result, null, 2) },
306
+ ],
307
+ structuredContent: result,
308
+ };
309
+ }
310
+ catch (error) {
311
+ if (error instanceof IrisApiError) {
312
+ return {
313
+ content: [
314
+ {
315
+ type: "text",
316
+ text: `Error with password operation: ${error.message}`,
317
+ },
318
+ ],
319
+ isError: true,
320
+ };
321
+ }
322
+ throw error;
323
+ }
324
+ },
325
+ };
326
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Web application management tools for the IRIS Administration MCP server.
3
+ *
4
+ * Provides three tools for managing IRIS CSP/REST web applications via the custom REST endpoint:
5
+ * - {@link webappManageTool} — Create, modify, or delete a web application
6
+ * - {@link webappGetTool} — Get a single web application by name
7
+ * - {@link webappListTool} — List all web applications, optionally filtered by namespace
8
+ *
9
+ * All tools call the custom REST service at `/api/executemcp/v2/security/webapp`.
10
+ * Operations execute in %SYS namespace on the IRIS server.
11
+ *
12
+ * NOTE: Security.Applications.Create() does NOT notify the CSP gateway.
13
+ * Newly created web apps require saving through the Management Portal
14
+ * or restarting the CSP gateway to become active.
15
+ */
16
+ import { type ToolDefinition } from "@iris-mcp/shared";
17
+ export declare const webappManageTool: ToolDefinition;
18
+ export declare const webappGetTool: ToolDefinition;
19
+ export declare const webappListTool: ToolDefinition;
20
+ //# sourceMappingURL=webapp.d.ts.map
@@ -0,0 +1,268 @@
1
+ /**
2
+ * Web application management tools for the IRIS Administration MCP server.
3
+ *
4
+ * Provides three tools for managing IRIS CSP/REST web applications via the custom REST endpoint:
5
+ * - {@link webappManageTool} — Create, modify, or delete a web application
6
+ * - {@link webappGetTool} — Get a single web application by name
7
+ * - {@link webappListTool} — List all web applications, optionally filtered by namespace
8
+ *
9
+ * All tools call the custom REST service at `/api/executemcp/v2/security/webapp`.
10
+ * Operations execute in %SYS namespace on the IRIS server.
11
+ *
12
+ * NOTE: Security.Applications.Create() does NOT notify the CSP gateway.
13
+ * Newly created web apps require saving through the Management Portal
14
+ * or restarting the CSP gateway to become active.
15
+ */
16
+ import { IrisApiError } from "@iris-mcp/shared";
17
+ import { z } from "zod";
18
+ /** Base URL for the custom ExecuteMCPv2 REST service. */
19
+ const BASE_URL = "/api/executemcp/v2";
20
+ // ── iris_webapp_manage ─────────────────────────────────────────
21
+ export const webappManageTool = {
22
+ name: "iris_webapp_manage",
23
+ title: "Manage Web Application",
24
+ description: "Create, modify, or delete an IRIS CSP/REST web application. For 'create', " +
25
+ "name is required (must start with '/'). For 'modify', only provided fields " +
26
+ "are updated. For 'delete', only the name is needed. " +
27
+ "NOTE: Creating a web app does NOT notify the CSP gateway — save through " +
28
+ "the Management Portal or restart the CSP gateway to activate.",
29
+ inputSchema: z.object({
30
+ action: z
31
+ .enum(["create", "modify", "delete"])
32
+ .describe("Action to perform on the web application"),
33
+ name: z
34
+ .string()
35
+ .describe("Web application path (must start with '/', e.g., '/api/myapp')"),
36
+ namespace: z
37
+ .string()
38
+ .optional()
39
+ .describe("Target namespace for the web application"),
40
+ dispatchClass: z
41
+ .string()
42
+ .optional()
43
+ .describe("REST dispatch class name (e.g., 'MyApp.REST.Dispatch')"),
44
+ description: z
45
+ .string()
46
+ .optional()
47
+ .describe("Description of the web application"),
48
+ enabled: z
49
+ .union([z.boolean(), z.number()])
50
+ .optional()
51
+ .describe("Whether the web application is enabled (1/true or 0/false)"),
52
+ authEnabled: z
53
+ .number()
54
+ .optional()
55
+ .describe("Authentication method bitmask (e.g., 32=Password, 64=Kerberos)"),
56
+ isNameSpaceDefault: z
57
+ .union([z.boolean(), z.number()])
58
+ .optional()
59
+ .describe("Whether this is the default app for the namespace (1/true or 0/false)"),
60
+ cspZenEnabled: z
61
+ .union([z.boolean(), z.number()])
62
+ .optional()
63
+ .describe("Enable CSP/ZEN support (1/true or 0/false)"),
64
+ recurse: z
65
+ .union([z.boolean(), z.number()])
66
+ .optional()
67
+ .describe("Enable subdirectory access (1/true or 0/false)"),
68
+ matchRoles: z
69
+ .string()
70
+ .optional()
71
+ .describe("Roles required to access the application (colon-separated)"),
72
+ resource: z
73
+ .string()
74
+ .optional()
75
+ .describe("Resource required for access"),
76
+ cookiePath: z
77
+ .string()
78
+ .optional()
79
+ .describe("Cookie path for the web application"),
80
+ }),
81
+ annotations: {
82
+ destructiveHint: true,
83
+ readOnlyHint: false,
84
+ idempotentHint: false,
85
+ openWorldHint: false,
86
+ },
87
+ scope: "SYS",
88
+ handler: async (args, ctx) => {
89
+ const { action, name, namespace, dispatchClass, description, enabled, authEnabled, isNameSpaceDefault, cspZenEnabled, recurse, matchRoles, resource, cookiePath, } = args;
90
+ const body = { action, name };
91
+ if (namespace !== undefined)
92
+ body.namespace = namespace;
93
+ if (dispatchClass !== undefined)
94
+ body.dispatchClass = dispatchClass;
95
+ if (description !== undefined)
96
+ body.description = description;
97
+ if (enabled !== undefined)
98
+ body.enabled = enabled ? 1 : 0;
99
+ if (authEnabled !== undefined)
100
+ body.authEnabled = authEnabled;
101
+ if (isNameSpaceDefault !== undefined)
102
+ body.isNameSpaceDefault = isNameSpaceDefault ? 1 : 0;
103
+ if (cspZenEnabled !== undefined)
104
+ body.cspZenEnabled = cspZenEnabled ? 1 : 0;
105
+ if (recurse !== undefined)
106
+ body.recurse = recurse ? 1 : 0;
107
+ if (matchRoles !== undefined)
108
+ body.matchRoles = matchRoles;
109
+ if (resource !== undefined)
110
+ body.resource = resource;
111
+ if (cookiePath !== undefined)
112
+ body.cookiePath = cookiePath;
113
+ const path = `${BASE_URL}/security/webapp`;
114
+ try {
115
+ const response = await ctx.http.post(path, body);
116
+ const result = response.result;
117
+ return {
118
+ content: [
119
+ { type: "text", text: JSON.stringify(result, null, 2) },
120
+ ],
121
+ structuredContent: result,
122
+ };
123
+ }
124
+ catch (error) {
125
+ if (error instanceof IrisApiError) {
126
+ return {
127
+ content: [
128
+ {
129
+ type: "text",
130
+ text: `Error managing web application '${name}': ${error.message}`,
131
+ },
132
+ ],
133
+ isError: true,
134
+ };
135
+ }
136
+ throw error;
137
+ }
138
+ },
139
+ };
140
+ // ── iris_webapp_get ─────────────────────────────────────────────
141
+ export const webappGetTool = {
142
+ name: "iris_webapp_get",
143
+ title: "Get Web Application",
144
+ description: "Look up a single IRIS CSP/REST web application by its EXACT name. " +
145
+ "This is an exact-match lookup, NOT a pattern search — the `name` " +
146
+ "argument must be the literal registered path. Do NOT append '*' or " +
147
+ "'/*' to 'expand' a prefix — those characters are matched literally " +
148
+ "and will return `{exists: false}`. To enumerate webapps under a " +
149
+ "prefix or in a namespace, use `iris_webapp_list` (optionally with " +
150
+ "its `namespace` filter) and scan the results. " +
151
+ "Uses POST to avoid URL-encoding issues with forward slashes in " +
152
+ "application paths, so it works identically for /csp/, /api/, /isc/, " +
153
+ "and any other prefix at arbitrary path depth. " +
154
+ "Returns all web application properties including namespace, dispatch " +
155
+ "class, authentication settings, and enabled status. When the webapp " +
156
+ "does not exist, returns `{exists: false, name}` with HTTP 200 (not " +
157
+ "an error), so callers can distinguish a missing webapp from a real " +
158
+ "failure. When the webapp exists, the response includes `exists: true` " +
159
+ "alongside all other properties.",
160
+ inputSchema: z.object({
161
+ name: z
162
+ .string()
163
+ .describe("Exact literal webapp path — no wildcards. Examples: " +
164
+ "'/csp/user', '/api/myapp', '/csp/healthshare', " +
165
+ "'/csp/healthshare/hssys/app/api'. Passing '/csp/healthshare/*' " +
166
+ "or similar will match literally and return `{exists: false}`. " +
167
+ "Use `iris_webapp_list` to enumerate webapps instead."),
168
+ }),
169
+ annotations: {
170
+ readOnlyHint: true,
171
+ destructiveHint: false,
172
+ idempotentHint: true,
173
+ openWorldHint: false,
174
+ },
175
+ scope: "SYS",
176
+ handler: async (args, ctx) => {
177
+ const { name } = args;
178
+ const path = `${BASE_URL}/security/webapp/get`;
179
+ try {
180
+ const response = await ctx.http.post(path, { name });
181
+ const result = response.result;
182
+ return {
183
+ content: [
184
+ { type: "text", text: JSON.stringify(result, null, 2) },
185
+ ],
186
+ structuredContent: result,
187
+ };
188
+ }
189
+ catch (error) {
190
+ if (error instanceof IrisApiError) {
191
+ return {
192
+ content: [
193
+ {
194
+ type: "text",
195
+ text: `Error getting web application '${name}': ${error.message}`,
196
+ },
197
+ ],
198
+ isError: true,
199
+ };
200
+ }
201
+ throw error;
202
+ }
203
+ },
204
+ };
205
+ // ── iris_webapp_list ────────────────────────────────────────────
206
+ export const webappListTool = {
207
+ name: "iris_webapp_list",
208
+ title: "List Web Applications",
209
+ description: "List all IRIS CSP/REST web applications. Optionally filter by namespace. " +
210
+ "Returns web application name, namespace, dispatch class, enabled status, " +
211
+ "and other configuration properties.",
212
+ inputSchema: z.object({
213
+ namespace: z
214
+ .string()
215
+ .optional()
216
+ .describe("Filter web applications by target namespace (e.g., 'USER', 'HSLIB')"),
217
+ cursor: z
218
+ .string()
219
+ .optional()
220
+ .describe("Pagination cursor from a previous response's nextCursor field"),
221
+ }),
222
+ annotations: {
223
+ readOnlyHint: true,
224
+ destructiveHint: false,
225
+ idempotentHint: true,
226
+ openWorldHint: false,
227
+ },
228
+ scope: "BOTH",
229
+ handler: async (args, ctx) => {
230
+ const { namespace, cursor } = args;
231
+ let path = `${BASE_URL}/security/webapp`;
232
+ if (namespace) {
233
+ path += `?namespace=${encodeURIComponent(namespace)}`;
234
+ }
235
+ try {
236
+ const response = await ctx.http.get(path);
237
+ const rawResult = response.result;
238
+ const allApps = Array.isArray(rawResult) ? rawResult : [];
239
+ const { page, nextCursor } = ctx.paginate(allApps, cursor);
240
+ const result = {
241
+ webapps: page,
242
+ count: page.length,
243
+ ...(nextCursor ? { nextCursor } : {}),
244
+ };
245
+ return {
246
+ content: [
247
+ { type: "text", text: JSON.stringify(result, null, 2) },
248
+ ],
249
+ structuredContent: result,
250
+ };
251
+ }
252
+ catch (error) {
253
+ if (error instanceof IrisApiError) {
254
+ return {
255
+ content: [
256
+ {
257
+ type: "text",
258
+ text: `Error listing web applications: ${error.message}`,
259
+ },
260
+ ],
261
+ isError: true,
262
+ };
263
+ }
264
+ throw error;
265
+ }
266
+ },
267
+ };
268
+ //# sourceMappingURL=webapp.js.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * IRIS X.509 certificate-credentials tool for the IRIS Administration MCP
3
+ * server.
4
+ *
5
+ * Provides {@link x509ManageTool} — a single multi-action tool to list,
6
+ * inspect, import, and delete X.509 certificate credentials
7
+ * (`%SYS.X509Credentials`) via the custom REST endpoint
8
+ * `/api/executemcp/v2/security/x509`. Operations execute in the `%SYS`
9
+ * namespace on the IRIS server.
10
+ *
11
+ * **Governed write tool (Epic 15, Story 15.3).** The `mutates` classification
12
+ * map classifies all four actions: `list`/`get` are reads (enabled by default),
13
+ * while `import`/`delete` are writes that the governance layer
14
+ * default-DISABLES until an operator opts in via `IRIS_GOVERNANCE`. The tool
15
+ * does NOT declare a `server` field — the framework injects it (architecture
16
+ * decision D2).
17
+ *
18
+ * **SECURITY-CRITICAL — NO private-key material in output (AC 15.3.3):**
19
+ * `%SYS.X509Credentials` holds private-key material (`PrivateKey`,
20
+ * `PrivateKeyPassword`, and the `*Export` variants). `list`/`get` return ONLY
21
+ * public metadata: the alias, a `hasPrivateKey` boolean, and safe public
22
+ * certificate fields (subject/issuer/serial/thumbprint/subjectKeyIdentifier/
23
+ * notBefore/notAfter). They MUST NEVER return the private key in any form. The
24
+ * exclusion is enforced in BOTH the ObjectScript handler (which never reads the
25
+ * secret properties into its output) and this output mapping (which only ever
26
+ * forwards the server's already-private-key-free envelope). A deep-scan unit
27
+ * test asserts no private-key-shaped field appears at any depth of the output.
28
+ *
29
+ * **`import` mechanism (AC 15.3.4, Rule #16 live probe):** the native
30
+ * `%SYS.X509Credentials.Import(FileName, .NumImported, Flags)` reads a
31
+ * server-side XML *export* file — not agent-friendly for importing a single
32
+ * certificate. The class DOES support constructing a credential from a
33
+ * base64-encoded certificate (DER or PEM) + `Save` (mirroring what
34
+ * `LoadCertificate` does internally: base64-decode → `Certificate` setter,
35
+ * which auto-derives Thumbprint/Subject/Issuer/Serial/SubjectKeyIdentifier). So
36
+ * `import` accepts a base64 `certificate` (required) and an OPTIONAL,
37
+ * write-only base64 `privateKey` (+ optional `privateKeyPassword`). The private
38
+ * key is accepted IN only — it is never echoed back in the import response.
39
+ */
40
+ import { type ToolDefinition } from "@iris-mcp/shared";
41
+ export declare const x509ManageTool: ToolDefinition;
42
+ //# sourceMappingURL=x509.d.ts.map