mirror of
https://github.com/project-zot/zot.git
synced 2025-01-06 22:40:28 -05:00
19 lines
391 B
Go
19 lines
391 B
Go
|
package requestcontext
|
||
|
|
||
|
type Key int
|
||
|
|
||
|
// request-local context key.
|
||
|
var authzCtxKey = Key(0) // nolint: gochecknoglobals
|
||
|
|
||
|
// pointer needed for use in context.WithValue.
|
||
|
func GetContextKey() *Key {
|
||
|
return &authzCtxKey
|
||
|
}
|
||
|
|
||
|
// AccessControlContext context passed down to http.Handlers.
|
||
|
type AccessControlContext struct {
|
||
|
GlobPatterns map[string]bool
|
||
|
IsAdmin bool
|
||
|
Username string
|
||
|
}
|