Documentation ¶
Index ¶
- func AuthorizeAdmin(next http.Handler) http.Handler
- func AuthorizeUser(next http.Handler) http.Handler
- func CheckAccess(read, write, admin bool) func(http.Handler) http.Handler
- func CheckAdminAccess() func(http.Handler) http.Handler
- func CheckMembership(service core.OrganizationService, admin bool) func(http.Handler) http.Handler
- func CheckReadAccess() func(http.Handler) http.Handler
- func CheckWriteAccess() func(http.Handler) http.Handler
- func InjectRepository(repoz core.RepositoryService, repos core.RepositoryStore, perms core.PermStore) func(http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizeAdmin ¶
AuthorizeAdmin returns an http.Handler middleware that authorizes only system administrators to proceed to the next handler in the chain.
func AuthorizeUser ¶
AuthorizeUser returns an http.Handler middleware that authorizes only authenticated users to proceed to the next handler in the chain. Guest users are rejected with a 401 unauthorized error.
func CheckAccess ¶
CheckAccess returns an http.Handler middleware that authorizes only authenticated users with the required read, write or admin access permissions to the requested repository resource.
func CheckAdminAccess ¶
CheckAdminAccess returns an http.Handler middleware that authorizes only authenticated users with admin repository access to proceed to the next handler in the chain.
func CheckMembership ¶
CheckMembership returns an http.Handler middleware that authorizes only authenticated users with the required membership to an organization to the requested repository resource.
func CheckReadAccess ¶
CheckReadAccess returns an http.Handler middleware that authorizes only authenticated users with read repository access to proceed to the next handler in the chain.
func CheckWriteAccess ¶
CheckWriteAccess returns an http.Handler middleware that authorizes only authenticated users with write repository access to proceed to the next handler in the chain.
func InjectRepository ¶
func InjectRepository( repoz core.RepositoryService, repos core.RepositoryStore, perms core.PermStore, ) func(http.Handler) http.Handler
InjectRepository returns an http.Handler middleware that injects the repository and repository permissions into the context.
Types ¶
This section is empty.