Documentation ¶
Index ¶
Constants ¶
View Source
const ( PullAction = "pull" PushAction = "push" )
View Source
const (
AccessEntryType = "artifact-repository"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessEntry ¶
type Authorizer ¶
type Authorizer struct { Type AuthorizerType Realm string Service string BasicAuthMatchHeader string TokenDecoder *TokenDecoder AnonymousActions []string }
Authorizer is TODO
func NewAuthorizer ¶
func NewAuthorizer(opts *AuthorizerOptions) (*Authorizer, error)
NewAuthorizer is TODO
func (*Authorizer) Authorize ¶
func (authorizer *Authorizer) Authorize(authHeader string, action string, namespace string) (*Permission, error)
type AuthorizerOptions ¶
type AuthorizerOptions struct { Realm string Service string Username string Password string PublicKey []byte PublicKeyPath string AnonymousActions []string }
BasicAuthAuthorizerOptions is TODO
type AuthorizerType ¶
type AuthorizerType string
AuthorizerType is TODO
var ( DefaultNamespace = "repo" BasicAuthAuthorizerType AuthorizerType = "basic" BearerAuthAuthorizerType AuthorizerType = "bearer" )
type Claims ¶
type Claims struct { *jwt.StandardClaims Access []AccessEntry `json:"access"` }
type Permission ¶
Permission is TODO
type TokenDecoder ¶
func NewTokenDecoder ¶
func NewTokenDecoder(opts *TokenDecoderOptions) (*TokenDecoder, error)
func (*TokenDecoder) DecodeToken ¶
func (tokenDecoder *TokenDecoder) DecodeToken(signedString string) (*jwt.Token, error)
type TokenDecoderOptions ¶
type TokenGenerator ¶
type TokenGenerator struct {
PrivateKey *rsa.PrivateKey
}
func NewTokenGenerator ¶
func NewTokenGenerator(opts *TokenGeneratorOptions) (*TokenGenerator, error)
func (*TokenGenerator) GenerateToken ¶
func (tokenGenerator *TokenGenerator) GenerateToken(access []AccessEntry, expiration time.Duration) (string, error)
currently this only works with RSA key signing TODO: how best to handle many different signing algorithms?
type TokenGeneratorOptions ¶
Click to show internal directories.
Click to hide internal directories.