-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15214 from Automattic/8.10
8.10
- Loading branch information
Showing
52 changed files
with
1,984 additions
and
111 deletions.
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
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: Encryption Tests | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: [ 'master' ] | ||
workflow_dispatch: {} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
id-token: write | ||
|
||
jobs: | ||
run-tests: | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
id-token: write | ||
contents: write | ||
runs-on: ubuntu-latest | ||
name: Encryption tests | ||
env: | ||
FORCE_COLOR: true | ||
steps: | ||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- name: Setup node | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 22 | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: Install mongodb-client-encryption | ||
run: npm install mongodb-client-encryption | ||
- name: Setup Tests | ||
run: npm run setup-test-encryption | ||
- name: Run Tests | ||
run: npm run test-encryption |
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 |
---|---|---|
|
@@ -67,3 +67,6 @@ examples/ecommerce-netlify-functions/.netlify/state.json | |
|
||
notes.md | ||
list.out | ||
|
||
data | ||
*.pid |
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
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
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
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,24 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Handles creating `{ type: 'object' }` vs `{ bsonType: 'object' }` vs `{ bsonType: ['object', 'null'] }` | ||
* | ||
* @param {String} type | ||
* @param {String} bsonType | ||
* @param {Boolean} useBsonType | ||
* @param {Boolean} isRequired | ||
*/ | ||
|
||
module.exports = function createJSONSchemaTypeArray(type, bsonType, useBsonType, isRequired) { | ||
if (useBsonType) { | ||
if (isRequired) { | ||
return { bsonType }; | ||
} | ||
return { bsonType: [bsonType, 'null'] }; | ||
} else { | ||
if (isRequired) { | ||
return { type }; | ||
} | ||
return { type: [type, 'null'] }; | ||
} | ||
}; |
Oops, something went wrong.