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 ¶
ReadonlyFilter filters the deletion or creation (e.g. retag) of repo/tag requests 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 ¶
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 请求修改器,对传入的请求做一些修改,beegoctx.Context 中包含了 req 和 resp 的各种信息