Skip to content

Commit f780759

Browse files
committed
Cleanup and update tests for mongo as replicaSet
1 parent 5399bd9 commit f780759

File tree

10 files changed

+145
-63
lines changed

10 files changed

+145
-63
lines changed

README.md

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,70 @@ $ go get -u -v gopkg.in/go-oauth2/mongo.v3
1111
## Usage
1212

1313
``` go
14-
package main
15-
16-
import (
17-
"gopkg.in/go-oauth2/mongo.v3"
18-
"gopkg.in/oauth2.v3/manage"
14+
import(
15+
"github.com/go-oauth2/oauth2/v4/manage"
16+
"github.com/go-oauth2/oauth2/v4/server"
17+
mongo "gopkg.in/go-oauth2/mongo.v3"
1918
)
2019

21-
func main() {
22-
manager := manage.NewDefaultManager()
20+
func main(){
21+
manager := manage.NewDefaultManager()
22+
23+
/*
24+
* only for a MongoDB replicaSet deployment
25+
* Using a replicaSet is recommended as it allows for MongoDB's native support for transactions
26+
**/
27+
// mongoConf := mongo.NewConfigReplicaSet(
28+
// "mongodb://localhost:27017,localhost:28017,localhost:29017/?replicaSet=myReplicaSet",
29+
// "oauth2",
30+
// )
31+
32+
// set connectionTimeout(7s) and the requestsTimeout(5s) // is optional
33+
storeConfigs := mongo.NewStoreConfig(7, 5)
34+
35+
/*
36+
* for a single mongoDB node
37+
* if the oauth2 service is deployed with more than one instance
38+
* each mongoConf should have unique serviceName
39+
**/
40+
mongoConf := mongo.NewConfigNonReplicaSet(
41+
"mongodb://127.0.0.1:27017",
42+
"oauth2", // database name
43+
"admin", // username to authenticate with db
44+
"password", // password to authenticate with db
45+
"serviceName",
46+
)
2347

2448
// use mongodb token store
2549
manager.MapTokenStorage(
26-
mongo.NewTokenStore(mongo.NewConfig(
27-
"mongodb://127.0.0.1:27017",
28-
"oauth2",
29-
)),
50+
mongo.NewTokenStore(mongoConf, storeConfigs), // with timeout
51+
// mongo.NewTokenStore(mongoConf), // no timeout
3052
)
31-
// ...
53+
54+
clientStore := mongo.NewClientStore(mongoConf, storeConfigs) // with timeout
55+
// clientStore := mongo.NewClientStore(mongoConf) // no timeout
56+
57+
manager.MapClientStorage(clientStore)
58+
59+
// register a service
60+
clientStore.Create(&models.Client{
61+
ID: idvar,
62+
Secret: secretvar,
63+
Domain: domainvar,
64+
UserID: "frontend",
65+
})
66+
67+
// register a second service
68+
clientStore.Create(&models.Client{
69+
ID: idPreorder,
70+
Secret: secretPreorder,
71+
Domain: domainPreorder,
72+
UserID: "prePost",
73+
})
74+
75+
srv := server.NewServer(server.NewConfig(), manager)
76+
77+
// ...
3278
}
3379
```
3480

client_store.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func NewDefaultStoreConfig(db, service string, isReplicasSet bool) *StoreConfig
4545
}
4646
}
4747

