@opsee/mcp-server 0.7.1 → 0.7.2
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/package.json +1 -1
- package/src/auth/kv-store.ts +12 -4
package/package.json
CHANGED
package/src/auth/kv-store.ts
CHANGED
|
@@ -87,16 +87,24 @@ export function createKVStore(): KVStore {
|
|
|
87
87
|
port: parseInt(process.env.REDIS_PORT || "6379", 10),
|
|
88
88
|
password: process.env.REDIS_PASSWORD || undefined,
|
|
89
89
|
db: parseInt(process.env.REDIS_DB || "0", 10),
|
|
90
|
-
|
|
91
|
-
//
|
|
90
|
+
// ElastiCache with in-transit encryption requires TLS. ServerName must be
|
|
91
|
+
// set so SNI/cert validation matches the endpoint host.
|
|
92
|
+
tls: process.env.REDIS_TLS === "true" ? { servername: host } : undefined,
|
|
93
|
+
// Fail fast instead of hanging the request forever. Without these a
|
|
94
|
+
// misconfigured connection (e.g. plaintext to a TLS-only server) leaves
|
|
95
|
+
// commands queued indefinitely, so awaiting a GET/SET never resolves.
|
|
92
96
|
maxRetriesPerRequest: 3,
|
|
97
|
+
connectTimeout: 10_000,
|
|
98
|
+
commandTimeout: 5_000,
|
|
93
99
|
});
|
|
94
100
|
|
|
95
101
|
redis.on("error", (err: Error) => {
|
|
96
102
|
console.error("[oauth] Redis error:", err.message);
|
|
97
103
|
});
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
// "ready" (not "connect") means commands will actually execute — a plaintext
|
|
105
|
+
// socket to a TLS-only server fires "connect" but never becomes ready.
|
|
106
|
+
redis.on("ready", () => {
|
|
107
|
+
console.log(`[oauth] Redis ready at ${host}`);
|
|
100
108
|
});
|
|
101
109
|
|
|
102
110
|
return new RedisKVStore(redis);
|