-
Notifications
You must be signed in to change notification settings - Fork 39
feat: change Atlas API auth to service accounts #59
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
Conversation
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.
LGTM
README.md
Outdated
| ------------------ | --------------------------------------------------------------------------- | | ||
| `apiClientId` | Atlas API client ID for authentication | | ||
| `apiClientSecret` | Atlas API client secret for authentication | | ||
| `stateFile` | Path to store application state (default ~/.mongodb/mongodb-mcp/state.json) | |
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.
We can drop this now - I forgot to remove it as part of #48 😅
README.md
Outdated
| `apiClientId` | Atlas API client ID for authentication | | ||
| `apiClientSecret` | Atlas API client secret for authentication | | ||
| `stateFile` | Path to store application state (default ~/.mongodb/mongodb-mcp/state.json) | | ||
| `connectionString` | MongoDB connection string for direct database connections | |
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.
We should probably indicate this is optional and if not provided, the connect
tool should be used.
status: "not_auth" | "requested" | "issued"; | ||
code?: OauthDeviceCode; | ||
token?: OAuthToken; | ||
}; | ||
connectionString?: string; |
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.
Per slack discussion, let's drop the connection string storage and rely on users either providing it every time or supplying it as env variable. I know this will turn the credentials field to an empty object, but we could keep it around for persisting sensitive data after we go through security review. It will also allow the security team to review the mechanisms we intend to use for secure storage.
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.
will do that on a follow up PR
src/tools/atlas/atlasTool.ts
Outdated
|
||
export abstract class AtlasToolBase extends ToolBase { | ||
constructor( | ||
state: State, | ||
protected apiClient: ApiClient | ||
protected apiClient?: ApiClient | ||
) { | ||
super(state); | ||
} | ||
|
||
protected async ensureAuthenticated(): Promise<void> { |
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.
protected async ensureAuthenticated(): Promise<void> { | |
protected ensureAuthenticated(): void { |
src/tools/atlas/atlasTool.ts
Outdated
|
||
export abstract class AtlasToolBase extends ToolBase { | ||
constructor( | ||
state: State, | ||
protected apiClient: ApiClient | ||
protected apiClient?: ApiClient | ||
) { | ||
super(state); | ||
} | ||
|
||
protected async ensureAuthenticated(): Promise<void> { |
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.
protected async ensureAuthenticated(): Promise<void> { | |
protected ensureAuthenticated(): asserts this is { apiClient: ApiClient } { |
should let you get rid of all !
if you remove the await-s
* main: feat: change Atlas API auth to service accounts (#59)
fixes #39