-
Notifications
You must be signed in to change notification settings - Fork 244
DRIVERS-3395: Add Atlas SFP testing specification #1904
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
Open
jyemin
wants to merge
6
commits into
mongodb:master
Choose a base branch
from
jyemin:DRIVERS-3395
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+121
−0
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c8178b5
DRIVERS-3395: Add Atlas SFP testing specification
jyemin 9f38913
DRIVERS-3395: Update index to include Atlas SFP testing spec
jyemin 8481493
DRIVERS-3395: Require authenticated tests to run with and without com…
jyemin fe46ecb
DRIVERS-3395: Fix mdformat lint issues
jyemin 3898d57
DRIVERS-3395: Address review feedback from kevinAlbs
jyemin 9a594a5
DRIVERS-3395: Fix mdformat lint issues
jyemin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # Atlas Secure Frontend Processor (SFP) Testing | ||
|
|
||
| - Status: Accepted | ||
| - Minimum Server Version: 7.0 | ||
|
|
||
| ______________________________________________________________________ | ||
|
|
||
| ## Abstract | ||
|
|
||
| This specification defines the tests that drivers MUST run to verify connectivity and authentication through an Atlas | ||
| Secure Frontend Processor (SFP). The SFP is a proxy that sits in front of Atlas clusters to provide additional security | ||
| capabilities. | ||
|
|
||
| ## META | ||
|
|
||
| The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and | ||
| "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt). | ||
|
|
||
| ## Specification | ||
|
|
||
| ### Terms | ||
|
|
||
| #### SFP | ||
|
|
||
| Secure Frontend Processor - a proxy service that sits in front of Atlas clusters, providing TLS termination, | ||
| authentication forwarding, and additional security features. | ||
|
|
||
| ### Test Environment | ||
|
|
||
| SFP clusters are **preconfigured** and do not require provisioning or teardown as part of the test run. Drivers will be | ||
| provided with connection URIs and credentials via environment variables. | ||
|
|
||
| The SFP proxy is fully transparent to drivers - all standard MongoDB operations should work exactly as they would | ||
| against a normal Atlas cluster. | ||
|
|
||
| ### Required Environment Variables | ||
|
|
||
| The following environment variables will be available to run the tests: | ||
|
|
||
| | Variable | Description | | ||
| |----------|-------------| | ||
| | `SFP_ATLAS_URI` | MongoDB connection URI for the SFP-proxied cluster | | ||
| | `SFP_ATLAS_USER` | Username for SCRAM authentication | | ||
| | `SFP_ATLAS_PASSWORD` | Password for SCRAM authentication | | ||
|
|
||
| For X.509 authentication tests, the following additional variables are required: | ||
|
|
||
| | Variable | Description | | ||
| |----------|-------------| | ||
| | `SFP_ATLAS_X509_URI` | MongoDB connection URI for X.509 authentication | | ||
| | `SFP_ATLAS_X509_CERT` | Path to client certificate (PEM format) | | ||
|
|
||
| ### Test Isolation and Cleanup | ||
|
|
||
| To prevent conflicts between concurrent test runs and avoid unbounded collection growth: | ||
|
|
||
| 1. Drivers MUST use a unique collection name for each test run, e.g., `sfp_test_<random>` where `<random>` is a UUID | ||
| or timestamp | ||
|
kevinAlbs marked this conversation as resolved.
Outdated
|
||
| 2. Drivers MUST drop the test collection after all tests complete, regardless of test success or failure | ||
|
|
||
| ## Required Tests | ||
|
|
||
| Drivers MUST implement and run the following tests against SFP-proxied clusters. | ||
|
|
||
| ### Common Assertions | ||
|
|
||
| The following assertions are used across multiple tests: | ||
|
|
||
| #### Assertion: Ping | ||
|
|
||
| 1. Execute a `ping` command against the `admin` database | ||
| 2. Assert that the command succeeds with `ok: 1` | ||
|
|
||
| #### Assertion: Connection Status | ||
|
|
||
| 1. Execute a `connectionStatus` command against the `admin` database | ||
| 2. Assert that the command succeeds with `ok: 1` | ||
| 3. If authenticated, assert that `authInfo.authenticatedUsers` contains at least one user | ||
|
|
||
| #### Assertion: CRUD Operations | ||
|
|
||
| 1. Insert a document into a test collection and assert the insert succeeds | ||
| 2. Query the collection using `find` and assert the inserted document is returned | ||
|
|
||
| ### Unauthenticated Tests | ||
|
|
||
| Create a `MongoClient` configured with `SFP_ATLAS_URI` but without credentials. Run the following assertions: | ||
|
|
||
| - Ping | ||
| - Connection Status (assert `authenticatedUsers` is empty) | ||
|
|
||
| ### Authenticated Tests | ||
|
|
||
| #### SCRAM-SHA-256 | ||
|
|
||
| Create a `MongoClient` with the connection string and SCRAM-SHA-256 credentials from environment variables. Run the | ||
| following assertions: | ||
|
|
||
| - Ping | ||
| - Connection Status | ||
| - CRUD Operations | ||
|
|
||
| #### X.509 | ||
|
|
||
| Create a `MongoClient` with the connection string and X.509 authentication using the client certificate. Run the | ||
| following assertions: | ||
|
|
||
| - Ping | ||
| - Connection Status | ||
| - CRUD Operations | ||
|
|
||
|
kevinAlbs marked this conversation as resolved.
|
||
| ## Changelog | ||
|
|
||
| - 2025-02-27: Initial version | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.