token

package
v0.0.0-...-e33f0fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Notary service
	Notary = "harbor-notary"
	// Registry service
	Registry = "harbor-registry"
)

Variables

This section is empty.

Functions

func GetResourceActions

func GetResourceActions(scopes []string) []*token.ResourceActions

GetResourceActions ...

func InitCreators

func InitCreators()

InitCreators initialize the token creators for different services

func MakeToken

func MakeToken(username, service string, access []*token.ResourceActions) (*models.Token, error)

MakeToken makes a valid jwt token based on parms.

Types

type Creator

type Creator interface {
	Create(r *http.Request) (*models.Token, error)
}

Creator creates a token ready to be served based on the http request.

type Handler

type Handler struct {
	beego.Controller
}

Handler handles request on /service/token, which is the auth provider for registry.

func (*Handler) Get

func (h *Handler) Get()

Get handles GET request, it checks the http header for user credentials and parse service and scope based on docker registry v2 standard, checkes the permission agains local DB and generates jwt token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL