Keep Mongo operations online across Vault credential rotation
This commit is contained in:
1 parent
80d6917aa7
commit
23f7b78c3b
30 files changed
+1290
-202
No files matched your search
@@ -1,15 +1,15 @@
|
||||
package refreshtokens
|
||||
|
||||
import (
|
||||
sessionmodel "git.sendico.io/tech/sxchnge/product/sessions/model"
|
||||
"strings"
|
||||
|
||||
sessionmodel "git.sendico.io/tech/sxchnge/product/sessions/model"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/repository"
|
||||
ri "git.sendico.io/tech/sxchnge/shared/database/repository/index"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/source"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/template"
|
||||
"git.sendico.io/tech/sxchnge/shared/logging"
|
||||
"git.sendico.io/tech/sxchnge/shared/service"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ type RefreshTokenDB struct {
|
||||
collection Collections
|
||||
}
|
||||
|
||||
func Create(logger mlogger.Logger, db *mongo.Database) (*RefreshTokenDB, error) {
|
||||
func Create(logger mlogger.Logger, db source.Source) (*RefreshTokenDB, error) {
|
||||
return CreateWithCollections(logger, db, Collections{})
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ func (c Collections) WithDefaults() Collections {
|
||||
return c
|
||||
}
|
||||
|
||||
func CreateWithCollections(logger mlogger.Logger, db *mongo.Database, collections Collections) (*RefreshTokenDB, error) {
|
||||
func CreateWithCollections(logger mlogger.Logger, db source.Source, collections Collections) (*RefreshTokenDB, error) {
|
||||
collections = collections.WithDefaults()
|
||||
p := &RefreshTokenDB{
|
||||
DBImp: *template.Create[*sessionmodel.RefreshToken](logger, mservice.Type(collections.RefreshTokens), db),
|
||||
clients: repository.CreateMongoRepository(db, collections.Clients),
|
||||
clients: repository.CreateRepository(db, collections.Clients),
|
||||
collection: collections,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user