Documentation ¶
Index ¶
- Constants
- type Authorizer
- type ContextKey
- type Instancer
- type MetadataBasedAuthorizer
- func (s MetadataBasedAuthorizer) Configure(_ string, _ 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, _ ...string) (dbrole.DbRole, error)
- func (s MetadataBasedAuthorizer) GetOrgFromContext(ctx context.Context) (string, error)
- type SimpleInstancer
- type Tenancer
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")
)
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{}
func (MetadataBasedAuthorizer) Configure ¶
func (s MetadataBasedAuthorizer) Configure(_ string, _ 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
Click to show internal directories.
Click to hide internal directories.