Skip to content

Commit cfd8f9f

Browse files
committed
Update some readmes, add an e2e task
1 parent 6eb6dd8 commit cfd8f9f

File tree

8 files changed

+36
-23
lines changed

8 files changed

+36
-23
lines changed

.github/workflows/cron-tasks.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ jobs:
1313
name: Update automatically generated files
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
# don't checkout a detatched HEAD
1919
ref: ${{ github.head_ref }}
2020

2121
# this is important so git log can pick up on
2222
# the whole history to generate the list of AUTHORS
23-
fetch-depth: '0'
23+
fetch-depth: "0"
2424

2525
- name: Set up Git
2626
run: |
2727
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
2828
git config --local user.name "github-actions[bot]"
2929
30-
- uses: actions/setup-node@v2
30+
- uses: actions/setup-node@v4
3131
with:
3232
node-version: ^16.x
33-
cache: 'npm'
33+
cache: "npm"
3434

3535
- name: Install npm@8
3636
run: |
@@ -50,41 +50,36 @@ jobs:
5050
run: |
5151
npm run update-authors
5252
git add AUTHORS \*/AUTHORS
53-
git commit --no-allow-empty -m "chore: update AUTHORS" || true
5453
5554
- name: Generate Error Documentation
5655
run: |
5756
npm run generate-error-overview
5857
mv error-overview.md error-overview.rst packages/errors/generated/
5958
npm run reformat
6059
git add packages/errors/generated
61-
git commit --no-allow-empty -m "chore: update error documentation" || true
6260
6361
- name: Regenerate Evergreen Config
6462
run: |
6563
npm run update-evergreen-config
6664
git add .evergreen.yml
67-
git commit --no-allow-empty -m "chore: update evergreen config" || true
6865
6966
- name: Update Security Test Summary
7067
run: |
7168
npm run update-security-test-summary
7269
git add docs/security-test-summary.md
73-
git commit --no-allow-empty -m "chore: update security test summary" || true
7470
7571
- name: Regenerate CLI usage text in README files
7672
run: |
7773
npm run update-cli-usage-text packages/*/*.md *.md
7874
git add packages/*/*.md *.md
79-
git commit --no-allow-empty -m "chore: update CLI usage text" || true
8075
8176
- name: Create pull request
8277
id: cpr
8378
uses: peter-evans/create-pull-request@v6
8479
with:
8580
commit-message: Update auto-generated files
8681
branch: ci/cron-tasks-update-files
87-
title: 'chore: update auto-generated files'
82+
title: "chore: update auto-generated files"
8883
body: |
8984
- Update auto-generated files
9085

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ variable. For detailed instructions for each of our supported platforms, please
9090
--oidcTrustedEndpoint Treat the cluster/database mongosh as a trusted endpoint
9191
--oidcIdTokenAsAccessToken Use ID tokens in place of access tokens for auth
9292
--oidcDumpTokens[=mode] Debug OIDC by printing tokens to mongosh's output [full|include-secrets]
93+
--oidcNoNonce Don't send a nonce argument in the OIDC auth request
9394

9495
DB Address Examples:
9596

packages/cli-repl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ of mongosh, visit https://www.mongodb.com/try/download/shell.
7575
--oidcTrustedEndpoint Treat the cluster/database mongosh as a trusted endpoint
7676
--oidcIdTokenAsAccessToken Use ID tokens in place of access tokens for auth
7777
--oidcDumpTokens[=mode] Debug OIDC by printing tokens to mongosh's output [full|include-secrets]
78+
--oidcNoNonce Don't send a nonce argument in the OIDC auth request
7879

7980
DB Address Examples:
8081

packages/cli-repl/src/arg-parser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const OPTIONS = {
6565
'norc',
6666
'oidcTrustedEndpoint',
6767
'oidcIdTokenAsAccessToken',
68+
'oidcNoNonce',
6869
'perfTests',
6970
'quiet',
7071
'retryWrites',

packages/cli-repl/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ export const USAGE = `
152152
--oidcDumpTokens[=mode] ${i18n.__(
153153
'cli-repl.args.oidcDumpTokens'
154154
)}
155+
--oidcNoNonce ${i18n.__(
156+
'cli-repl.args.oidcNoNonce'
157+
)}
155158
156159
${clr(i18n.__('cli-repl.args.dbAddressOptions'), 'mongosh:section-header')}
157160

packages/e2e-tests/test/e2e-oidc.spec.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,30 @@ describe('OIDC auth e2e', function () {
180180
);
181181
}
182182

183-
it('can successfully authenticate using OIDC Auth Code Flow', async function () {
184-
shell = this.startTestShell({
185-
args: [
186-
await testServer.connectionString(),
187-
'--authenticationMechanism=MONGODB-OIDC',
188-
'--oidcRedirectUri=http://localhost:0/',
189-
`--browser=${fetchBrowserFixture}`,
190-
],
183+
for (const useNonce of [true, false]) {
184+
describe(`with nonce=${useNonce}`, function () {
185+
it('can successfully authenticate using OIDC Auth Code Flow', async function () {
186+
const args = [
187+
await testServer.connectionString(),
188+
'--authenticationMechanism=MONGODB-OIDC',
189+
'--oidcRedirectUri=http://localhost:0/',
190+
`--browser=${fetchBrowserFixture}`,
191+
];
192+
193+
if (!useNonce) {
194+
args.push('--oidcNoNonce');
195+
}
196+
197+
shell = this.startTestShell({
198+
args,
199+
});
200+
await shell.waitForPrompt();
201+
202+
await verifyUser(shell, 'testuser', 'testServer-group');
203+
shell.assertNoErrors();
204+
});
191205
});
192-
await shell.waitForPrompt();
193-
194-
await verifyUser(shell, 'testuser', 'testServer-group');
195-
shell.assertNoErrors();
196-
});
206+
}
197207

198208
it('can successfully authenticate using OIDC Auth Code Flow when a username is specified', async function () {
199209
shell = this.startTestShell({

packages/i18n/src/locales/en_US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const translations: Catalog = {
9292
'Use ID tokens in place of access tokens for auth',
9393
oidcDumpTokens:
9494
"Debug OIDC by printing tokens to mongosh's output [full|include-secrets]",
95+
oidcNoNonce: "Don't send a nonce argument in the OIDC auth request",
9596
},
9697
'arg-parser': {
9798
'unknown-option': 'Error parsing command line: unrecognized option:',

packages/mongosh/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ of mongosh, visit https://www.mongodb.com/try/download/shell.
7979
--oidcTrustedEndpoint Treat the cluster/database mongosh as a trusted endpoint
8080
--oidcIdTokenAsAccessToken Use ID tokens in place of access tokens for auth
8181
--oidcDumpTokens[=mode] Debug OIDC by printing tokens to mongosh's output [full|include-secrets]
82+
--oidcNoNonce Don't send a nonce argument in the OIDC auth request
8283

8384
DB Address Examples:
8485

0 commit comments

Comments
 (0)