-
Notifications
You must be signed in to change notification settings - Fork 14
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
DOCSP-40811 Authentication Mechanisms #22
Merged
jordan-smith721
merged 11 commits into
mongodb:cpp-standardization
from
jordan-smith721:DOCSP-40811-authentication
Jul 10, 2024
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
13b4d17
workflows
mongoKart 88911c1
first draft authentication pages
jordan-smith721 faf6ffb
build errors
jordan-smith721 4be63aa
typos and rst errors:
jordan-smith721 f7c8a10
another typo
jordan-smith721 a1128b8
feedback
jordan-smith721 0c4c508
remove files from master
jordan-smith721 eebeea8
add refs
jordan-smith721 55427d9
eng feedback
jordan-smith721 be2a41a
feedback
jordan-smith721 71f5a99
Merge branch 'cpp-standardization' into DOCSP-40811-authentication
jordan-smith721 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 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,13 @@ | ||
name: Check Autobuilder for Errors | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- "source/**" | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cbush/snooty-autobuilder-check@main |
This file contains 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,41 @@ | ||
name: Copy Files to docs-shared | ||
|
||
on: | ||
workflow_dispatch: {} # use to manually trigger workflow | ||
push: | ||
branches: | ||
- "master" | ||
paths: | ||
- "source/includes/mongodb-compatibility-table-css.rst" | ||
- "source/includes/language-compatibility-table-cxx.rst" | ||
|
||
jobs: | ||
copy-file: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Copy mongodb-compat table | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | ||
with: | ||
source_file: "source/includes/mongodb-compatibility-table-cxx.rst" | ||
destination_repo: "10gen/docs-shared" | ||
destination_folder: "dbx" | ||
user_email: "[email protected]" | ||
user_name: "docs-builder-bot" | ||
commit_message: "Auto-import from docs-cpp" | ||
|
||
- name: Copy language-compat table | ||
uses: dmnemec/copy_file_to_another_repo_action@main | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | ||
with: | ||
source_file: "source/includes/language-compatibility-table-cxx.rst" | ||
destination_repo: "10gen/docs-shared" | ||
destination_folder: "dbx" | ||
user_email: "[email protected]" | ||
user_name: "docs-builder-bot" | ||
commit_message: "Auto-import from docs-cpp" |
This file contains 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,39 @@ | ||
name: vale-checks | ||
on: | ||
pull_request: | ||
paths: | ||
- "source/**" | ||
|
||
jobs: | ||
vale: | ||
name: TDBX Vale rules | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- id: files | ||
uses: masesgroup/retrieve-changed-files@v2 | ||
with: | ||
format: 'csv' | ||
|
||
- name: checkout-latest-rules | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: mongodb/mongodb-vale-action | ||
path: './tdbx-vale-rules' | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: move-files-for-vale-action | ||
run: | | ||
cp tdbx-vale-rules/.vale.ini .vale.ini | ||
mkdir -p .github/styles/ | ||
cp -rf tdbx-vale-rules/.github/styles/ .github/ | ||
|
||
- name: run-vale | ||
uses: errata-ai/vale-action@reviewdog | ||
with: | ||
reporter: github-pr-check | ||
files: ${{steps.files.outputs.added_modified}} | ||
fail_on_error: true | ||
token: ${{secrets.GITHUB_TOKEN}} |
This file contains 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,72 @@ | ||||||
// start-scram-sha-256 | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<username>:<password>@<hostname>:<port>/?" | ||||||
"authSource=admin&authMechanism=SCRAM-SHA-256"); | ||||||
mongocxx::client client(uri); | ||||||
// end-scram-sha-256 | ||||||
|
||||||
// start-scram-sha-1 | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<username>:<password>@<hostname>:<port>/?" | ||||||
"authSource=admin&authMechanism=SCRAM-SHA-1"); | ||||||
mongocxx::client client(uri); | ||||||
// end-scram-sha-1 | ||||||
|
||||||
// start-x509 | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<hostname>:<port>/?" | ||||||
"tls=true&tlsCertificateKeyFile=path/to/client.pem&authMechanism=MONGODB-X509"); | ||||||
mongocxx::client client(uri); | ||||||
// end-x509 | ||||||
|
||||||
// start-aws-connection-uri | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<AWS IAM access key ID>:<AWS IAM secret access key>@<hostname>:<port>/?" | ||||||
"&authMechanism=MONGODB-AWS"); | ||||||
mongocxx::client client(uri); | ||||||
// end-aws-connection-uri | ||||||
|
||||||
// start-aws-connection-uri-session | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<AWS IAM access key ID>:<AWS IAM secret access key>@<hostname>:<port>/?" | ||||||
"&authMechanism=MONGODB-AWSS&authMechanismProperties=AWS_SESSION_TOKEN:<token>"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
mongocxx::client client(uri); | ||||||
// end-aws-connection-uri-session | ||||||
|
||||||
// start-aws-environment | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<hostname>:<port>/?" | ||||||
"authMechanism=MONGODB-AWS"); | ||||||
mongocxx::client client(uri); | ||||||
// end-aws-environment | ||||||
|
||||||
// start-kerberos | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://mongodbuser%40EXAMPLE.COM@<hostname>:<port>/?" | ||||||
"&authMechanism=GSSAPI" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"&authMechanismProperties=SERVICE_NAME:<authentication service name>"); | ||||||
mongocxx::client client(uri); | ||||||
// end-kerberos | ||||||
|
||||||
// start-plain | ||||||
#include <mongocxx/client.hpp> | ||||||
#include <mongocxx/uri.hpp> | ||||||
|
||||||
auto uri = mongocxx::uri("mongodb://<username>:<password>@<hostname>:<port>/?" | ||||||
"&authMechanism=PLAIN&tls=true"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
mongocxx::client client(uri); | ||||||
// end-plain |
This file contains 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
This file contains 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,25 @@ | ||
.. _cpp-security: | ||
|
||
================ | ||
Secure Your Data | ||
================ | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
.. facet:: | ||
:name: genre | ||
:values: reference | ||
|
||
.. meta:: | ||
:description: Learn how to use {+driver-short+} to secure your data. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 1 | ||
|
||
/security/authentication | ||
/security/enterprise-authentication |
Oops, something went wrong.
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.
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.
Remove extra
&
to prevent error:URI option "" contains no "=" sign: an invalid MongoDB URI was provided
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.
Good catch, thanks!