refact: to use go-dbw CreateItems, DeleteItems (#4974)
* refact: to use go-dbw CreateItems, DeleteItems Latest version of go-dbw updated the signature of CreateItems(...) and DeleteItems(...) on a happy note this latest version of go-dbw actually does batch inserts and updates for this functions. * all: regenerate protos with new protoc-gen-go version
This commit is contained in:
167 files changed
+2254
-2248
No files matched your search
@@ -68,20 +68,12 @@ func (r *Repository) CreateAuthMethod(ctx context.Context, am *AuthMethod, opt .
|
||||
}
|
||||
|
||||
if cv.BindCredential != nil {
|
||||
bc, ok := cv.BindCredential.(*BindCredential)
|
||||
if !ok {
|
||||
return nil, errors.New(ctx, errors.Internal, op, fmt.Sprintf("invalid type (%T) is not a bind credential", cv.BindCredential))
|
||||
}
|
||||
if err := bc.encrypt(ctx, dbWrapper); err != nil {
|
||||
if err := cv.BindCredential.encrypt(ctx, dbWrapper); err != nil {
|
||||
return nil, errors.Wrap(ctx, err, op, errors.WithMsg("failed to encrypt bind credential"))
|
||||
}
|
||||
}
|
||||
if cv.ClientCertificate != nil {
|
||||
cc, ok := cv.ClientCertificate.(*ClientCertificate)
|
||||
if !ok {
|
||||
return nil, errors.New(ctx, errors.Internal, op, fmt.Sprintf("invalid type (%T) is not a client certificate", cv.ClientCertificate))
|
||||
}
|
||||
if err := cc.encrypt(ctx, dbWrapper); err != nil {
|
||||
if err := cv.ClientCertificate.encrypt(ctx, dbWrapper); err != nil {
|
||||
return nil, errors.Wrap(ctx, err, op, errors.WithMsg("failed to encrypt client certificate"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user