Documentation ¶
Index ¶
- Variables
- func BuildRegistryURL(segments ...string) string
- func FilterAccess(username string, authenticated bool, a *token.ResourceActions)
- func GenTokenForUI(username, service, scope string) (string, error)
- func GetRepoFromCache() ([]string, error)
- func GetResourceActions(scope string) []*token.ResourceActions
- func MakeToken(username, service string, access []*token.ResourceActions) (string, error)
- func RefreshCatalogCache() error
- func RegistryAPIGet(url, username string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var Cache cache.Cache
Cache is the global cache in system.
Functions ¶
func FilterAccess ¶
func FilterAccess(username string, authenticated bool, a *token.ResourceActions)
FilterAccess modify the action list in access based on permission determine if the request needs to be authenticated.
func GenTokenForUI ¶
GenTokenForUI is for the UI process to call, so it won't establish a https connection from UI to proxy.
func GetRepoFromCache ¶
GetRepoFromCache get repository list from cache, it refreshes the cache if it's empty.
func GetResourceActions ¶
func GetResourceActions(scope string) []*token.ResourceActions
GetResourceActions ...
func MakeToken ¶
func MakeToken(username, service string, access []*token.ResourceActions) (string, error)
MakeToken makes a valid jwt token based on parms.
func RefreshCatalogCache ¶
func RefreshCatalogCache() error
RefreshCatalogCache calls registry's API to get repository list and write it to cache.
func RegistryAPIGet ¶
RegistryAPIGet triggers GET request to the URL which is the endpoint of registry and returns the response body. It will attach a valid jwt token to the request if registry requires.
Types ¶
This section is empty.