Remove platform tenancy from SXCHNGE customer BFF (#34)
This commit is contained in:
1 parent
7062672a87
commit
981e84a4b4
244 files changed
+651
-17130
No files matched your search
@@ -1,12 +1,8 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/auth"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/account"
|
||||
mongoimpl "git.sendico.io/tech/sxchnge/bff/pkg/db/internal/mongo"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/invitation"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/policy"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/role"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/db/transaction"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/merrors"
|
||||
"git.sendico.io/tech/sxchnge/bff/pkg/mlogger"
|
||||
@@ -16,15 +12,9 @@ import (
|
||||
type Factory interface {
|
||||
NewAccountDB() (account.DB, error)
|
||||
NewAccountDBWithCollection(collection string) (account.DB, error)
|
||||
NewInvitationsDB() (invitation.DB, error)
|
||||
|
||||
NewRolesDB() (role.DB, error)
|
||||
NewPoliciesDB() (policy.DB, error)
|
||||
|
||||
TransactionFactory() transaction.Factory
|
||||
|
||||
Permissions() auth.Provider
|
||||
|
||||
CloseConnection()
|
||||
}
|
||||
|
||||
@@ -38,16 +28,3 @@ func NewConnection(logger mlogger.Logger, config *Config) (Factory, error) {
|
||||
}
|
||||
return nil, merrors.InvalidArgument("unknown database driver: "+string(config.Driver), "config.driver")
|
||||
}
|
||||
|
||||
// NewCentralPermissionsConnection opens the explicitly configured central
|
||||
// permissions database. It intentionally has no fallback to a service domain DB.
|
||||
func NewCentralPermissionsConnection(logger mlogger.Logger, config *PermissionsDatabaseConfig) (Factory, error) {
|
||||
if config == nil {
|
||||
return nil, merrors.InvalidArgument("permissions_database configuration is required", "permissions_database")
|
||||
}
|
||||
conn, err := NewConnection(logger, config.AsDatabaseConfig())
|
||||
if err != nil {
|
||||
return nil, merrors.Wrap(err, "permissions_database")
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
Reference in new issue
Block a user