Documentation ¶
Index ¶
- func DisableCache(w http.ResponseWriter)
- func EnableCors(w http.ResponseWriter)
- func HandlePagination(handler PaginatedHandlerFunc) http.HandlerFunc
- func RequireActivityPubOrRedirect(handler http.HandlerFunc) http.HandlerFunc
- func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc
- func RequireExternalAPIAccessToken(scope string, handler ExternalAccessTokenHandlerFunc) http.HandlerFunc
- func RequireUserAccessToken(handler UserAccessTokenHandlerFunc) http.HandlerFunc
- func RequireUserModerationScopeAccesstoken(handler http.HandlerFunc) http.HandlerFunc
- func SetCachingHeaders(w http.ResponseWriter, r *http.Request)
- func SetHeaders(w http.ResponseWriter, nonce string)
- type ExternalAccessTokenHandlerFunc
- type PaginatedHandlerFunc
- type UserAccessTokenHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableCache ¶
func DisableCache(w http.ResponseWriter)
DisableCache writes the disable cache header on the responses.
func EnableCors ¶
func EnableCors(w http.ResponseWriter)
EnableCors enables the CORS header on the responses.
func HandlePagination ¶ added in v0.0.12
func HandlePagination(handler PaginatedHandlerFunc) http.HandlerFunc
HandlePagination is a middleware handler that pulls pagination values and passes them along.
func RequireActivityPubOrRedirect ¶ added in v0.0.11
func RequireActivityPubOrRedirect(handler http.HandlerFunc) http.HandlerFunc
RequireActivityPubOrRedirect will validate the requested content types and redirect to the main Owncast page if it doesn't match.
func RequireAdminAuth ¶
func RequireAdminAuth(handler http.HandlerFunc) http.HandlerFunc
RequireAdminAuth wraps a handler requiring HTTP basic auth for it using the given the stream key as the password and and a hardcoded "admin" for username.
func RequireExternalAPIAccessToken ¶ added in v0.0.8
func RequireExternalAPIAccessToken(scope string, handler ExternalAccessTokenHandlerFunc) http.HandlerFunc
RequireExternalAPIAccessToken will validate a 3rd party access token.
func RequireUserAccessToken ¶ added in v0.0.8
func RequireUserAccessToken(handler UserAccessTokenHandlerFunc) http.HandlerFunc
RequireUserAccessToken will validate a provided user's access token and make sure the associated user is enabled. Not to be used for validating 3rd party access.
func RequireUserModerationScopeAccesstoken ¶ added in v0.0.11
func RequireUserModerationScopeAccesstoken(handler http.HandlerFunc) http.HandlerFunc
RequireUserModerationScopeAccesstoken will validate a provided user's access token and make sure the associated user is enabled and has "MODERATOR" scope assigned to the user.
func SetCachingHeaders ¶
func SetCachingHeaders(w http.ResponseWriter, r *http.Request)
SetCachingHeaders will set the cache control header of a response.
func SetHeaders ¶ added in v0.0.9
func SetHeaders(w http.ResponseWriter, nonce string)
SetHeaders will set our global headers for web resources.
Types ¶
type ExternalAccessTokenHandlerFunc ¶ added in v0.0.8
type ExternalAccessTokenHandlerFunc func(user.ExternalAPIUser, http.ResponseWriter, *http.Request)
ExternalAccessTokenHandlerFunc is a function that is called after validing access.
type PaginatedHandlerFunc ¶ added in v0.0.12
PaginatedHandlerFunc is a handler for endpoints that require pagination.
type UserAccessTokenHandlerFunc ¶ added in v0.0.12
UserAccessTokenHandlerFunc is a function that is called after validing user access.