48+
// setRequestContext set a WithTimeout or Background context
4849
func (sc *StoreConfig) setRequestContext() (context.Context, context.CancelFunc) {
4950
ctx := context.Background()
5051
if sc.requestTimeout > 0 {
@@ -55,11 +56,12 @@ func (sc *StoreConfig) setRequestContext() (context.Context, context.CancelFunc)
5556
return nil, func() {}
5657
}
5758

59+
// setTransactionCreateContext is specific to the transaction(if not a replicaSet)
5860
func (sc *StoreConfig) setTransactionCreateContext() (context.Context, context.CancelFunc) {
5961
ctx := context.Background()
6062
if sc.requestTimeout > 0 {
61-
// at max TransactionCreate run 7 requests
62-
timeout := time.Duration(sc.requestTimeout*7) * time.Second
63+
// at max TransactionCreate run 9 requests
64+
timeout := time.Duration(sc.requestTimeout*9) * time.Second
6365
return context.WithTimeout(ctx, timeout)
6466
}
6567
return nil, func() {}
@@ -82,7 +84,6 @@ func NewDefaultClientConfig(strCfgs *StoreConfig) *ClientConfig {
8284

8385
// NewClientStore create a client store instance based on mongodb
8486
func NewClientStore(cfg *Config, scfgs ...*StoreConfig) *ClientStore {
85-
8687
clientOptions := options.Client().ApplyURI(cfg.URL)
8788
ctx := context.TODO()
8889
ctxPing := context.TODO()

client_store_test.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ import (
88
. "github.com/smartystreets/goconvey/convey"
99
)
1010

11-
// shut the the down the database, test should fail within a second
11+
// shut down the database, test should fail within a second
1212
func TestClientStoreWithTimeout(t *testing.T) {
1313

1414
storeConfig := NewStoreConfig(1, 1)
15-
store := NewClientStore(NewConfigNonReplicaSet(url, dbName, username, password, service), storeConfig)
15+
16+
var store *ClientStore
17+
if !isReplicaSet {
18+
store = NewClientStore(NewConfigNonReplicaSet(url, dbName, username, password, service), storeConfig)
19+
} else {
20+
store = NewClientStore(NewConfigReplicaSet(url, dbName), storeConfig)
21+
}
1622

1723
client := &models.Client{
1824
ID: "id",
@@ -72,7 +78,12 @@ func TestClientStoreWithTimeout(t *testing.T) {
7278
}
7379

7480
func TestClientStore(t *testing.T) {
75-
store := NewClientStore(NewConfigNonReplicaSet(url, dbName, username, password, service))
81+
var store *ClientStore
82+
if !isReplicaSet {
83+
store = NewClientStore(NewConfigNonReplicaSet(url, dbName, username, password, service))
84+
} else {
85+
store = NewClientStore(NewConfigReplicaSet(url, dbName))
86+
}
7687

7788
client := &models.Client{
7889
ID: "id",

config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package mongo
22

33
const (
44
url = "mongodb://127.0.0.1:27017"
5-
// url = "mongodb://localhost:27017,localhost:28017,localhost:29017/?replicaSet=myReplicaS"
5+
// url = "mongodb://localhost:27017,localhost:28017,localhost:29017/?replicaSet=myReplicaSet"
66
dbName = "mydb_test"
77
username = "admin"
88
password = "password"

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ go 1.13
55
require (
66
github.com/go-oauth2/oauth2/v4 v4.5.2
77
github.com/smartystreets/goconvey v1.6.4
8-
github.com/stretchr/testify v1.8.4
98
go.mongodb.org/mongo-driver v1.12.0
109
)

go.sum

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q
4141
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
4242
github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U=
4343
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
44-
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
4544
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
4645
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
47-
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
4846
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
4947
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
5048
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
@@ -57,27 +55,17 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
5755
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
5856
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
5957
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
60-
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6158
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6259
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
6360
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
6461
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
6562
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
6663
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
6764
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
68-
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
6965
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
70-
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
71-
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
72-
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
7366
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
7467
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
75-
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
7668
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
77-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
78-
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
79-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
80-
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
8169
github.com/tidwall/btree v0.0.0-20191029221954-400434d76274/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
8270
github.com/tidwall/buntdb v1.1.2/go.mod h1:xAzi36Hir4FarpSHyfuZ6JzPJdjRZ8QlLZSntE2mqlI=
8371
github.com/tidwall/gjson v1.3.4/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
@@ -175,15 +163,11 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE
175163
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
176164
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
177165
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
178-
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
179166
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
180167
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
181168
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
182169
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
183170
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
184171
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
185172
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
186-
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
187173
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
188-
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
189-
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

token_store.go

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package mongo
33
import (
44
"context"
55
"encoding/json"
6-
"fmt"
76
"log"
87
"time"
98

@@ -41,12 +40,7 @@ func NewDefaultTokenConfig(strConfig *StoreConfig) *TokenConfig {
4140
}
4241

4342
// NewTokenStore create a token store instance based on mongodb
44-
// func NewTokenStore(cfg *Config, tcfgs ...*TokenConfig) (store *TokenStore) {
4543
func NewTokenStore(cfg *Config, scfgs ...*StoreConfig) (store *TokenStore) {
46-
// clientOptions := options.Client().ApplyURI(cfg.URL).SetWriteConcern(writeconcern.New(writeconcern.WMajority()))
47-
48-
fmt.Println("See url: ", cfg.URL)
49-
5044
clientOptions := options.Client().ApplyURI(cfg.URL)
5145
ctx := context.TODO()
5246
ctxPing := context.TODO()
@@ -91,8 +85,6 @@ func NewTokenStore(cfg *Config, scfgs ...*StoreConfig) (store *TokenStore) {
9185

9286
// NewTokenStoreWithSession create a token store instance based on mongodb
9387
func NewTokenStoreWithSession(client *mongo.Client, cfg *Config, scfgs ...*StoreConfig) (store *TokenStore) {
94-
// func NewTokenStoreWithSession(client *mongo.Client, cfg *Config) (store *TokenStore) {
95-
9688
strCfgs := NewDefaultStoreConfig(cfg.DB, cfg.Service, cfg.IsReplicaSet)
9789

9890
ts := &TokenStore{
@@ -205,7 +197,6 @@ func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) (err er
205197
}
206198

207199
id := primitive.NewObjectID().Hex()
208-
// fmt.Println("the id: ", id)
209200

210201
// Create the basicData document
211202
basicData := basicData{
@@ -221,7 +212,7 @@ func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) (err er
221212
ExpiredAt: aexp,
222213
}
223214

224-
// if context is defined manually, increase it for the transaction
215+
// if context is defined, increase it for the transaction
225216
ctxTxn, cancel := ts.tcfg.storeConfig.setTransactionCreateContext()
226217
defer cancel()
227218
if ctxTxn != nil {
@@ -283,6 +274,12 @@ func (ts *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) (err er
283274

284275
// RemoveByCode use the authorization code to delete the token information
285276
func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) (err error) {
277+
ctxReq, cancel := ts.tcfg.storeConfig.setRequestContext()
278+
defer cancel()
279+
if ctxReq != nil {
280+
ctx = ctxReq
281+
}
282+
286283
_, err = ts.c(ts.tcfg.BasicCName).DeleteOne(ctx, bson.D{{Key: "_id", Value: code}})
287284
if err != nil {
288285
log.Println("Error RemoveByCode: ", err)
@@ -292,6 +289,12 @@ func (ts *TokenStore) RemoveByCode(ctx context.Context, code string) (err error)
292289

293290
// RemoveByAccess use the access token to delete the token information
294291
func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) (err error) {
292+
ctxReq, cancel := ts.tcfg.storeConfig.setRequestContext()
293+
defer cancel()
294+
if ctxReq != nil {
295+
ctx = ctxReq
296+
}
297+
295298
_, err = ts.c(ts.tcfg.AccessCName).DeleteOne(ctx, bson.D{{Key: "_id", Value: access}})
296299
if err != nil {
297300
log.Println("Error RemoveByAccess: ", err)
@@ -301,6 +304,12 @@ func (ts *TokenStore) RemoveByAccess(ctx context.Context, access string) (err er
301304

302305
// RemoveByRefresh use the refresh token to delete the token information
303306
func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) (err error) {
307+
ctxReq, cancel := ts.tcfg.storeConfig.setRequestContext()
308+
defer cancel()
309+
if ctxReq != nil {
310+
ctx = ctxReq
311+
}
312+
304313
_, err = ts.c(ts.tcfg.RefreshCName).DeleteOne(ctx, bson.D{{Key: "_id", Value: refresh}})
305314
if err != nil {
306315
log.Println("Error RemoveByRefresh: ", err)
@@ -309,9 +318,15 @@ func (ts *TokenStore) RemoveByRefresh(ctx context.Context, refresh string) (err
309318
}
310319

311320
func (ts *TokenStore) getData(basicID string) (ti oauth2.TokenInfo, err error) {
321+
ctx := context.Background()
322+
ctxReq, cancel := ts.tcfg.storeConfig.setRequestContext()
323+
defer cancel()
324+
if ctxReq != nil {
325+
ctx = ctxReq
326+
}
312327

313328
var bd basicData
314-
err = ts.c(ts.tcfg.BasicCName).FindOne(context.TODO(), bson.D{{Key: "_id", Value: basicID}}).Decode(&bd)
329+
err = ts.c(ts.tcfg.BasicCName).FindOne(ctx, bson.D{{Key: "_id", Value: basicID}}).Decode(&bd)
315330
if err != nil {
316331
if err == mongo.ErrNoDocuments {
317332
return nil, nil
@@ -329,8 +344,15 @@ func (ts *TokenStore) getData(basicID string) (ti oauth2.TokenInfo, err error) {
329344
}
330345

331346
func (ts *TokenStore) getBasicID(cname, token string) (basicID string, err error) {
347+
ctx := context.Background()
348+
ctxReq, cancel := ts.tcfg.storeConfig.setRequestContext()
349+
defer cancel()
350+
if ctxReq != nil {
351+
ctx = ctxReq
352+
}
353+
332354
var td tokenData
333-
err = ts.c(cname).FindOne(context.TODO(), bson.D{{Key: "_id", Value: token}}).Decode(&td)
355+
err = ts.c(cname).FindOne(ctx, bson.D{{Key: "_id", Value: token}}).Decode(&td)
334356
if err != nil {
335357
if err == mongo.ErrNoDocuments {
336358
return

token_store_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ func TestTokenStoreWithTimeout(t *testing.T) {
1515
Convey("Test mongodb token store", t, func() {
1616

1717
storeConfig := NewStoreConfig(1, 5)
18-
store := NewTokenStore(NewConfigNonReplicaSet(url, dbName, username, password, service), storeConfig)
18+
19+
var store *TokenStore
20+
if !isReplicaSet {
21+
store = NewTokenStore(NewConfigNonReplicaSet(url, dbName, username, password, service), storeConfig)
22+
} else {
23+
store = NewTokenStore(NewConfigReplicaSet(url, dbName), storeConfig)
24+
}
1925

2026
Convey("Test authorization code store", func() {
2127
info := &models.Token{
@@ -114,7 +120,12 @@ func TestTokenStoreWithTimeout(t *testing.T) {
114120

115121
func TestTokenStore(t *testing.T) {
116122
Convey("Test mongodb token store", t, func() {
117-
store := NewTokenStore(NewConfigNonReplicaSet(url, dbName, username, password, service))
123+
var store *TokenStore
124+
if !isReplicaSet {
125+
store = NewTokenStore(NewConfigNonReplicaSet(url, dbName, username, password, service))
126+
} else {
127+
store = NewTokenStore(NewConfigReplicaSet(url, dbName))
128+
}
118129

119130
Convey("Test authorization code store", func() {
120131
info := &models.Token{

0 commit comments

Comments
 (0)