-
Notifications
You must be signed in to change notification settings - Fork 133
feat: Allow configuration of temporary user timeout when connecting to atlas cluster #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
83c9639
4a9d879
9581337
ce905bd
90123d3
b7e0d1b
b0e8b94
17c15bb
5f60f73
6700878
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import type { Secret } from "./keychain.js"; | |
import levenshtein from "ts-levenshtein"; | ||
|
||
// From: https://github.com/mongodb-js/mongosh/blob/main/packages/cli-repl/src/arg-parser.ts | ||
const OPTIONS = { | ||
const MONGOSH_OPTIONS = { | ||
string: [ | ||
"apiBaseUrl", | ||
"apiClientId", | ||
|
@@ -92,6 +92,18 @@ const OPTIONS = { | |
}, | ||
} as const; | ||
|
||
const MCP_SERVER_OPTIONS = { | ||
string: ["atlasTemporaryDatabaseUserLifetimeMs"], | ||
} as const; | ||
|
||
const OPTIONS = { | ||
|
||
string: [...MONGOSH_OPTIONS.string, ...MCP_SERVER_OPTIONS.string], | ||
boolean: [...MONGOSH_OPTIONS.boolean], | ||
array: [...MONGOSH_OPTIONS.array], | ||
alias: { ...MONGOSH_OPTIONS.alias }, | ||
configuration: { ...MONGOSH_OPTIONS.configuration }, | ||
} as const; | ||
|
||
const ALL_CONFIG_KEYS = new Set( | ||
(OPTIONS.string as readonly string[]) | ||
.concat(OPTIONS.array) | ||
|
@@ -161,6 +173,7 @@ export interface UserConfig extends CliOptions { | |
loggers: Array<"stderr" | "disk" | "mcp">; | ||
idleTimeoutMs: number; | ||
notificationTimeoutMs: number; | ||
atlasTemporaryDatabaseUserLifetimeMs: number; | ||
} | ||
|
||
export const defaultUserConfig: UserConfig = { | ||
|
@@ -180,6 +193,7 @@ export const defaultUserConfig: UserConfig = { | |
idleTimeoutMs: 600000, // 10 minutes | ||
notificationTimeoutMs: 540000, // 9 minutes | ||
httpHeaders: {}, | ||
atlasTemporaryDatabaseUserLifetimeMs: 14400000, // 4 hours | ||
|
||
}; | ||
|
||
export const config = setupUserConfig({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is a problem. The options that you see here are not all MONGOSH options. They contain MCP related options as well.
I don't have strong opinion on fixing this right now but consider that this is only a partial solution. We still need to address it entirely, perhaps with https://jira.mongodb.org/browse/MCP-202