Documentation ¶
Index ¶
- Constants
- func CheckAccess(appSlug string, index int, GetOrg func(ctx context.Context) (int, error)) func(h http.Handler) http.Handler
- func CheckSpace(index int) func(h http.Handler) http.Handler
- func CheckSuperOrganisation(app string, GetOrganisation func(ctx context.Context) (int, error)) func(h http.Handler) http.Handler
- func CheckUser(h http.Handler) http.Handler
- func GetSpace(ctx context.Context) (int, error)
- func GetSuperOrganisationID(app string) (int, error)
- func GetUser(ctx context.Context) (int, error)
- func GormRequestID(db **gorm.DB) func(h http.Handler) http.Handler
- func ValidateAPIToken(header, appName string, GetOrganisation func(ctx context.Context) (int, error)) func(h http.Handler) http.Handler
- type KetoPolicy
- type KetoRelationTuple
- type KetoResponse
- type ValidationBody
Constants ¶
View Source
const SpaceIDKey ctxKeySpaceID = 0
SpaceIDKey is the key that holds the unique space ID in a request context.
View Source
const UserIDKey ctxKeyUserID = 0
UserIDKey is the key that holds the unique user ID in a request context.
Variables ¶
This section is empty.
Functions ¶
func CheckAccess ¶
func CheckAccess(appSlug string, index int, GetOrg func(ctx context.Context) (int, error)) func(h http.Handler) http.Handler
CheckAccess middleware to check if user can access the application
func CheckSpace ¶
CheckSpace check X-Space in header
func CheckSuperOrganisation ¶
func CheckSuperOrganisation(app string, GetOrganisation func(ctx context.Context) (int, error)) func(h http.Handler) http.Handler
CheckSuperOrganisation checks weather organisation of user is super org or not
func GetSuperOrganisationID ¶
GetSuperOrganisationID get superorganisation id from keto policy
func GormRequestID ¶
GormRequestID returns middleware to add request_id in gorm context
Types ¶
type KetoPolicy ¶
type KetoPolicy struct { ID string `json:"id"` Subjects []string `json:"subjects"` Actions []string `json:"actions"` Resources []string `json:"resources"` Effect string `json:"effect"` Description string `json:"description"` }
KetoPolicy model
type KetoRelationTuple ¶ added in v0.0.80
type KetoResponse ¶ added in v0.0.82
type KetoResponse struct {
Tuples []KetoRelationTuple `json:"relation_tuples"`
}
type ValidationBody ¶
type ValidationBody struct {
Token string `json:"token" validate:"required"`
}
Click to show internal directories.
Click to hide internal directories.