Skip to content

Commit 4f06ad2

Browse files
authored
GODRIVER-2748 Add "Public Technical Preview" note to CreateEncryptedCollection (#1175)
* add Public Technical Preview notes This is copied from other Queryable Encryption API. * note that CreateEncryptedCollection is specific to Queryable Encryption * add Beta note to Queryable Encryption API * use Beta note for Range algorithm API
1 parent 1c97d96 commit 4f06ad2

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

mongo/client_encryption.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ func NewClientEncryption(keyVaultClient *Client, opts ...*options.ClientEncrypti
7373
return ce, nil
7474
}
7575

76-
// CreateEncryptedCollection creates a new collection with the help of automatic generation of new encryption data keys for null keyIds.
76+
// CreateEncryptedCollection creates a new collection for Queryable Encryption with the help of automatic generation of new encryption data keys for null keyIds.
7777
// It returns the created collection and the encrypted fields document used to create it.
78+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
7879
func (ce *ClientEncryption) CreateEncryptedCollection(ctx context.Context,
7980
db *Database, coll string, createOpts *options.CreateCollectionOptions,
8081
kmsProvider string, masterKey interface{}) (*Collection, bson.M, error) {
@@ -228,7 +229,7 @@ func (ce *ClientEncryption) Encrypt(ctx context.Context, val bson.RawValue,
228229
// {$and: [{$gt: [<fieldpath>, <value1>]}, {$lt: [<fieldpath>, <value2>]}]
229230
// $gt may also be $gte. $lt may also be $lte.
230231
// Only supported for queryType "rangePreview"
231-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
232+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
232233
func (ce *ClientEncryption) EncryptExpression(ctx context.Context, expr interface{}, result interface{}, opts ...*options.EncryptOptions) error {
233234
transformed := transformExplicitEncryptionOptions(opts...)
234235

mongo/options/autoencryptionoptions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ func (a *AutoEncryptionOptions) SetTLSConfig(tlsOpts map[string]*tls.Config) *Au
151151

152152
// SetEncryptedFieldsMap specifies a map from namespace to local EncryptedFieldsMap document.
153153
// EncryptedFieldsMap is used for Queryable Encryption.
154-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
154+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
155155
func (a *AutoEncryptionOptions) SetEncryptedFieldsMap(ef map[string]interface{}) *AutoEncryptionOptions {
156156
a.EncryptedFieldsMap = ef
157157
return a
158158
}
159159

160160
// SetBypassQueryAnalysis specifies whether or not query analysis should be used for automatic encryption.
161161
// Use this option when using explicit encryption with Queryable Encryption.
162-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
162+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
163163
func (a *AutoEncryptionOptions) SetBypassQueryAnalysis(bypass bool) *AutoEncryptionOptions {
164164
a.BypassQueryAnalysis = &bypass
165165
return a

mongo/options/encryptoptions.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313

1414
// These constants specify valid values for QueryType
1515
// QueryType is used for Queryable Encryption.
16-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
16+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
1717
const (
1818
QueryTypeEquality string = "equality"
1919
)
2020

2121
// RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
22-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
22+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
2323
type RangeOptions struct {
2424
Min *bson.RawValue
2525
Max *bson.RawValue
@@ -61,7 +61,7 @@ func (e *EncryptOptions) SetKeyAltName(keyAltName string) *EncryptOptions {
6161
// - Unindexed
6262
// This is required.
6363
// Indexed and Unindexed are used for Queryable Encryption.
64-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
64+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
6565
func (e *EncryptOptions) SetAlgorithm(algorithm string) *EncryptOptions {
6666
e.Algorithm = algorithm
6767
return e
@@ -71,50 +71,50 @@ func (e *EncryptOptions) SetAlgorithm(algorithm string) *EncryptOptions {
7171
// This should be one of the following:
7272
// - equality
7373
// QueryType is used for Queryable Encryption.
74-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
74+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
7575
func (e *EncryptOptions) SetQueryType(queryType string) *EncryptOptions {
7676
e.QueryType = queryType
7777
return e
7878
}
7979

8080
// SetContentionFactor specifies the contention factor. It is only valid to set if algorithm is "Indexed".
8181
// ContentionFactor is used for Queryable Encryption.
82-
// Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
82+
// Beta: Queryable Encryption is in Public Technical Preview. Queryable Encryption should not be used in production and is subject to backwards breaking changes.
8383
func (e *EncryptOptions) SetContentionFactor(contentionFactor int64) *EncryptOptions {
8484
e.ContentionFactor = &contentionFactor
8585
return e
8686
}
8787

8888
// SetRangeOptions specifies the options to use for explicit encryption with range. It is only valid to set if algorithm is "rangePreview".
89-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
89+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
9090
func (e *EncryptOptions) SetRangeOptions(ro RangeOptions) *EncryptOptions {
9191
e.RangeOptions = &ro
9292
return e
9393
}
9494

9595
// SetMin sets the range index minimum value.
96-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
96+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
9797
func (ro *RangeOptions) SetMin(min bson.RawValue) *RangeOptions {
9898
ro.Min = &min
9999
return ro
100100
}
101101

102102
// SetMax sets the range index maximum value.
103-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
103+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
104104
func (ro *RangeOptions) SetMax(max bson.RawValue) *RangeOptions {
105105
ro.Max = &max
106106
return ro
107107
}
108108

109109
// SetSparsity sets the range index sparsity.
110-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
110+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
111111
func (ro *RangeOptions) SetSparsity(sparsity int64) *RangeOptions {
112112
ro.Sparsity = sparsity
113113
return ro
114114
}
115115

116116
// SetPrecision sets the range index precision.
117-
// NOTE(kevinAlbs): The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
117+
// Beta: The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes.
118118
func (ro *RangeOptions) SetPrecision(precision int32) *RangeOptions {
119119
ro.Precision = &precision
120120
return ro

0 commit comments

Comments
 (0)