├── csfle
├── python
│ ├── aws
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ ├── your_credentials.py
│ │ │ ├── make_data_key.py
│ │ │ └── insert_encrypted_document.py
│ ├── azure
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ ├── your_credentials.py
│ │ │ ├── make_data_key.py
│ │ │ └── insert_encrypted_document.py
│ ├── gcp
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ ├── your_credentials.py
│ │ │ ├── make_data_key.py
│ │ │ └── insert_encrypted_document.py
│ ├── kmip
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ ├── your_credentials.py
│ │ │ └── make_data_key.py
│ └── local
│ │ └── reader
│ │ ├── requirements.txt
│ │ ├── your_credentials.py
│ │ ├── make_data_key.py
│ │ └── insert_encrypted_document.py
├── go
│ ├── aws
│ │ └── reader
│ │ │ ├── main.go
│ │ │ ├── go.mod
│ │ │ ├── your-credentials.go
│ │ │ └── make-data-key.go
│ ├── azure
│ │ └── reader
│ │ │ ├── main.go
│ │ │ ├── go.mod
│ │ │ ├── your-credentials.go
│ │ │ └── make-data-key.go
│ ├── gcp
│ │ └── reader
│ │ │ ├── main.go
│ │ │ ├── go.mod
│ │ │ ├── your-credentials.go
│ │ │ └── make-data-key.go
│ ├── kmip
│ │ └── reader
│ │ │ ├── main.go
│ │ │ ├── go.mod
│ │ │ ├── your-credentials.go
│ │ │ └── make-data-key.go
│ └── local
│ │ └── reader
│ │ ├── main.go
│ │ ├── go.mod
│ │ ├── your-credentials.go
│ │ └── make-data-key.go
├── dotnet
│ ├── aws
│ │ └── reader
│ │ │ └── CSFLE
│ │ │ ├── Program.cs
│ │ │ ├── CSFLE.csproj
│ │ │ └── YourCredentials.cs
│ ├── gcp
│ │ └── reader
│ │ │ └── CSFLE
│ │ │ ├── Program.cs
│ │ │ ├── CSFLE.csproj
│ │ │ └── YourCredentials.cs
│ ├── kmip
│ │ └── reader
│ │ │ └── CSFLE
│ │ │ ├── Program.cs
│ │ │ ├── CSFLE.csproj
│ │ │ └── YourCredentials.cs
│ ├── azure
│ │ └── reader
│ │ │ └── CSFLE
│ │ │ ├── Program.cs
│ │ │ ├── CSFLE.csproj
│ │ │ └── YourCredentials.cs
│ └── local
│ │ └── reader
│ │ └── CSFLE
│ │ ├── Program.cs
│ │ ├── CSFLE.csproj
│ │ └── YourCredentials.cs
├── node
│ ├── aws
│ │ └── reader
│ │ │ ├── package.json
│ │ │ ├── your_credentials.js
│ │ │ ├── make_data_key.js
│ │ │ └── insert_encrypted_document.js
│ ├── azure
│ │ └── reader
│ │ │ ├── package.json
│ │ │ ├── your_credentials.js
│ │ │ └── make_data_key.js
│ ├── gcp
│ │ └── reader
│ │ │ ├── package.json
│ │ │ ├── your_credentials.js
│ │ │ ├── make_data_key.js
│ │ │ └── insert_encrypted_document.js
│ ├── kmip
│ │ └── reader
│ │ │ ├── package.json
│ │ │ ├── your_credentials.js
│ │ │ └── make_data_key.js
│ └── local
│ │ └── reader
│ │ ├── package.json
│ │ ├── your_credentials.js
│ │ └── make_data_key.js
└── java
│ ├── aws
│ └── reader
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mongodb
│ │ └── csfle
│ │ └── YourCredentials.java
│ ├── azure
│ └── reader
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mongodb
│ │ └── csfle
│ │ └── YourCredentials.java
│ ├── gcp
│ └── reader
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mongodb
│ │ └── csfle
│ │ └── YourCredentials.java
│ ├── kmip
│ └── reader
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mongodb
│ │ └── csfle
│ │ └── YourCredentials.java
│ └── local
│ └── reader
│ ├── pom.xml
│ └── src
│ └── main
│ └── java
│ └── com
│ └── mongodb
│ └── csfle
│ └── YourCredentials.java
├── queryable-encryption
├── python
│ ├── aws
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ └── your_credentials.py
│ ├── azure
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ └── your_credentials.py
│ ├── exp
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ ├── your_credentials.py
│ │ │ └── insert_encrypted_document.py
│ ├── gcp
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ └── your_credentials.py
│ ├── kmip
│ │ └── reader
│ │ │ ├── requirements.txt
│ │ │ └── your_credentials.py
│ └── local
│ │ └── reader
│ │ ├── requirements.txt
│ │ └── your_credentials.py
├── go
│ ├── aws
│ │ └── reader
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── your-credentials.go
│ ├── azure
│ │ └── reader
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── your-credentials.go
│ ├── exp
│ │ └── reader
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── your-credentials.go
│ ├── gcp
│ │ └── reader
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── your-credentials.go
│ ├── kmip
│ │ └── reader
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── your-credentials.go
│ └── local
│ │ └── reader
│ │ ├── go.mod
│ │ ├── main.go
│ │ └── your-credentials.go
├── node
│ ├── aws
│ │ └── reader
│ │ │ ├── package.json
│ │ │ └── your_credentials.js
│ ├── exp
│ │ └── reader
│ │ │ ├── package.json
│ │ │ ├── your_credentials.js
│ │ │ └── insert_encrypted_document.js
│ ├── gcp
│ │ └── reader
│ │ │ ├── package.json
│ │ │ └── your_credentials.js
│ ├── azure
│ │ └── reader
│ │ │ ├── package.json
│ │ │ └── your_credentials.js
│ ├── kmip
│ │ └── reader
│ │ │ ├── package.json
│ │ │ └── your_credentials.js
│ └── local
│ │ └── reader
│ │ ├── package.json
│ │ └── your_credentials.js
├── dotnet
│ ├── aws
│ │ └── reader
│ │ │ └── QueryableEncryption
│ │ │ ├── Program.cs
│ │ │ ├── QueryableEncryption.csproj
│ │ │ └── YourCredentials.cs
│ ├── azure
│ │ └── reader
│ │ │ └── QueryableEncryption
│ │ │ ├── Program.cs
│ │ │ ├── QueryableEncryption.csproj
│ │ │ └── YourCredentials.cs
│ ├── exp
│ │ └── reader
│ │ │ └── QueryableEncryption
│ │ │ ├── Program.cs
│ │ │ ├── QueryableEncryption.csproj
│ │ │ └── YourCredentials.cs
│ ├── gcp
│ │ └── reader
│ │ │ └── QueryableEncryption
│ │ │ ├── Program.cs
│ │ │ ├── QueryableEncryption.csproj
│ │ │ └── YourCredentials.cs
│ ├── kmip
│ │ └── reader
│ │ │ └── QueryableEncryption
│ │ │ ├── Program.cs
│ │ │ ├── QueryableEncryption.csproj
│ │ │ └── YourCredentials.cs
│ └── local
│ │ └── reader
│ │ └── QueryableEncryption
│ │ ├── Program.cs
│ │ ├── QueryableEncryption.csproj
│ │ └── YourCredentials.cs
├── java
│ ├── kmip
│ │ └── reader
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mongodb
│ │ │ └── qe
│ │ │ └── YourCredentials.java
│ ├── aws
│ │ └── reader
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mongodb
│ │ │ └── qe
│ │ │ └── YourCredentials.java
│ ├── gcp
│ │ └── reader
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mongodb
│ │ │ └── qe
│ │ │ └── YourCredentials.java
│ ├── azure
│ │ └── reader
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mongodb
│ │ │ └── qe
│ │ │ └── YourCredentials.java
│ ├── exp
│ │ └── reader
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── com
│ │ │ └── mongodb
│ │ │ └── qe
│ │ │ └── YourCredentials.java
│ └── local
│ │ └── reader
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── mongodb
│ │ └── qe
│ │ └── YourCredentials.java
└── mongosh
│ ├── local
│ └── reader
│ │ └── your_credentials.js
│ ├── aws
│ └── reader
│ │ └── your_credentials.js
│ ├── gcp
│ └── reader
│ │ └── your_credentials.js
│ ├── azure
│ └── reader
│ │ └── your_credentials.js
│ └── kmip
│ └── reader
│ └── your_credentials.js
└── README.md
/csfle/python/aws/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/csfle/python/azure/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/csfle/python/gcp/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/csfle/python/kmip/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/csfle/python/local/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/aws/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/azure/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/exp/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/gcp/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/kmip/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/python/local/reader/requirements.txt:
--------------------------------------------------------------------------------
1 | pymongo
2 | pymongocrypt
3 |
--------------------------------------------------------------------------------
/queryable-encryption/go/aws/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/go/azure/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/go/exp/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/go/gcp/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/go/kmip/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/go/local/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require go.mongodb.org/mongo-driver v1.10.3
6 |
--------------------------------------------------------------------------------
/queryable-encryption/node/aws/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/queryable-encryption/node/exp/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/queryable-encryption/node/gcp/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/queryable-encryption/node/azure/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/queryable-encryption/node/kmip/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/queryable-encryption/node/local/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "mongodb": "^4.9.0",
4 | "mongodb-client-encryption": "^2.2.0"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/csfle/go/aws/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/csfle/go/azure/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/csfle/go/gcp/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/csfle/go/kmip/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/csfle/go/local/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/aws/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/azure/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/exp/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/gcp/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/kmip/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/queryable-encryption/go/local/reader/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | )
6 |
7 | func main() {
8 | err := MakeKey()
9 | if err != nil {
10 | log.Fatal(err)
11 | }
12 | err = Insert()
13 | if err != nil {
14 | log.Fatal(err)
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/csfle/dotnet/aws/reader/CSFLE/Program.cs:
--------------------------------------------------------------------------------
1 | using Insert;
2 | using Key;
3 |
4 | namespace Run
5 | {
6 | class Run
7 | {
8 | static void Main(string[] args)
9 | {
10 | MakeDataKey.MakeKey();
11 | InsertEncryptedDocument.Insert();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/csfle/dotnet/gcp/reader/CSFLE/Program.cs:
--------------------------------------------------------------------------------
1 | using Insert;
2 | using Key;
3 |
4 | namespace Run
5 | {
6 | class Run
7 | {
8 | static void Main(string[] args)
9 | {
10 | MakeDataKey.MakeKey();
11 | InsertEncryptedDocument.Insert();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/csfle/dotnet/kmip/reader/CSFLE/Program.cs:
--------------------------------------------------------------------------------
1 | using Insert;
2 | using Key;
3 |
4 | namespace Run
5 | {
6 | class Run
7 | {
8 | static void Main(string[] args)
9 | {
10 | MakeDataKey.MakeKey();
11 | InsertEncryptedDocument.Insert();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/csfle/dotnet/azure/reader/CSFLE/Program.cs:
--------------------------------------------------------------------------------
1 | using Insert;
2 | using Key;
3 |
4 | namespace Run
5 | {
6 | class Run
7 | {
8 | static void Main(string[] args)
9 | {
10 | MakeDataKey.MakeKey();
11 | InsertEncryptedDocument.Insert();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/csfle/dotnet/local/reader/CSFLE/Program.cs:
--------------------------------------------------------------------------------
1 | using Insert;
2 | using Key;
3 |
4 | namespace Run
5 | {
6 | class Run
7 | {
8 | static void Main(string[] args)
9 | {
10 | MakeDataKey.MakeKey();
11 | InsertEncryptedDocument.Insert();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/aws/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/azure/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/exp/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/gcp/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/kmip/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/local/reader/QueryableEncryption/Program.cs:
--------------------------------------------------------------------------------
1 | namespace QueryableEncryption
2 | {
3 | internal static class Run
4 | {
5 | private static void Main(string[] args)
6 | {
7 | MakeDataKey.MakeKey();
8 | InsertEncryptedDocument.Insert();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/csfle/dotnet/aws/reader/CSFLE/CSFLE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/csfle/dotnet/gcp/reader/CSFLE/CSFLE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/csfle/dotnet/azure/reader/CSFLE/CSFLE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/csfle/dotnet/kmip/reader/CSFLE/CSFLE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/csfle/dotnet/local/reader/CSFLE/CSFLE.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/csfle/go/aws/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require (
6 | github.com/aws/aws-sdk-go v1.34.28 // indirect
7 | github.com/fatih/structs v1.1.0
8 | github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
9 | github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
10 | go.mongodb.org/mongo-driver v1.10.1
11 | )
12 |
--------------------------------------------------------------------------------
/csfle/go/azure/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require (
6 | github.com/aws/aws-sdk-go v1.34.28 // indirect
7 | github.com/fatih/structs v1.1.0
8 | github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
9 | github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
10 | go.mongodb.org/mongo-driver v1.10.1
11 | )
12 |
--------------------------------------------------------------------------------
/csfle/go/gcp/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require (
6 | github.com/aws/aws-sdk-go v1.34.28 // indirect
7 | github.com/fatih/structs v1.1.0
8 | github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
9 | github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
10 | go.mongodb.org/mongo-driver v1.10.1
11 | )
12 |
--------------------------------------------------------------------------------
/csfle/go/kmip/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require (
6 | github.com/aws/aws-sdk-go v1.34.28 // indirect
7 | github.com/fatih/structs v1.1.0
8 | github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
9 | github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
10 | go.mongodb.org/mongo-driver v1.10.1
11 | )
12 |
--------------------------------------------------------------------------------
/csfle/go/local/reader/go.mod:
--------------------------------------------------------------------------------
1 | module goCsfle
2 |
3 | go 1.15
4 |
5 | require (
6 | github.com/aws/aws-sdk-go v1.34.28 // indirect
7 | github.com/fatih/structs v1.1.0
8 | github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
9 | github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc // indirect
10 | go.mongodb.org/mongo-driver v1.10.1
11 | )
12 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/aws/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/exp/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/gcp/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/azure/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/kmip/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/local/reader/QueryableEncryption/QueryableEncryption.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netcoreapp6.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # In Use Encryption Sample Applications
2 |
3 | This repo contains sample applications that show how to use MongoDB's In-Use Encryption products: Queryable Encryption and Client-Side Field Level Encryption.
4 |
5 | This repository contains sample applications detailing how to use Queryable Encryption and Client-Side Field Level Encryption with all combinations of the following MongoDB Language Drivers and Key Management Service Providers:
6 |
7 | ## MongoDB Language Drivers:
8 |
9 | - Python
10 | - Java Sync
11 | - Node.js
12 | - Go
13 | - C#/Dotnet
14 |
15 | ## KMS Providers:
16 |
17 | - Amazon Web Services Key Management Service
18 | - Azure Key Vault
19 | - Google Cloud Key Management Service
20 | - Local Key Provider
21 |
22 | # About this Repo
23 |
24 | This repository is automatically generated. Please do not submit Pull Requests directly to this repository.
25 |
--------------------------------------------------------------------------------
/queryable-encryption/java/kmip/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | 1.0-SNAPSHOT
5 |
6 |
7 | 1.8
8 | 1.8
9 |
10 |
11 |
12 |
13 |
14 | org.mongodb
15 | mongodb-driver-sync
16 | 4.7.1
17 |
18 |
19 |
20 | org.mongodb
21 | mongodb-crypt
22 | 1.5.2
23 |
24 |
25 |
26 |
27 |
28 | ${project.artifactId}
29 |
30 |
31 |
--------------------------------------------------------------------------------
/csfle/node/aws/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "csfle",
3 | "version": "1.0.0",
4 | "description": "A sample implementation of field level encryption in MongoDB, meant to accompany the CSFLE guide at https://www.mongodb.com/docs/drivers/security/client-side-field-level-encryption-guide/",
5 | "main": "clients.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/mongodb-university/csfle-guides.git"
12 | },
13 | "author": "Developer Education Team",
14 | "license": "Apache-2.0",
15 | "bugs": {
16 | "url": "https://github.com/mongodb-university/csfle-guides/issues"
17 | },
18 | "homepage": "https://github.com/mongodb-university/csfle-guides#readme",
19 | "dependencies": {
20 | "dotenv": "^8.2.0",
21 | "mongodb": "^6.0.0",
22 | "mongodb-client-encryption": "^6.0.0"
23 | },
24 | "prettier": {
25 | "semi": true
26 | },
27 | "devDependencies": {
28 | "eslint": "^7.15.0",
29 | "prettier": "^2.2.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/csfle/node/azure/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "csfle",
3 | "version": "1.0.0",
4 | "description": "A sample implementation of field level encryption in MongoDB, meant to accompany the CSFLE guide at https://www.mongodb.com/docs/drivers/security/client-side-field-level-encryption-guide/",
5 | "main": "clients.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/mongodb-university/csfle-guides.git"
12 | },
13 | "author": "Developer Education Team",
14 | "license": "Apache-2.0",
15 | "bugs": {
16 | "url": "https://github.com/mongodb-university/csfle-guides/issues"
17 | },
18 | "homepage": "https://github.com/mongodb-university/csfle-guides#readme",
19 | "dependencies": {
20 | "dotenv": "^8.2.0",
21 | "mongodb": "^6.0.0",
22 | "mongodb-client-encryption": "^6.0.0"
23 | },
24 | "prettier": {
25 | "semi": true
26 | },
27 | "devDependencies": {
28 | "eslint": "^7.15.0",
29 | "prettier": "^2.2.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/csfle/node/gcp/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "csfle",
3 | "version": "1.0.0",
4 | "description": "A sample implementation of field level encryption in MongoDB, meant to accompany the CSFLE guide at https://www.mongodb.com/docs/drivers/security/client-side-field-level-encryption-guide/",
5 | "main": "clients.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/mongodb-university/csfle-guides.git"
12 | },
13 | "author": "Developer Education Team",
14 | "license": "Apache-2.0",
15 | "bugs": {
16 | "url": "https://github.com/mongodb-university/csfle-guides/issues"
17 | },
18 | "homepage": "https://github.com/mongodb-university/csfle-guides#readme",
19 | "dependencies": {
20 | "dotenv": "^8.2.0",
21 | "mongodb": "^6.0.0",
22 | "mongodb-client-encryption": "^6.0.0"
23 | },
24 | "prettier": {
25 | "semi": true
26 | },
27 | "devDependencies": {
28 | "eslint": "^7.15.0",
29 | "prettier": "^2.2.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/csfle/node/kmip/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "csfle",
3 | "version": "1.0.0",
4 | "description": "A sample implementation of field level encryption in MongoDB, meant to accompany the CSFLE guide at https://www.mongodb.com/docs/drivers/security/client-side-field-level-encryption-guide/",
5 | "main": "clients.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/mongodb-university/csfle-guides.git"
12 | },
13 | "author": "Developer Education Team",
14 | "license": "Apache-2.0",
15 | "bugs": {
16 | "url": "https://github.com/mongodb-university/csfle-guides/issues"
17 | },
18 | "homepage": "https://github.com/mongodb-university/csfle-guides#readme",
19 | "dependencies": {
20 | "dotenv": "^8.2.0",
21 | "mongodb": "^6.0.0",
22 | "mongodb-client-encryption": "^6.0.0"
23 | },
24 | "prettier": {
25 | "semi": true
26 | },
27 | "devDependencies": {
28 | "eslint": "^7.15.0",
29 | "prettier": "^2.2.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/csfle/node/local/reader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "csfle",
3 | "version": "1.0.0",
4 | "description": "A sample implementation of field level encryption in MongoDB, meant to accompany the CSFLE guide at https://www.mongodb.com/docs/drivers/security/client-side-field-level-encryption-guide/",
5 | "main": "clients.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/mongodb-university/csfle-guides.git"
12 | },
13 | "author": "Developer Education Team",
14 | "license": "Apache-2.0",
15 | "bugs": {
16 | "url": "https://github.com/mongodb-university/csfle-guides/issues"
17 | },
18 | "homepage": "https://github.com/mongodb-university/csfle-guides#readme",
19 | "dependencies": {
20 | "dotenv": "^8.2.0",
21 | "mongodb": "^6.0.0",
22 | "mongodb-client-encryption": "^6.0.0"
23 | },
24 | "prettier": {
25 | "semi": true
26 | },
27 | "devDependencies": {
28 | "eslint": "^7.15.0",
29 | "prettier": "^2.2.1"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/csfle/java/aws/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-CSFLE-guide
4 | Java-CSFLE-guide-AWS
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.4.0
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/csfle/java/azure/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-CSFLE-guide
4 | Java-CSFLE-guide-Azure
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.4.0
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/csfle/java/gcp/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-CSFLE-guide
4 | Java-CSFLE-guide-GCP
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.4.0
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/csfle/java/kmip/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-CSFLE-guide
4 | Java-CSFLE-guide-KMIP
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.4.0
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/csfle/java/local/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-CSFLE-guide
4 | Java-CSFLE-guide-Local
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.4.0
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/java/aws/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | Java-QE-guide-AWS
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.7.1
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/java/gcp/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | Java-QE-guide-GCP
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.7.1
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/java/azure/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | Java-QE-guide-Azure
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.7.1
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/java/exp/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | Java-QE-guide-Explicit
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.7.1
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/java/local/reader/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 | Java-QE-guide
4 | Java-QE-guide-Local
5 | 1.0-SNAPSHOT
6 |
7 |
8 | 1.8
9 | 1.8
10 |
11 |
12 |
13 |
14 |
15 | org.mongodb
16 | mongodb-driver-sync
17 | 4.7.1
18 |
19 |
20 |
21 | org.mongodb
22 | mongodb-crypt
23 | 1.5.2
24 |
25 |
26 |
27 |
28 |
29 | ${project.artifactId}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/queryable-encryption/go/exp/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | }
15 |
16 | // check if credentials object contains placeholder values
17 | func check_for_placeholders() {
18 | var error_buffer []string
19 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
20 | for key, value := range credentials {
21 | // check for placeholder text
22 | if placeholder_pattern.MatchString(string(value)) {
23 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
24 | error_buffer = append(error_buffer, error_message)
25 | }
26 | }
27 | // raise an error if errors in buffer
28 | if len(error_buffer) > 0 {
29 | message := strings.Join(error_buffer[:], "\n")
30 | log.Fatal(message)
31 | }
32 | }
33 |
34 | // return credentials object and ensure it has been populated
35 | func GetCredentials() map[string]string {
36 | check_for_placeholders()
37 | return credentials
38 | }
39 |
--------------------------------------------------------------------------------
/queryable-encryption/go/local/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | }
15 |
16 | // check if credentials object contains placeholder values
17 | func check_for_placeholders() {
18 | var error_buffer []string
19 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
20 | for key, value := range credentials {
21 | // check for placeholder text
22 | if placeholder_pattern.MatchString(string(value)) {
23 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
24 | error_buffer = append(error_buffer, error_message)
25 | }
26 | }
27 | // raise an error if errors in buffer
28 | if len(error_buffer) > 0 {
29 | message := strings.Join(error_buffer[:], "\n")
30 | log.Fatal(message)
31 | }
32 | }
33 |
34 | // return credentials object and ensure it has been populated
35 | func GetCredentials() map[string]string {
36 | check_for_placeholders()
37 | return credentials
38 | }
39 |
--------------------------------------------------------------------------------
/csfle/go/local/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | }
15 |
16 | // check if credentials object contains placeholder values
17 | func check_for_placeholders() {
18 | var error_buffer []string
19 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
20 | for key, value := range credentials {
21 | // check for placeholder text
22 | if placeholder_pattern.MatchString(string(value)) {
23 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
24 | error_buffer = append(error_buffer, error_message)
25 | }
26 | }
27 | // raise an error if errors in buffer
28 | if len(error_buffer) > 0 {
29 | message := strings.Join(error_buffer[:], "\n")
30 | log.Fatal(message)
31 | }
32 | }
33 |
34 | // return credentials object and ensure it has been populated
35 | func GetCredentials() map[string]string {
36 | check_for_placeholders()
37 | return credentials
38 | }
39 |
--------------------------------------------------------------------------------
/queryable-encryption/mongosh/local/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | };
13 |
14 | /*
15 | check if credentials object contains placeholder values
16 | **/
17 | function checkForPlaceholders() {
18 | const errorBuffer = Array();
19 | const placeholderPattern = /^<.*>$/;
20 | for (const [key, value] of Object.entries(credentials)) {
21 | // check for placeholder text
22 | if (`${value}`.match(placeholderPattern)) {
23 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
24 | errorBuffer.push(errorMessage);
25 | }
26 | // check if value is empty
27 | else if (value == undefined) {
28 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
29 | }
30 | }
31 | // raise an error if errors in buffer
32 | if (errorBuffer.length > 0) {
33 | message = errorBuffer.join("\n");
34 | throw message;
35 | }
36 | }
37 |
38 | module.exports = { getCredentials };
39 |
--------------------------------------------------------------------------------
/queryable-encryption/node/exp/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 | };
14 |
15 | /*
16 | check if credentials object contains placeholder values
17 | **/
18 | function checkForPlaceholders() {
19 | const errorBuffer = Array();
20 | const placeholderPattern = /^<.*>$/;
21 | for (const [key, value] of Object.entries(credentials)) {
22 | // check for placeholder text
23 | if (`${value}`.match(placeholderPattern)) {
24 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
25 | errorBuffer.push(errorMessage);
26 | }
27 | // check if value is empty
28 | else if (value == undefined) {
29 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if (errorBuffer.length > 0) {
34 | message = errorBuffer.join("\n");
35 | throw message;
36 | }
37 | }
38 |
39 | module.exports = { getCredentials };
40 |
--------------------------------------------------------------------------------
/queryable-encryption/node/local/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 | };
14 |
15 | /*
16 | check if credentials object contains placeholder values
17 | **/
18 | function checkForPlaceholders() {
19 | const errorBuffer = Array();
20 | const placeholderPattern = /^<.*>$/;
21 | for (const [key, value] of Object.entries(credentials)) {
22 | // check for placeholder text
23 | if (`${value}`.match(placeholderPattern)) {
24 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
25 | errorBuffer.push(errorMessage);
26 | }
27 | // check if value is empty
28 | else if (value == undefined) {
29 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if (errorBuffer.length > 0) {
34 | message = errorBuffer.join("\n");
35 | throw message;
36 | }
37 | }
38 |
39 | module.exports = { getCredentials };
40 |
--------------------------------------------------------------------------------
/queryable-encryption/python/exp/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | }
8 |
9 |
10 | def check_for_placeholders():
11 | """check if credentials object contains placeholder values"""
12 | error_buffer = []
13 | placeholder_pattern = re.compile("^<.*>$")
14 | for key, value in _credentials.items():
15 | # check for placeholder text
16 | if placeholder_pattern.match(str(value)):
17 | error_message = (
18 | f"You must fill out the {key} field of your credentials object."
19 | )
20 | error_buffer.append(error_message)
21 | # check if value is empty
22 | elif not value:
23 | error_message = (
24 | f"The value for {key} is empty. Please enter something for this value."
25 | )
26 | # raise an error if errors in buffer
27 | if error_buffer:
28 | message = "\n".join(error_buffer)
29 | raise ValueError(message)
30 |
31 |
32 | def get_credentials():
33 | """return credentials object and ensure it has been populated"""
34 | check_for_placeholders()
35 | return _credentials
36 |
--------------------------------------------------------------------------------
/queryable-encryption/python/local/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | }
8 |
9 |
10 | def check_for_placeholders():
11 | """check if credentials object contains placeholder values"""
12 | error_buffer = []
13 | placeholder_pattern = re.compile("^<.*>$")
14 | for key, value in _credentials.items():
15 | # check for placeholder text
16 | if placeholder_pattern.match(str(value)):
17 | error_message = (
18 | f"You must fill out the {key} field of your credentials object."
19 | )
20 | error_buffer.append(error_message)
21 | # check if value is empty
22 | elif not value:
23 | error_message = (
24 | f"The value for {key} is empty. Please enter something for this value."
25 | )
26 | # raise an error if errors in buffer
27 | if error_buffer:
28 | message = "\n".join(error_buffer)
29 | raise ValueError(message)
30 |
31 |
32 | def get_credentials():
33 | """return credentials object and ensure it has been populated"""
34 | check_for_placeholders()
35 | return _credentials
36 |
--------------------------------------------------------------------------------
/csfle/node/local/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH:
13 | "",
14 | };
15 |
16 | /*
17 | check if credentials object contains placeholder values
18 | **/
19 | function checkForPlaceholders() {
20 | const errorBuffer = Array();
21 | const placeholderPattern = /^<.*>$/;
22 | for (const [key, value] of Object.entries(credentials)) {
23 | // check for placeholder text
24 | if (`${value}`.match(placeholderPattern)) {
25 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
26 | errorBuffer.push(errorMessage);
27 | }
28 | // check if value is empty
29 | else if (value == undefined) {
30 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
31 | }
32 | }
33 | // raise an error if errors in buffer
34 | if (errorBuffer.length > 0) {
35 | message = errorBuffer.join("\n");
36 | throw message;
37 | }
38 | }
39 |
40 | module.exports = { getCredentials };
41 |
--------------------------------------------------------------------------------
/csfle/python/local/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | }
8 |
9 |
10 | def check_for_placeholders():
11 | """check if credentials object contains placeholder values"""
12 | error_buffer = []
13 | placeholder_pattern = re.compile("^<.*>$")
14 | for key, value in _credentials.items():
15 | # check for placeholder text
16 | if placeholder_pattern.match(str(value)):
17 | error_message = (
18 | f"You must fill out the {key} field of your credentials object."
19 | )
20 | error_buffer.append(error_message)
21 | # check if value is empty
22 | elif not value:
23 | error_message = (
24 | f"The value for {key} is empty. Please enter something for this value."
25 | )
26 | # raise an error if errors in buffer
27 | if error_buffer:
28 | message = "\n".join(error_buffer)
29 | raise ValueError(message)
30 |
31 |
32 | def get_credentials():
33 | """return credentials object and ensure it has been populated"""
34 | check_for_placeholders()
35 | return _credentials
36 |
--------------------------------------------------------------------------------
/queryable-encryption/go/aws/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // AWS Credentials
15 | "AWS_ACCESS_KEY_ID": "",
16 | "AWS_SECRET_ACCESS_KEY": "",
17 | "AWS_KEY_REGION": "",
18 | "AWS_KEY_ARN": "",
19 | }
20 |
21 | // check if credentials object contains placeholder values
22 | func check_for_placeholders() {
23 | var error_buffer []string
24 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
25 | for key, value := range credentials {
26 | // check for placeholder text
27 | if placeholder_pattern.MatchString(string(value)) {
28 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
29 | error_buffer = append(error_buffer, error_message)
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if len(error_buffer) > 0 {
34 | message := strings.Join(error_buffer[:], "\n")
35 | log.Fatal(message)
36 | }
37 | }
38 |
39 | // return credentials object and ensure it has been populated
40 | func GetCredentials() map[string]string {
41 | check_for_placeholders()
42 | return credentials
43 | }
44 |
--------------------------------------------------------------------------------
/csfle/go/aws/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // AWS Credentials
15 | "AWS_ACCESS_KEY_ID": "",
16 | "AWS_SECRET_ACCESS_KEY": "",
17 | "AWS_KEY_REGION": "",
18 | "AWS_KEY_ARN": "",
19 | }
20 |
21 | // check if credentials object contains placeholder values
22 | func check_for_placeholders() {
23 | var error_buffer []string
24 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
25 | for key, value := range credentials {
26 | // check for placeholder text
27 | if placeholder_pattern.MatchString(string(value)) {
28 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
29 | error_buffer = append(error_buffer, error_message)
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if len(error_buffer) > 0 {
34 | message := strings.Join(error_buffer[:], "\n")
35 | log.Fatal(message)
36 | }
37 | }
38 |
39 | // return credentials object and ensure it has been populated
40 | func GetCredentials() map[string]string {
41 | check_for_placeholders()
42 | return credentials
43 | }
44 |
--------------------------------------------------------------------------------
/queryable-encryption/mongosh/aws/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 |
13 | // AWS Credentials
14 | AWS_ACCESS_KEY_ID: "",
15 | AWS_SECRET_ACCESS_KEY: "",
16 | AWS_KEY_REGION: "",
17 | AWS_KEY_ARN: "",
18 | };
19 |
20 | /*
21 | check if credentials object contains placeholder values
22 | **/
23 | function checkForPlaceholders() {
24 | const errorBuffer = Array();
25 | const placeholderPattern = /^<.*>$/;
26 | for (const [key, value] of Object.entries(credentials)) {
27 | // check for placeholder text
28 | if (`${value}`.match(placeholderPattern)) {
29 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
30 | errorBuffer.push(errorMessage);
31 | }
32 | // check if value is empty
33 | else if (value == undefined) {
34 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
35 | }
36 | }
37 | // raise an error if errors in buffer
38 | if (errorBuffer.length > 0) {
39 | message = errorBuffer.join("\n");
40 | throw message;
41 | }
42 | }
43 |
44 | module.exports = { getCredentials };
45 |
--------------------------------------------------------------------------------
/queryable-encryption/go/gcp/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // GCP Credentials
15 | "GCP_EMAIL": "",
16 | "GCP_PRIVATE_KEY": "",
17 | "GCP_PROJECT_ID": "",
18 | "GCP_LOCATION": "",
19 | "GCP_KEY_RING": "",
20 | "GCP_KEY_NAME": "",
21 | "GCP_KEY_VERSION": "",
22 | }
23 |
24 | // check if credentials object contains placeholder values
25 | func check_for_placeholders() {
26 | var error_buffer []string
27 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
28 | for key, value := range credentials {
29 | // check for placeholder text
30 | if placeholder_pattern.MatchString(string(value)) {
31 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
32 | error_buffer = append(error_buffer, error_message)
33 | }
34 | }
35 | // raise an error if errors in buffer
36 | if len(error_buffer) > 0 {
37 | message := strings.Join(error_buffer[:], "\n")
38 | log.Fatal(message)
39 | }
40 | }
41 |
42 | // return credentials object and ensure it has been populated
43 | func GetCredentials() map[string]string {
44 | check_for_placeholders()
45 | return credentials
46 | }
47 |
--------------------------------------------------------------------------------
/queryable-encryption/node/aws/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 |
14 | // AWS Credentials
15 | AWS_ACCESS_KEY_ID: "",
16 | AWS_SECRET_ACCESS_KEY: "",
17 | AWS_KEY_REGION: "",
18 | AWS_KEY_ARN: "",
19 | };
20 |
21 | /*
22 | check if credentials object contains placeholder values
23 | **/
24 | function checkForPlaceholders() {
25 | const errorBuffer = Array();
26 | const placeholderPattern = /^<.*>$/;
27 | for (const [key, value] of Object.entries(credentials)) {
28 | // check for placeholder text
29 | if (`${value}`.match(placeholderPattern)) {
30 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
31 | errorBuffer.push(errorMessage);
32 | }
33 | // check if value is empty
34 | else if (value == undefined) {
35 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
36 | }
37 | }
38 | // raise an error if errors in buffer
39 | if (errorBuffer.length > 0) {
40 | message = errorBuffer.join("\n");
41 | throw message;
42 | }
43 | }
44 |
45 | module.exports = { getCredentials };
46 |
--------------------------------------------------------------------------------
/csfle/go/gcp/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // GCP Credentials
15 | "GCP_EMAIL": "",
16 | "GCP_PRIVATE_KEY": "",
17 | "GCP_PROJECT_ID": "",
18 | "GCP_LOCATION": "",
19 | "GCP_KEY_RING": "",
20 | "GCP_KEY_NAME": "",
21 | "GCP_KEY_VERSION": "",
22 | }
23 |
24 | // check if credentials object contains placeholder values
25 | func check_for_placeholders() {
26 | var error_buffer []string
27 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
28 | for key, value := range credentials {
29 | // check for placeholder text
30 | if placeholder_pattern.MatchString(string(value)) {
31 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
32 | error_buffer = append(error_buffer, error_message)
33 | }
34 | }
35 | // raise an error if errors in buffer
36 | if len(error_buffer) > 0 {
37 | message := strings.Join(error_buffer[:], "\n")
38 | log.Fatal(message)
39 | }
40 | }
41 |
42 | // return credentials object and ensure it has been populated
43 | func GetCredentials() map[string]string {
44 | check_for_placeholders()
45 | return credentials
46 | }
47 |
--------------------------------------------------------------------------------
/csfle/node/aws/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH:
13 | "",
14 |
15 | // AWS Credentials
16 | AWS_ACCESS_KEY_ID: "",
17 | AWS_SECRET_ACCESS_KEY: "",
18 | AWS_KEY_REGION: "",
19 | AWS_KEY_ARN: "",
20 | };
21 |
22 | /*
23 | check if credentials object contains placeholder values
24 | **/
25 | function checkForPlaceholders() {
26 | const errorBuffer = Array();
27 | const placeholderPattern = /^<.*>$/;
28 | for (const [key, value] of Object.entries(credentials)) {
29 | // check for placeholder text
30 | if (`${value}`.match(placeholderPattern)) {
31 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
32 | errorBuffer.push(errorMessage);
33 | }
34 | // check if value is empty
35 | else if (value == undefined) {
36 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
37 | }
38 | }
39 | // raise an error if errors in buffer
40 | if (errorBuffer.length > 0) {
41 | message = errorBuffer.join("\n");
42 | throw message;
43 | }
44 | }
45 |
46 | module.exports = { getCredentials };
47 |
--------------------------------------------------------------------------------
/queryable-encryption/python/aws/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # AWS Credentials
8 | "AWS_ACCESS_KEY_ID": "",
9 | "AWS_SECRET_ACCESS_KEY": "",
10 | "AWS_KEY_REGION": "",
11 | "AWS_KEY_ARN": "",
12 | }
13 |
14 |
15 | def check_for_placeholders():
16 | """check if credentials object contains placeholder values"""
17 | error_buffer = []
18 | placeholder_pattern = re.compile("^<.*>$")
19 | for key, value in _credentials.items():
20 | # check for placeholder text
21 | if placeholder_pattern.match(str(value)):
22 | error_message = (
23 | f"You must fill out the {key} field of your credentials object."
24 | )
25 | error_buffer.append(error_message)
26 | # check if value is empty
27 | elif not value:
28 | error_message = (
29 | f"The value for {key} is empty. Please enter something for this value."
30 | )
31 | # raise an error if errors in buffer
32 | if error_buffer:
33 | message = "\n".join(error_buffer)
34 | raise ValueError(message)
35 |
36 |
37 | def get_credentials():
38 | """return credentials object and ensure it has been populated"""
39 | check_for_placeholders()
40 | return _credentials
41 |
--------------------------------------------------------------------------------
/queryable-encryption/mongosh/gcp/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 |
13 | // GCP Credentials
14 | GCP_EMAIL: "",
15 | GCP_PRIVATE_KEY: "",
16 | GCP_PROJECT_ID: "",
17 | GCP_LOCATION: "",
18 | GCP_KEY_RING: "",
19 | GCP_KEY_NAME: "",
20 | GCP_KEY_VERSION: "",
21 | };
22 |
23 | /*
24 | check if credentials object contains placeholder values
25 | **/
26 | function checkForPlaceholders() {
27 | const errorBuffer = Array();
28 | const placeholderPattern = /^<.*>$/;
29 | for (const [key, value] of Object.entries(credentials)) {
30 | // check for placeholder text
31 | if (`${value}`.match(placeholderPattern)) {
32 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
33 | errorBuffer.push(errorMessage);
34 | }
35 | // check if value is empty
36 | else if (value == undefined) {
37 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
38 | }
39 | }
40 | // raise an error if errors in buffer
41 | if (errorBuffer.length > 0) {
42 | message = errorBuffer.join("\n");
43 | throw message;
44 | }
45 | }
46 |
47 | module.exports = { getCredentials };
48 |
--------------------------------------------------------------------------------
/csfle/python/aws/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # AWS Credentials
8 | "AWS_ACCESS_KEY_ID": "",
9 | "AWS_SECRET_ACCESS_KEY": "",
10 | "AWS_KEY_REGION": "",
11 | "AWS_KEY_ARN": "",
12 | }
13 |
14 |
15 | def check_for_placeholders():
16 | """check if credentials object contains placeholder values"""
17 | error_buffer = []
18 | placeholder_pattern = re.compile("^<.*>$")
19 | for key, value in _credentials.items():
20 | # check for placeholder text
21 | if placeholder_pattern.match(str(value)):
22 | error_message = (
23 | f"You must fill out the {key} field of your credentials object."
24 | )
25 | error_buffer.append(error_message)
26 | # check if value is empty
27 | elif not value:
28 | error_message = (
29 | f"The value for {key} is empty. Please enter something for this value."
30 | )
31 | # raise an error if errors in buffer
32 | if error_buffer:
33 | message = "\n".join(error_buffer)
34 | raise ValueError(message)
35 |
36 |
37 | def get_credentials():
38 | """return credentials object and ensure it has been populated"""
39 | check_for_placeholders()
40 | return _credentials
41 |
--------------------------------------------------------------------------------
/csfle/dotnet/local/reader/CSFLE/YourCredentials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Credentials
6 | {
7 | class YourCredentials
8 | {
9 |
10 | private Dictionary credentials = new Dictionary()
11 | {
12 | // Mongo Paths + URI
13 | {"MONGODB_URI", ""},
14 | {"SHARED_LIB_PATH", ""},
15 |
16 |
17 | };
18 |
19 | private void CheckThatValuesAreSet()
20 | {
21 | var placeholder = new Regex("^<.*>$");
22 | var errorBuffer = new List();
23 | foreach (KeyValuePair entry in credentials)
24 | {
25 | if (entry.Value != null && placeholder.IsMatch(Convert.ToString(entry.Value)))
26 | {
27 | var message = String.Format("You must fill out the {0} field of your credentials object.", entry.Key);
28 | errorBuffer.Add(message);
29 | }
30 | }
31 | if (errorBuffer.Count > 0)
32 | {
33 | var message = String.Join("\n", errorBuffer);
34 | throw new Exception(message);
35 | }
36 | }
37 |
38 | public Dictionary GetCredentials()
39 | {
40 | CheckThatValuesAreSet();
41 | return credentials;
42 | }
43 |
44 | }
45 | }
--------------------------------------------------------------------------------
/queryable-encryption/go/azure/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // Azure Credentials
15 | "AZURE_TENANT_ID": "",
16 | "AZURE_CLIENT_ID": "",
17 | "AZURE_CLIENT_SECRET": "",
18 | "AZURE_KEY_NAME": "",
19 | "AZURE_KEY_VERSION": "",
20 | "AZURE_KEY_VAULT_ENDPOINT": "",
21 | }
22 |
23 | // check if credentials object contains placeholder values
24 | func check_for_placeholders() {
25 | var error_buffer []string
26 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
27 | for key, value := range credentials {
28 | // check for placeholder text
29 | if placeholder_pattern.MatchString(string(value)) {
30 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
31 | error_buffer = append(error_buffer, error_message)
32 | }
33 | }
34 | // raise an error if errors in buffer
35 | if len(error_buffer) > 0 {
36 | message := strings.Join(error_buffer[:], "\n")
37 | log.Fatal(message)
38 | }
39 | }
40 |
41 | // return credentials object and ensure it has been populated
42 | func GetCredentials() map[string]string {
43 | check_for_placeholders()
44 | return credentials
45 | }
46 |
--------------------------------------------------------------------------------
/queryable-encryption/mongosh/azure/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 |
13 | // Azure Credentials
14 | AZURE_TENANT_ID: "",
15 | AZURE_CLIENT_ID: "",
16 | AZURE_CLIENT_SECRET: "",
17 | AZURE_KEY_NAME: "",
18 | AZURE_KEY_VERSION: "",
19 | AZURE_KEY_VAULT_ENDPOINT: "",
20 | };
21 |
22 | /*
23 | check if credentials object contains placeholder values
24 | **/
25 | function checkForPlaceholders() {
26 | const errorBuffer = Array();
27 | const placeholderPattern = /^<.*>$/;
28 | for (const [key, value] of Object.entries(credentials)) {
29 | // check for placeholder text
30 | if (`${value}`.match(placeholderPattern)) {
31 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
32 | errorBuffer.push(errorMessage);
33 | }
34 | // check if value is empty
35 | else if (value == undefined) {
36 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
37 | }
38 | }
39 | // raise an error if errors in buffer
40 | if (errorBuffer.length > 0) {
41 | message = errorBuffer.join("\n");
42 | throw message;
43 | }
44 | }
45 |
46 | module.exports = { getCredentials };
47 |
--------------------------------------------------------------------------------
/csfle/go/azure/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // Azure Credentials
15 | "AZURE_TENANT_ID": "",
16 | "AZURE_CLIENT_ID": "",
17 | "AZURE_CLIENT_SECRET": "",
18 | "AZURE_KEY_NAME": "",
19 | "AZURE_KEY_VERSION": "",
20 | "AZURE_KEY_VAULT_ENDPOINT": "",
21 | }
22 |
23 | // check if credentials object contains placeholder values
24 | func check_for_placeholders() {
25 | var error_buffer []string
26 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
27 | for key, value := range credentials {
28 | // check for placeholder text
29 | if placeholder_pattern.MatchString(string(value)) {
30 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
31 | error_buffer = append(error_buffer, error_message)
32 | }
33 | }
34 | // raise an error if errors in buffer
35 | if len(error_buffer) > 0 {
36 | message := strings.Join(error_buffer[:], "\n")
37 | log.Fatal(message)
38 | }
39 | }
40 |
41 | // return credentials object and ensure it has been populated
42 | func GetCredentials() map[string]string {
43 | check_for_placeholders()
44 | return credentials
45 | }
46 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/exp/reader/QueryableEncryption/YourCredentials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Credentials
6 | {
7 | class YourCredentials
8 | {
9 |
10 | private Dictionary credentials = new Dictionary()
11 | {
12 | // Mongo Paths + URI
13 | {"MONGODB_URI", ""},
14 | {"SHARED_LIB_PATH", ""},
15 |
16 |
17 | };
18 |
19 | private void CheckThatValuesAreSet()
20 | {
21 | var placeholder = new Regex("^<.*>$");
22 | var errorBuffer = new List();
23 | foreach (KeyValuePair entry in credentials)
24 | {
25 | if (entry.Value != null && placeholder.IsMatch(Convert.ToString(entry.Value)))
26 | {
27 | var message = String.Format("You must fill out the {0} field of your credentials object.", entry.Key);
28 | errorBuffer.Add(message);
29 | }
30 | }
31 | if (errorBuffer.Count > 0)
32 | {
33 | var message = String.Join("\n", errorBuffer);
34 | throw new Exception(message);
35 | }
36 | }
37 |
38 | public Dictionary GetCredentials()
39 | {
40 | CheckThatValuesAreSet();
41 | return credentials;
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/local/reader/QueryableEncryption/YourCredentials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Credentials
6 | {
7 | class YourCredentials
8 | {
9 |
10 | private Dictionary credentials = new Dictionary()
11 | {
12 | // Mongo Paths + URI
13 | {"MONGODB_URI", ""},
14 | {"SHARED_LIB_PATH", ""},
15 |
16 |
17 | };
18 |
19 | private void CheckThatValuesAreSet()
20 | {
21 | var placeholder = new Regex("^<.*>$");
22 | var errorBuffer = new List();
23 | foreach (KeyValuePair entry in credentials)
24 | {
25 | if (entry.Value != null && placeholder.IsMatch(Convert.ToString(entry.Value)))
26 | {
27 | var message = String.Format("You must fill out the {0} field of your credentials object.", entry.Key);
28 | errorBuffer.Add(message);
29 | }
30 | }
31 | if (errorBuffer.Count > 0)
32 | {
33 | var message = String.Join("\n", errorBuffer);
34 | throw new Exception(message);
35 | }
36 | }
37 |
38 | public Dictionary GetCredentials()
39 | {
40 | CheckThatValuesAreSet();
41 | return credentials;
42 | }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/queryable-encryption/node/gcp/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 |
14 | // GCP Credentials
15 | GCP_EMAIL: "",
16 | GCP_PRIVATE_KEY: "",
17 | GCP_PROJECT_ID: "",
18 | GCP_LOCATION: "",
19 | GCP_KEY_RING: "",
20 | GCP_KEY_NAME: "",
21 | GCP_KEY_VERSION: "",
22 | };
23 |
24 | /*
25 | check if credentials object contains placeholder values
26 | **/
27 | function checkForPlaceholders() {
28 | const errorBuffer = Array();
29 | const placeholderPattern = /^<.*>$/;
30 | for (const [key, value] of Object.entries(credentials)) {
31 | // check for placeholder text
32 | if (`${value}`.match(placeholderPattern)) {
33 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
34 | errorBuffer.push(errorMessage);
35 | }
36 | // check if value is empty
37 | else if (value == undefined) {
38 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
39 | }
40 | }
41 | // raise an error if errors in buffer
42 | if (errorBuffer.length > 0) {
43 | message = errorBuffer.join("\n");
44 | throw message;
45 | }
46 | }
47 |
48 | module.exports = { getCredentials };
49 |
--------------------------------------------------------------------------------
/csfle/node/gcp/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH:
13 | "",
14 |
15 | // GCP Credentials
16 | GCP_EMAIL: "",
17 | GCP_PRIVATE_KEY: "",
18 | GCP_PROJECT_ID: "",
19 | GCP_LOCATION: "",
20 | GCP_KEY_RING: "",
21 | GCP_KEY_NAME: "",
22 | GCP_KEY_VERSION: "",
23 | };
24 |
25 | /*
26 | check if credentials object contains placeholder values
27 | **/
28 | function checkForPlaceholders() {
29 | const errorBuffer = Array();
30 | const placeholderPattern = /^<.*>$/;
31 | for (const [key, value] of Object.entries(credentials)) {
32 | // check for placeholder text
33 | if (`${value}`.match(placeholderPattern)) {
34 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
35 | errorBuffer.push(errorMessage);
36 | }
37 | // check if value is empty
38 | else if (value == undefined) {
39 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
40 | }
41 | }
42 | // raise an error if errors in buffer
43 | if (errorBuffer.length > 0) {
44 | message = errorBuffer.join("\n");
45 | throw message;
46 | }
47 | }
48 |
49 | module.exports = { getCredentials };
50 |
--------------------------------------------------------------------------------
/queryable-encryption/python/gcp/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # GCP Credentials
8 | "GCP_EMAIL": "",
9 | "GCP_PRIVATE_KEY": "",
10 | "GCP_PROJECT_ID": "",
11 | "GCP_LOCATION": "",
12 | "GCP_KEY_RING": "",
13 | "GCP_KEY_NAME": "",
14 | "GCP_KEY_VERSION": "",
15 | }
16 |
17 |
18 | def check_for_placeholders():
19 | """check if credentials object contains placeholder values"""
20 | error_buffer = []
21 | placeholder_pattern = re.compile("^<.*>$")
22 | for key, value in _credentials.items():
23 | # check for placeholder text
24 | if placeholder_pattern.match(str(value)):
25 | error_message = (
26 | f"You must fill out the {key} field of your credentials object."
27 | )
28 | error_buffer.append(error_message)
29 | # check if value is empty
30 | elif not value:
31 | error_message = (
32 | f"The value for {key} is empty. Please enter something for this value."
33 | )
34 | # raise an error if errors in buffer
35 | if error_buffer:
36 | message = "\n".join(error_buffer)
37 | raise ValueError(message)
38 |
39 |
40 | def get_credentials():
41 | """return credentials object and ensure it has been populated"""
42 | check_for_placeholders()
43 | return _credentials
44 |
--------------------------------------------------------------------------------
/queryable-encryption/node/azure/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 |
14 | // Azure Credentials
15 | AZURE_TENANT_ID: "",
16 | AZURE_CLIENT_ID: "",
17 | AZURE_CLIENT_SECRET: "",
18 | AZURE_KEY_NAME: "",
19 | AZURE_KEY_VERSION: "",
20 | AZURE_KEY_VAULT_ENDPOINT: "",
21 | };
22 |
23 | /*
24 | check if credentials object contains placeholder values
25 | **/
26 | function checkForPlaceholders() {
27 | const errorBuffer = Array();
28 | const placeholderPattern = /^<.*>$/;
29 | for (const [key, value] of Object.entries(credentials)) {
30 | // check for placeholder text
31 | if (`${value}`.match(placeholderPattern)) {
32 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
33 | errorBuffer.push(errorMessage);
34 | }
35 | // check if value is empty
36 | else if (value == undefined) {
37 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
38 | }
39 | }
40 | // raise an error if errors in buffer
41 | if (errorBuffer.length > 0) {
42 | message = errorBuffer.join("\n");
43 | throw message;
44 | }
45 | }
46 |
47 | module.exports = { getCredentials };
48 |
--------------------------------------------------------------------------------
/csfle/python/gcp/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # GCP Credentials
8 | "GCP_EMAIL": "",
9 | "GCP_PRIVATE_KEY": "",
10 | "GCP_PROJECT_ID": "",
11 | "GCP_LOCATION": "",
12 | "GCP_KEY_RING": "",
13 | "GCP_KEY_NAME": "",
14 | "GCP_KEY_VERSION": "",
15 | }
16 |
17 |
18 | def check_for_placeholders():
19 | """check if credentials object contains placeholder values"""
20 | error_buffer = []
21 | placeholder_pattern = re.compile("^<.*>$")
22 | for key, value in _credentials.items():
23 | # check for placeholder text
24 | if placeholder_pattern.match(str(value)):
25 | error_message = (
26 | f"You must fill out the {key} field of your credentials object."
27 | )
28 | error_buffer.append(error_message)
29 | # check if value is empty
30 | elif not value:
31 | error_message = (
32 | f"The value for {key} is empty. Please enter something for this value."
33 | )
34 | # raise an error if errors in buffer
35 | if error_buffer:
36 | message = "\n".join(error_buffer)
37 | raise ValueError(message)
38 |
39 |
40 | def get_credentials():
41 | """return credentials object and ensure it has been populated"""
42 | check_for_placeholders()
43 | return _credentials
44 |
--------------------------------------------------------------------------------
/csfle/node/azure/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH:
13 | "",
14 |
15 | // Azure Credentials
16 | AZURE_TENANT_ID: "",
17 | AZURE_CLIENT_ID: "",
18 | AZURE_CLIENT_SECRET: "",
19 | AZURE_KEY_NAME: "",
20 | AZURE_KEY_VERSION: "",
21 | AZURE_KEY_VAULT_ENDPOINT: "",
22 | };
23 |
24 | /*
25 | check if credentials object contains placeholder values
26 | **/
27 | function checkForPlaceholders() {
28 | const errorBuffer = Array();
29 | const placeholderPattern = /^<.*>$/;
30 | for (const [key, value] of Object.entries(credentials)) {
31 | // check for placeholder text
32 | if (`${value}`.match(placeholderPattern)) {
33 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
34 | errorBuffer.push(errorMessage);
35 | }
36 | // check if value is empty
37 | else if (value == undefined) {
38 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
39 | }
40 | }
41 | // raise an error if errors in buffer
42 | if (errorBuffer.length > 0) {
43 | message = errorBuffer.join("\n");
44 | throw message;
45 | }
46 | }
47 |
48 | module.exports = { getCredentials };
49 |
--------------------------------------------------------------------------------
/queryable-encryption/python/azure/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # Azure Credentials
8 | "AZURE_TENANT_ID": "",
9 | "AZURE_CLIENT_ID": "",
10 | "AZURE_CLIENT_SECRET": "",
11 | "AZURE_KEY_NAME": "",
12 | "AZURE_KEY_VERSION": "",
13 | "AZURE_KEY_VAULT_ENDPOINT": "",
14 | }
15 |
16 |
17 | def check_for_placeholders():
18 | """check if credentials object contains placeholder values"""
19 | error_buffer = []
20 | placeholder_pattern = re.compile("^<.*>$")
21 | for key, value in _credentials.items():
22 | # check for placeholder text
23 | if placeholder_pattern.match(str(value)):
24 | error_message = (
25 | f"You must fill out the {key} field of your credentials object."
26 | )
27 | error_buffer.append(error_message)
28 | # check if value is empty
29 | elif not value:
30 | error_message = (
31 | f"The value for {key} is empty. Please enter something for this value."
32 | )
33 | # raise an error if errors in buffer
34 | if error_buffer:
35 | message = "\n".join(error_buffer)
36 | raise ValueError(message)
37 |
38 |
39 | def get_credentials():
40 | """return credentials object and ensure it has been populated"""
41 | check_for_placeholders()
42 | return _credentials
43 |
--------------------------------------------------------------------------------
/csfle/python/azure/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # Azure Credentials
8 | "AZURE_TENANT_ID": "",
9 | "AZURE_CLIENT_ID": "",
10 | "AZURE_CLIENT_SECRET": "",
11 | "AZURE_KEY_NAME": "",
12 | "AZURE_KEY_VERSION": "",
13 | "AZURE_KEY_VAULT_ENDPOINT": "",
14 | }
15 |
16 |
17 | def check_for_placeholders():
18 | """check if credentials object contains placeholder values"""
19 | error_buffer = []
20 | placeholder_pattern = re.compile("^<.*>$")
21 | for key, value in _credentials.items():
22 | # check for placeholder text
23 | if placeholder_pattern.match(str(value)):
24 | error_message = (
25 | f"You must fill out the {key} field of your credentials object."
26 | )
27 | error_buffer.append(error_message)
28 | # check if value is empty
29 | elif not value:
30 | error_message = (
31 | f"The value for {key} is empty. Please enter something for this value."
32 | )
33 | # raise an error if errors in buffer
34 | if error_buffer:
35 | message = "\n".join(error_buffer)
36 | raise ValueError(message)
37 |
38 |
39 | def get_credentials():
40 | """return credentials object and ensure it has been populated"""
41 | check_for_placeholders()
42 | return _credentials
43 |
--------------------------------------------------------------------------------
/queryable-encryption/go/kmip/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // KMIP Credentials
15 | "KMIP_KMS_ENDPOINT": "",
16 | "KMIP_TLS_CA_FILE": "/kmip_utils/certs/ca.pem'>",
17 | "KMIP_TLS_CERT_FILE": "/kmip_utils/certs/client.pem'>",
18 | "KMIP_TLS_CERT_P12": "/kmip_utils/certs/pcks_client.p12'>",
19 | }
20 |
21 | // check if credentials object contains placeholder values
22 | func check_for_placeholders() {
23 | var error_buffer []string
24 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
25 | for key, value := range credentials {
26 | // check for placeholder text
27 | if placeholder_pattern.MatchString(string(value)) {
28 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
29 | error_buffer = append(error_buffer, error_message)
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if len(error_buffer) > 0 {
34 | message := strings.Join(error_buffer[:], "\n")
35 | log.Fatal(message)
36 | }
37 | }
38 |
39 | // return credentials object and ensure it has been populated
40 | func GetCredentials() map[string]string {
41 | check_for_placeholders()
42 | return credentials
43 | }
44 |
--------------------------------------------------------------------------------
/csfle/go/kmip/reader/your-credentials.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | "log"
6 | "regexp"
7 | "strings"
8 | )
9 |
10 | var credentials = map[string]string{
11 | // Mongo Paths + URI
12 | "MONGODB_URI": "",
13 | "SHARED_LIB_PATH": "",
14 | // KMIP Credentials
15 | "KMIP_KMS_ENDPOINT": "",
16 | "KMIP_TLS_CA_FILE": "/kmip_utils/certs/ca.pem'>",
17 | "KMIP_TLS_CERT_FILE": "/kmip_utils/certs/client.pem'>",
18 | "KMIP_TLS_CERT_P12": "/kmip_utils/certs/pcks_client.p12'>",
19 | }
20 |
21 | // check if credentials object contains placeholder values
22 | func check_for_placeholders() {
23 | var error_buffer []string
24 | placeholder_pattern, _ := regexp.Compile("^<.*>$")
25 | for key, value := range credentials {
26 | // check for placeholder text
27 | if placeholder_pattern.MatchString(string(value)) {
28 | error_message := fmt.Sprintf("You must fill out the %s field of your credentials object.\n", key)
29 | error_buffer = append(error_buffer, error_message)
30 | }
31 | }
32 | // raise an error if errors in buffer
33 | if len(error_buffer) > 0 {
34 | message := strings.Join(error_buffer[:], "\n")
35 | log.Fatal(message)
36 | }
37 | }
38 |
39 | // return credentials object and ensure it has been populated
40 | func GetCredentials() map[string]string {
41 | check_for_placeholders()
42 | return credentials
43 | }
44 |
--------------------------------------------------------------------------------
/queryable-encryption/mongosh/kmip/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 |
13 | // KMIP Credentials
14 | KMIP_KMS_ENDPOINT:
15 | "",
16 | KMIP_TLS_CA_FILE:
17 | "/kmip_utils/certs/ca.pem'>",
18 | KMIP_TLS_CERT_FILE:
19 | "/kmip_utils/certs/client.pem'>",
20 | KMIP_TLS_CERT_P12:
21 | "/kmip_utils/certs/pcks_client.p12'>",
22 | };
23 |
24 | /*
25 | check if credentials object contains placeholder values
26 | **/
27 | function checkForPlaceholders() {
28 | const errorBuffer = Array();
29 | const placeholderPattern = /^<.*>$/;
30 | for (const [key, value] of Object.entries(credentials)) {
31 | // check for placeholder text
32 | if (`${value}`.match(placeholderPattern)) {
33 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
34 | errorBuffer.push(errorMessage);
35 | }
36 | // check if value is empty
37 | else if (value == undefined) {
38 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
39 | }
40 | }
41 | // raise an error if errors in buffer
42 | if (errorBuffer.length > 0) {
43 | message = errorBuffer.join("\n");
44 | throw message;
45 | }
46 | }
47 |
48 | module.exports = { getCredentials };
49 |
--------------------------------------------------------------------------------
/queryable-encryption/python/kmip/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # KMIP Credentials
8 | "KMIP_KMS_ENDPOINT": "",
9 | "KMIP_TLS_CA_FILE": "/kmip_utils/certs/ca.pem'>",
10 | "KMIP_TLS_CERT_FILE": "/kmip_utils/certs/client.pem'>",
11 | "KMIP_TLS_CERT_P12": "/kmip_utils/certs/pcks_client.p12'>",
12 | }
13 |
14 |
15 | def check_for_placeholders():
16 | """check if credentials object contains placeholder values"""
17 | error_buffer = []
18 | placeholder_pattern = re.compile("^<.*>$")
19 | for key, value in _credentials.items():
20 | # check for placeholder text
21 | if placeholder_pattern.match(str(value)):
22 | error_message = (
23 | f"You must fill out the {key} field of your credentials object."
24 | )
25 | error_buffer.append(error_message)
26 | # check if value is empty
27 | elif not value:
28 | error_message = (
29 | f"The value for {key} is empty. Please enter something for this value."
30 | )
31 | # raise an error if errors in buffer
32 | if error_buffer:
33 | message = "\n".join(error_buffer)
34 | raise ValueError(message)
35 |
36 |
37 | def get_credentials():
38 | """return credentials object and ensure it has been populated"""
39 | check_for_placeholders()
40 | return _credentials
41 |
--------------------------------------------------------------------------------
/csfle/python/kmip/reader/your_credentials.py:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | _credentials = {
4 | # Mongo Paths + URI
5 | "MONGODB_URI": "",
6 | "SHARED_LIB_PATH": "",
7 | # KMIP Credentials
8 | "KMIP_KMS_ENDPOINT": "",
9 | "KMIP_TLS_CA_FILE": "/kmip_utils/certs/ca.pem'>",
10 | "KMIP_TLS_CERT_FILE": "/kmip_utils/certs/client.pem'>",
11 | "KMIP_TLS_CERT_P12": "/kmip_utils/certs/pcks_client.p12'>",
12 | }
13 |
14 |
15 | def check_for_placeholders():
16 | """check if credentials object contains placeholder values"""
17 | error_buffer = []
18 | placeholder_pattern = re.compile("^<.*>$")
19 | for key, value in _credentials.items():
20 | # check for placeholder text
21 | if placeholder_pattern.match(str(value)):
22 | error_message = (
23 | f"You must fill out the {key} field of your credentials object."
24 | )
25 | error_buffer.append(error_message)
26 | # check if value is empty
27 | elif not value:
28 | error_message = (
29 | f"The value for {key} is empty. Please enter something for this value."
30 | )
31 | # raise an error if errors in buffer
32 | if error_buffer:
33 | message = "\n".join(error_buffer)
34 | raise ValueError(message)
35 |
36 |
37 | def get_credentials():
38 | """return credentials object and ensure it has been populated"""
39 | check_for_placeholders()
40 | return _credentials
41 |
--------------------------------------------------------------------------------
/queryable-encryption/node/kmip/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH: "",
13 |
14 | // KMIP Credentials
15 | KMIP_KMS_ENDPOINT:
16 | "",
17 | KMIP_TLS_CA_FILE:
18 | "/kmip_utils/certs/ca.pem'>",
19 | KMIP_TLS_CERT_FILE:
20 | "/kmip_utils/certs/client.pem'>",
21 | KMIP_TLS_CERT_P12:
22 | "/kmip_utils/certs/pcks_client.p12'>",
23 | };
24 |
25 | /*
26 | check if credentials object contains placeholder values
27 | **/
28 | function checkForPlaceholders() {
29 | const errorBuffer = Array();
30 | const placeholderPattern = /^<.*>$/;
31 | for (const [key, value] of Object.entries(credentials)) {
32 | // check for placeholder text
33 | if (`${value}`.match(placeholderPattern)) {
34 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
35 | errorBuffer.push(errorMessage);
36 | }
37 | // check if value is empty
38 | else if (value == undefined) {
39 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
40 | }
41 | }
42 | // raise an error if errors in buffer
43 | if (errorBuffer.length > 0) {
44 | message = errorBuffer.join("\n");
45 | throw message;
46 | }
47 | }
48 |
49 | module.exports = { getCredentials };
50 |
--------------------------------------------------------------------------------
/csfle/node/kmip/reader/your_credentials.js:
--------------------------------------------------------------------------------
1 | /*
2 | return credentials object and ensure it has been populated
3 | **/
4 | function getCredentials() {
5 | checkForPlaceholders();
6 | return credentials;
7 | }
8 |
9 | const credentials = {
10 | // Mongo Paths + URI
11 | MONGODB_URI: "",
12 | SHARED_LIB_PATH:
13 | "",
14 |
15 | // KMIP Credentials
16 | KMIP_KMS_ENDPOINT:
17 | "",
18 | KMIP_TLS_CA_FILE:
19 | "/kmip_utils/certs/ca.pem'>",
20 | KMIP_TLS_CERT_FILE:
21 | "/kmip_utils/certs/client.pem'>",
22 | KMIP_TLS_CERT_P12:
23 | "/kmip_utils/certs/pcks_client.p12'>",
24 | };
25 |
26 | /*
27 | check if credentials object contains placeholder values
28 | **/
29 | function checkForPlaceholders() {
30 | const errorBuffer = Array();
31 | const placeholderPattern = /^<.*>$/;
32 | for (const [key, value] of Object.entries(credentials)) {
33 | // check for placeholder text
34 | if (`${value}`.match(placeholderPattern)) {
35 | errorMessage = `You must fill out the ${key} field of your credentials object.`;
36 | errorBuffer.push(errorMessage);
37 | }
38 | // check if value is empty
39 | else if (value == undefined) {
40 | error_message = `The value for ${key} is empty. Please enter something for this value.`;
41 | }
42 | }
43 | // raise an error if errors in buffer
44 | if (errorBuffer.length > 0) {
45 | message = errorBuffer.join("\n");
46 | throw message;
47 | }
48 | }
49 |
50 | module.exports = { getCredentials };
51 |
--------------------------------------------------------------------------------
/csfle/dotnet/aws/reader/CSFLE/YourCredentials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Credentials
6 | {
7 | class YourCredentials
8 | {
9 |
10 | private Dictionary credentials = new Dictionary()
11 | {
12 | // Mongo Paths + URI
13 | {"MONGODB_URI", ""},
14 | {"SHARED_LIB_PATH", ""},
15 | // AWS Credentials
16 | {"AWS_ACCESS_KEY_ID", ""},
17 | {"AWS_SECRET_ACCESS_KEY", ""},
18 | {"AWS_KEY_REGION", ""},
19 | {"AWS_KEY_ARN", ""},
20 |
21 |
22 | };
23 |
24 | private void CheckThatValuesAreSet()
25 | {
26 | var placeholder = new Regex("^<.*>$");
27 | var errorBuffer = new List();
28 | foreach (KeyValuePair entry in credentials)
29 | {
30 | if (entry.Value != null && placeholder.IsMatch(Convert.ToString(entry.Value)))
31 | {
32 | var message = String.Format("You must fill out the {0} field of your credentials object.", entry.Key);
33 | errorBuffer.Add(message);
34 | }
35 | }
36 | if (errorBuffer.Count > 0)
37 | {
38 | var message = String.Join("\n", errorBuffer);
39 | throw new Exception(message);
40 | }
41 | }
42 |
43 | public Dictionary GetCredentials()
44 | {
45 | CheckThatValuesAreSet();
46 | return credentials;
47 | }
48 |
49 | }
50 | }
--------------------------------------------------------------------------------
/queryable-encryption/dotnet/aws/reader/QueryableEncryption/YourCredentials.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace Credentials
6 | {
7 | class YourCredentials
8 | {
9 |
10 | private Dictionary credentials = new Dictionary()
11 | {
12 | // Mongo Paths + URI
13 | {"MONGODB_URI", ""},
14 | {"SHARED_LIB_PATH", ""},
15 | // AWS Credentials
16 | {"AWS_ACCESS_KEY_ID", "