authn

package
v0.0.0-...-b9fdcee Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0, BSD-2-Clause, MIT Imports: 20 Imported by: 0

Documentation

Overview

Package classification Virtual Security Module

User Management and Authentication API

BasePath: /

swagger:meta

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Index

Constants

View Source
const (
	HeaderNameAuth = "Authorization"
	LoginPath      = "/login"
	UsersPath      = "/users"
)
View Source
const FIXED = "builtin-challenge"

Variables

View Source
var AuthnProviderRegistrar *authnProviderRegistrar = newRegistrar()

singleton registrar for authN providers

Functions

This section is empty.

Types

type AuthnManager

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

func New

func New() *AuthnManager

func (*AuthnManager) Close

func (authNManager *AuthnManager) Close() error

func (*AuthnManager) CreateUser

func (authnManager *AuthnManager) CreateUser(ctx gocontext.Context, userEntry *model.UserEntry) (string, error)

func (*AuthnManager) DeleteUser

func (authnManager *AuthnManager) DeleteUser(ctx gocontext.Context, username string) error

func (*AuthnManager) GetUser

func (authnManager *AuthnManager) GetUser(ctx gocontext.Context, username string) (*model.UserEntry, error)

func (*AuthnManager) HandlePre

func (authNManager *AuthnManager) HandlePre(w http.ResponseWriter, r *http.Request) *http.Request

func (*AuthnManager) Init

func (authnManager *AuthnManager) Init(moduleInitContext *context.ModuleInitContext) error

func (*AuthnManager) Login

func (authnManager *AuthnManager) Login(l *model.LoginRequest) (string, error)

func (*AuthnManager) RegisterEndpoints

func (authnManager *AuthnManager) RegisterEndpoints(mux *denco.Mux) []denco.Handler

func (*AuthnManager) Type

func (authnManager *AuthnManager) Type() string

type AuthnProvider

type AuthnProvider interface {
	Init(*config.Config, vds.DataStoreAdapter, *vks.VirtualKeyStore) error
	Authenticated(r *http.Request) (username string, e error)
	Login(l *model.LoginRequest) (token string, e error)
	CreateUser(*model.UserEntry) (string, error)
	DeleteUser(username string) error
	GetUser(username string) (*model.UserEntry, error)
	Type() string
}

type BuiltinChallenge

type BuiltinChallenge struct {
	Fixed     string
	Username  string
	Random    []byte
	GoodUntil time.Time
}

func NewBuiltinChallenge

func NewBuiltinChallenge(username string) (*BuiltinChallenge, error)

func NewFakeBuiltinChallenge

func NewFakeBuiltinChallenge(username string) (*BuiltinChallenge, error)

func (*BuiltinChallenge) Decode

func (challenge *BuiltinChallenge) Decode(encodedChallenge []byte) error

func (*BuiltinChallenge) Encode

func (challenge *BuiltinChallenge) Encode() ([]byte, error)

func (*BuiltinChallenge) Equal

func (challenge *BuiltinChallenge) Equal(challenge2 *BuiltinChallenge) bool

func (*BuiltinChallenge) Expired

func (challenge *BuiltinChallenge) Expired() bool

func (*BuiltinChallenge) Valid

func (challenge *BuiltinChallenge) Valid() bool

type BuiltinProvider

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

func NewBuiltinProvider

func NewBuiltinProvider() *BuiltinProvider

func (*BuiltinProvider) Authenticated

func (p *BuiltinProvider) Authenticated(r *http.Request) (username string, e error)

func (*BuiltinProvider) CreateUser

func (p *BuiltinProvider) CreateUser(userEntry *model.UserEntry) (string, error)

func (*BuiltinProvider) DeleteUser

func (p *BuiltinProvider) DeleteUser(username string) error

func (*BuiltinProvider) GetUser

func (p *BuiltinProvider) GetUser(username string) (*model.UserEntry, error)

func (*BuiltinProvider) Init

func (*BuiltinProvider) Login

func (p *BuiltinProvider) Login(l *model.LoginRequest) (token string, e error)

func (*BuiltinProvider) Type

func (p *BuiltinProvider) Type() string

type LoginParam

type LoginParam struct {
	// in:body
	LoginReq model.LoginRequest
}

swagger:parameters Login

type LoginResp

type LoginResp struct {
	// in:body
	LoginResp model.LoginResponse
}

swagger:response LoginResp

type UserCreationResponse

type UserCreationResponse struct {
	// in:body
	Body struct {
		UserId string
	}
}

swagger:response UserCreationResponse

type UserEntryParam

type UserEntryParam struct {
	// in:body
	UserEntry model.UserEntry
}

swagger:parameters CreateUser

type UserEntryResponse

type UserEntryResponse struct {
	// in:body
	UserEntry model.UserEntry
}

swagger:response UserEntryResponse

Jump to

Keyboard shortcuts

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