secret

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 3 Imported by: 162

Documentation

Index

Constants

View Source
const (
	// AdminserverUser is the name of adminserver user
	AdminserverUser = "harbor-adminserver"
	// JobserviceUser is the name of jobservice user
	JobserviceUser = "harbor-jobservice"
	// CoreUser is the name of ui user
	CoreUser = "harbor-core"
)
View Source
const HeaderPrefix = "Harbor-Secret "

HeaderPrefix is the prefix of the value of Authorization header. It has the space.

Variables

This section is empty.

Functions

func AddToRequest added in v1.5.0

func AddToRequest(req *http.Request, secret string) error

AddToRequest add the secret to request

func FromRequest added in v1.5.0

func FromRequest(req *http.Request) string

FromRequest tries to get Harbor Secret from request header. It will return empty string if the reqeust is nil.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store the secrets and provides methods to validate secrets

func NewStore

func NewStore(secrets map[string]string) *Store

NewStore ...

func (*Store) GetUsername

func (s *Store) GetUsername(secret string) string

GetUsername returns the corresponding username of the secret

func (*Store) IsValid

func (s *Store) IsValid(secret string) bool

IsValid returns whether the secret is valid

Jump to

Keyboard shortcuts

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