-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Copy link
Description
MongoDB Atlas Management API v2, OAuth2 + HTTP Digest
We will build a new service discovery plugin that programmatically discovers MongoDB Atlas Projects and Clusters so they can appear in the extension's Discovery View. Start working on the the plugin under plugins/mongodb-atlas (or similar under plugins) so it follows the existing provider pattern.
This issue focuses on the programmatic access only.
Programmatic requirements (Atlas Management API v2)
- API version: Use the Atlas Management API v2 (base: https://cloud.mongodb.com/api/atlas/v2).
- Authentication: support both
- OAuth 2.0 Client Credentials flow (preferred): obtain, cache, refresh Bearer tokens; handle scopes and expiry.
- Legacy HTTP Digest Authentication (Atlas API Keys): support publicKey/privateKey Digest auth as a fallback.
- Implement the following programmatic operations:
- List Projects (groups) and Clusters within a Project.
- Example v2 endpoints:
GET /groupsandGET /groups/{PROJECT-ID}/clusters
- Example v2 endpoints:
- Read cluster connection strings (
connectionStringsfield on cluster resource).- Example v2 endpoint:
GET /groups/{PROJECT-ID}/clusters/{CLUSTER-NAME}
- Example v2 endpoint:
- List database users for a Project/Cluster.
- Example v2 endpoint:
GET /groups/{PROJECT-ID}/databaseUsers
- Example v2 endpoint:
- Read and write IP access list (firewall) entries for a Project.
- Example v2 endpoints:
GET /groups/{PROJECT-ID}/accessList,POST /groups/{PROJECT-ID}/accessList,DELETE /groups/{PROJECT-ID}/accessList/{ENTRY-ID}(verify exact ops per docs)
- Example v2 endpoints:
- List Projects (groups) and Clusters within a Project.
Pagination & rate limits
- Implement generic pagination following Atlas v2 response patterns (
links/next/totalCount). - Respect HTTP
429/Retry-After; implement exponential backoff with jitter and sensible max retries.
Testing & quality
- Unit tests for the HTTP client covering OAuth token flow, Digest auth, pagination, and
429retry behavior (use mocked HTTP responses). - Minimal integration/testing notes in README describing how to obtain API credentials and run manual discovery.
Notes / implementation hints
- Confirm exact OAuth token endpoint and required scopes from MongoDB Atlas docs during implementation.
- For Digest auth, prefer a tested library that supports HTTP Digest signing instead of hand-rolling it.
- Keep the API client thin and testable; surface friendly errors to the UI layer.
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
In progress