Documentation ¶
Index ¶
- func GetProjectManager(req *http.Request) (promgr.ProjectManager, error)
- func GetSecurityContext(req *http.Request) (security.Context, error)
- func Init()
- func MediaTypeFilter(mediaType ...string) func(*beegoctx.Context)
- func ReadonlyFilter(ctx *context.Context)
- func SecurityFilter(ctx *beegoctx.Context)
- type ContextValueKey
- type ReqCtxModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProjectManager ¶
func GetProjectManager(req *http.Request) (promgr.ProjectManager, error)
GetProjectManager tries to get project manager from request and returns it
func GetSecurityContext ¶
GetSecurityContext tries to get security context from request and returns it
func MediaTypeFilter ¶
MediaTypeFilter filters the POST request, it returns 415 if the content type of the request doesn't match the preset ones.
func ReadonlyFilter ¶ added in v1.5.0
ReadonlyFilter filters the delete repo/tag request and returns 503.
func SecurityFilter ¶
SecurityFilter authenticates the request and passes a security context and a project manager with it which can be used to do some authN & authZ
Types ¶
type ContextValueKey ¶ added in v1.6.0
type ContextValueKey string
ContextValueKey for content value
const ( //SecurCtxKey is context value key for security context SecurCtxKey ContextValueKey = "harbor_security_context" //PmKey is context value key for the project manager PmKey ContextValueKey = "harbor_project_manager" )
type ReqCtxModifier ¶
ReqCtxModifier modifies the context of request
Click to show internal directories.
Click to hide internal directories.