Skip to content

Commit d6ab9dd

Browse files
authored
GODRIVER-2449 document Queryable Encryption API as Public Technical Preview (#1012)
1 parent 68ea5c1 commit d6ab9dd

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

mongo/doc.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
// to install packages via brew and compile the libmongocrypt source code.
124124
//
125125
// 3. Windows:
126+
//
126127
// mkdir -p c:/libmongocrypt/bin
127128
// mkdir -p c:/libmongocrypt/include
128129
//
@@ -134,18 +135,8 @@
134135
// cp ./include/mongocrypt/*.h c:/libmongocrypt/include
135136
// export PATH=$PATH:/cygdrive/c/libmongocrypt/bin
136137
//
137-
// libmongocrypt communicates with the mongocryptd process for automatic encryption. This process can be started manually
138-
// or auto-spawned by the driver itself. To enable auto-spawning, ensure the process binary is on the PATH. To start it
139-
// manually, use AutoEncryptionOptions:
140-
//
141-
// aeo := options.AutoEncryption()
142-
// mongocryptdOpts := map[string]interface{}{
143-
// "mongocryptdBypassSpawn": true,
144-
// }
145-
// aeo.SetExtraOptions(mongocryptdOpts)
146-
// To specify a process URI for mongocryptd, the "mongocryptdURI" option can be passed in the ExtraOptions map as well.
147-
// See the ClientSideEncryption and ClientSideEncryptionCreateKey examples below for code samples about using this
148-
// feature.
138+
// libmongocrypt communicates with the mongocryptd process or mongo_crypt shared library for automatic encryption.
139+
// See AutoEncryptionOpts.SetExtraOptions for options to configure use of mongocryptd or mongo_crypt.
149140
//
150141
// [1] See https://www.mongodb.com/docs/manual/reference/connection-string/#dns-seedlist-connection-format
151142
package mongo

mongo/options/autoencryptionoptions.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (a *AutoEncryptionOptions) SetBypassAutoEncryption(bypass bool) *AutoEncryp
9292
return a
9393
}
9494

95-
// SetExtraOptions specifies a map of options to configure the mongocryptd process.
95+
// SetExtraOptions specifies a map of options to configure the mongocryptd process or mongo_crypt shared library.
9696
//
9797
// Supported Extra Options
9898
//
@@ -144,13 +144,16 @@ func (a *AutoEncryptionOptions) SetTLSConfig(tlsOpts map[string]*tls.Config) *Au
144144
}
145145

146146
// SetEncryptedFieldsMap specifies a map from namespace to local EncryptedFieldsMap document.
147+
// EncryptedFieldsMap is used for Queryable Encryption.
148+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
147149
func (a *AutoEncryptionOptions) SetEncryptedFieldsMap(ef map[string]interface{}) *AutoEncryptionOptions {
148150
a.EncryptedFieldsMap = ef
149151
return a
150152
}
151153

152154
// SetBypassQueryAnalysis specifies whether or not query analysis should be used for automatic encryption.
153155
// Use this option when using explicit encryption with Queryable Encryption.
156+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
154157
func (a *AutoEncryptionOptions) SetBypassQueryAnalysis(bypass bool) *AutoEncryptionOptions {
155158
a.BypassQueryAnalysis = &bypass
156159
return a

mongo/options/encryptoptions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
)
1212

1313
// These constants specify valid values for QueryType
14+
// QueryType is used for Queryable Encryption.
15+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
1416
const (
1517
QueryTypeEquality string = "equality"
1618
)
@@ -47,6 +49,8 @@ func (e *EncryptOptions) SetKeyAltName(keyAltName string) *EncryptOptions {
4749
// - Indexed
4850
// - Unindexed
4951
// This is required.
52+
// Indexed and Unindexed are used for Queryable Encryption.
53+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
5054
func (e *EncryptOptions) SetAlgorithm(algorithm string) *EncryptOptions {
5155
e.Algorithm = algorithm
5256
return e
@@ -55,12 +59,16 @@ func (e *EncryptOptions) SetAlgorithm(algorithm string) *EncryptOptions {
5559
// SetQueryType specifies the intended query type. It is only valid to set if algorithm is "Indexed".
5660
// This should be one of the following:
5761
// - equality
62+
// QueryType is used for Queryable Encryption.
63+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
5864
func (e *EncryptOptions) SetQueryType(queryType string) *EncryptOptions {
5965
e.QueryType = queryType
6066
return e
6167
}
6268

6369
// SetContentionFactor specifies the contention factor. It is only valid to set if algorithm is "Indexed".
70+
// ContentionFactor is used for Queryable Encryption.
71+
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
6472
func (e *EncryptOptions) SetContentionFactor(contentionFactor int64) *EncryptOptions {
6573
e.ContentionFactor = &contentionFactor
6674
return e

0 commit comments

Comments
 (0)