auth

package
v1.9.0-industry.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Service = "tke"
	Issuer  = "tke-registry-token-issuer"
)
View Source
const Path = "/registry/auth"

Path is the authorization server url for distribution.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts *Options) (http.Handler, error)

NewHandler creates a new handler object and returns it.

Types

type Options

type Options struct {
	SecurityConfig    *registryconfig.Security
	TokenReviewCAFile string
	TokenReviewPath   string
	DomainSuffix      string
	DefaultTenant     string
	LoopbackConfig    *restclient.Config
}

Options defines the configuration of distribution auth handler.

type Token

type Token struct {
	Token       string `json:"token"`
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	IssuedAt    string `json:"issued_at"`
}

Token represents the json returned by registry token service

func MakeToken added in v1.9.1

func MakeToken(username string, access []*token.ResourceActions, expiredHours int64, privateKey libtrust.PrivateKey) (*Token, error)

makeToken makes a valid jwt token based on params.

func (*Token) GetToken added in v1.9.1

func (t *Token) GetToken() string

GetToken returns the content of the token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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