Documentation ¶
Index ¶
- Constants
- type Authorizer
- type ContextKey
- type Instancer
- type MetadataBasedAuthorizer
- func (s *MetadataBasedAuthorizer) Configure(tableName string, roleMapping map[string]dbrole.DbRole)
- func (s *MetadataBasedAuthorizer) GetAuthContext(orgId string, roles ...string) context.Context
- func (s *MetadataBasedAuthorizer) GetDefaultOrgAdminContext() context.Context
- func (s *MetadataBasedAuthorizer) GetMatchingDbRole(ctx context.Context, tableNames ...string) (dbrole.DbRole, error)
- func (s *MetadataBasedAuthorizer) GetOrgFromContext(ctx context.Context) (string, error)
- type SimpleInstancer
- type SimpleTransactionFetcher
- type Tenancer
- type TransactionContextKey
- type TransactionFetcher
Constants ¶
View Source
const ( GLOBAL_DEFAULT_ORG_ID = "_GlobalDefaultOrg" METADATA_KEY_ORGID = "orgid" METADATA_KEY_ROLE = "role" METADATA_ROLE_SERVICE_ADMIN = "service_admin" METADATA_ROLE_SERVICE_AUDITOR = "service_auditor" METADATA_ROLE_ADMIN = "admin" // can be tenant_admin, *_admin METADATA_ROLE_AUDITOR = "auditor" // can be tenant_auditor, *_auditor )
View Source
const (
INSTANCE_ID = ContextKey("multiinstance.id")
)
View Source
const (
TransactionCtx = TransactionContextKey("DB_TRANSACTION")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface { Tenancer Configure(tableName string, roleMapping map[string]dbrole.DbRole) GetAuthContext(orgId string, roles ...string) context.Context GetDefaultOrgAdminContext() context.Context GetMatchingDbRole(ctx context.Context, tableNames ...string) (dbrole.DbRole, error) }
Authorizer Interface defines the methods required for datastore to restrict access based on roles configured in context.
type ContextKey ¶ added in v0.0.5
type ContextKey string
type MetadataBasedAuthorizer ¶
type MetadataBasedAuthorizer struct {
// contains filtered or unexported fields
}
func (*MetadataBasedAuthorizer) Configure ¶
func (s *MetadataBasedAuthorizer) Configure(tableName string, roleMapping map[string]dbrole.DbRole)
func (*MetadataBasedAuthorizer) GetAuthContext ¶
func (s *MetadataBasedAuthorizer) GetAuthContext(orgId string, roles ...string) context.Context
func (*MetadataBasedAuthorizer) GetDefaultOrgAdminContext ¶
func (s *MetadataBasedAuthorizer) GetDefaultOrgAdminContext() context.Context
func (*MetadataBasedAuthorizer) GetMatchingDbRole ¶
func (*MetadataBasedAuthorizer) GetOrgFromContext ¶
func (s *MetadataBasedAuthorizer) GetOrgFromContext(ctx context.Context) (string, error)
type SimpleInstancer ¶ added in v0.0.5
type SimpleInstancer struct{}
func (*SimpleInstancer) GetInstanceId ¶ added in v0.0.5
func (s *SimpleInstancer) GetInstanceId(ctx context.Context) (string, error)
func (*SimpleInstancer) WithInstanceId ¶ added in v0.0.5
type SimpleTransactionFetcher ¶ added in v0.0.9
type SimpleTransactionFetcher struct{}
func (SimpleTransactionFetcher) GetTransactionCtx ¶ added in v0.0.9
func (s SimpleTransactionFetcher) GetTransactionCtx(ctx context.Context) *gorm.DB
func (SimpleTransactionFetcher) IsTransactionCtx ¶ added in v0.0.9
func (s SimpleTransactionFetcher) IsTransactionCtx(ctx context.Context) bool
func (SimpleTransactionFetcher) WithTransactionCtx ¶ added in v0.0.9
type TransactionContextKey ¶ added in v0.0.9
type TransactionContextKey string
Click to show internal directories.
Click to hide internal directories.