infrawise 0.8.7 → 0.9.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/README.md +2 -1
- package/dist/adapters/aws/services.js +23 -1
- package/dist/context/index.js +9 -8
- package/dist/graph/index.js +1 -0
- package/dist/server/index.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ To let Claude Code manage the server lifecycle automatically:
|
|
|
170
170
|
| `suggest_mongo_index` | Exact `createIndex` command for a MongoDB collection + field |
|
|
171
171
|
| `mysql_index_suggestions` | Exact `ALTER TABLE ADD INDEX` SQL for your MySQL table |
|
|
172
172
|
| `get_queue_details` | SQS queues — DLQ status, encryption, message counts |
|
|
173
|
-
| `get_topic_details` | SNS topics — subscription counts and
|
|
173
|
+
| `get_topic_details` | SNS topics — subscription counts, protocols, and filter policies (required message attributes per subscription) |
|
|
174
174
|
| `get_secrets_overview` | Secrets Manager — names and rotation status (values never included) |
|
|
175
175
|
| `get_parameter_overview` | SSM Parameter Store — names, types, tiers (values never included) |
|
|
176
176
|
| `get_lambda_overview` | Lambda functions — runtime, memory, timeout, triggers (SQS/DynamoDB/Kinesis/EventBridge/S3), env var key names |
|
|
@@ -345,6 +345,7 @@ Works from AWS APIs, database schema introspection, and IaC files — no depende
|
|
|
345
345
|
| PostgreSQL / MySQL schema | Tables, indexes, column types |
|
|
346
346
|
| MongoDB schema | Collections, indexes |
|
|
347
347
|
| SQS | Missing DLQs, unencrypted queues, large backlogs |
|
|
348
|
+
| SNS | Subscription filter policies — required message attributes per subscription |
|
|
348
349
|
| Kafka (kafkajs) | Producer/consumer topic mapping from code |
|
|
349
350
|
| Secrets Manager | Missing secret rotation |
|
|
350
351
|
| Lambda | Default memory (128 MB), high timeouts, triggers (SQS/DynamoDB/Kinesis/EventBridge/S3), missing DLQ on trigger source |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SQSClient, ListQueuesCommand, GetQueueAttributesCommand } from '@aws-sdk/client-sqs';
|
|
2
|
-
import { SNSClient, ListTopicsCommand, GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, } from '@aws-sdk/client-sns';
|
|
2
|
+
import { SNSClient, ListTopicsCommand, GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, GetSubscriptionAttributesCommand, } from '@aws-sdk/client-sns';
|
|
3
3
|
import { SSMClient, DescribeParametersCommand } from '@aws-sdk/client-ssm';
|
|
4
4
|
import { SecretsManagerClient, ListSecretsCommand } from '@aws-sdk/client-secrets-manager';
|
|
5
5
|
import { LambdaClient, ListFunctionsCommand, ListEventSourceMappingsCommand, } from '@aws-sdk/client-lambda';
|
|
@@ -112,12 +112,34 @@ export async function extractSNSMetadata(cfg = {}) {
|
|
|
112
112
|
]);
|
|
113
113
|
const attrs = attrsRes.Attributes ?? {};
|
|
114
114
|
const subs = subsRes.Subscriptions ?? [];
|
|
115
|
+
const filterPolicies = [];
|
|
116
|
+
for (const sub of subs) {
|
|
117
|
+
if (!sub.SubscriptionArn || sub.SubscriptionArn === 'PendingConfirmation')
|
|
118
|
+
continue;
|
|
119
|
+
try {
|
|
120
|
+
const subAttrs = await client.send(new GetSubscriptionAttributesCommand({ SubscriptionArn: sub.SubscriptionArn }));
|
|
121
|
+
const fp = subAttrs.Attributes?.['FilterPolicy'];
|
|
122
|
+
if (fp) {
|
|
123
|
+
const parsed = JSON.parse(fp);
|
|
124
|
+
filterPolicies.push({
|
|
125
|
+
subscriptionArn: sub.SubscriptionArn,
|
|
126
|
+
protocol: sub.Protocol ?? 'unknown',
|
|
127
|
+
requiredAttributes: Object.keys(parsed),
|
|
128
|
+
scope: subAttrs.Attributes?.['FilterPolicyScope'] ?? 'MessageAttributes',
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
// skip subscription if attributes fetch fails
|
|
134
|
+
}
|
|
135
|
+
}
|
|
115
136
|
topics.push({
|
|
116
137
|
name: arn.split(':').pop() ?? arn,
|
|
117
138
|
arn,
|
|
118
139
|
encrypted: !!attrs['KmsMasterKeyId'],
|
|
119
140
|
subscriptionCount: parseInt(attrs['SubscriptionsConfirmed'] ?? '0', 10),
|
|
120
141
|
subscriptionProtocols: [...new Set(subs.map((s) => s.Protocol ?? 'unknown'))],
|
|
142
|
+
filterPolicies,
|
|
121
143
|
});
|
|
122
144
|
}
|
|
123
145
|
catch (err) {
|
package/dist/context/index.js
CHANGED
|
@@ -193,14 +193,15 @@ function resolveStringValue(node, sourceFile) {
|
|
|
193
193
|
return result;
|
|
194
194
|
}
|
|
195
195
|
if (Node.isIdentifier(node)) {
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
const symbol = node.getSymbol();
|
|
197
|
+
if (symbol) {
|
|
198
|
+
for (const decl of symbol.getDeclarations()) {
|
|
199
|
+
if (Node.isVariableDeclaration(decl)) {
|
|
200
|
+
const init = decl.getInitializer();
|
|
201
|
+
if (init)
|
|
202
|
+
return resolveStringValue(init, sourceFile);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
return null;
|
package/dist/graph/index.js
CHANGED
|
@@ -85,6 +85,7 @@ export function buildGraph(operations, dynamoMeta, postgresMeta, mysqlMeta = [],
|
|
|
85
85
|
provider: 'aws',
|
|
86
86
|
subscriptionCount: t.subscriptionCount,
|
|
87
87
|
encrypted: t.encrypted,
|
|
88
|
+
filterPolicies: t.filterPolicies?.length > 0 ? t.filterPolicies : undefined,
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
for (const s of servicesMeta.secrets ?? []) {
|
package/dist/server/index.js
CHANGED
|
@@ -265,7 +265,7 @@ export function createMcpServer() {
|
|
|
265
265
|
});
|
|
266
266
|
}));
|
|
267
267
|
mcp.registerTool('get_topic_details', {
|
|
268
|
-
description: 'Returns all SNS topics with subscription count and
|
|
268
|
+
description: 'Returns all SNS topics with subscription count, encryption status, and filter policies. Filter policies list the message attributes each subscription requires — publishers must include these attributes or messages are silently dropped. Call this before writing any SNS publish code or when reviewing event fan-out patterns.',
|
|
269
269
|
inputSchema: z.object({}),
|
|
270
270
|
}, logged('get_topic_details', async () => {
|
|
271
271
|
const topics = getTopicNodes(currentGraph);
|
|
@@ -276,6 +276,7 @@ export function createMcpServer() {
|
|
|
276
276
|
provider: t.provider,
|
|
277
277
|
subscriptionCount: t.subscriptionCount,
|
|
278
278
|
encrypted: t.encrypted,
|
|
279
|
+
filterPolicies: t.filterPolicies ?? [],
|
|
279
280
|
})),
|
|
280
281
|
});
|
|
281
282
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infrawise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"mcpName": "io.github.Sidd27/infrawise",
|
|
5
5
|
"description": "CLI-first infrastructure intelligence platform — analyzes DynamoDB, PostgreSQL, MySQL, MongoDB, SQS, SNS, SSM, Secrets Manager, Lambda, S3, CloudWatch Logs and exposes findings as an MCP server for Claude Code",
|
|
6
6
|
"keywords": [
|