authentication

package
v0.0.0-...-9be813a Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package authentication implements authentication mechanisms.

The Transparent Key Server is designed to be used by identity providers - IdP in OAuth parlance. OAuth2 Access Tokens may be provided as authentication information, which can be resolved to user information and associated scopes on the backend.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingAuth occurs when authentication information is missing.
	ErrMissingAuth = errors.New("auth: missing authentication header")
)

Functions

func GetFakeCredential

func GetFakeCredential(userID string) credentials.PerRPCCredentials

GetFakeCredential returns fake PerRPCCredentials

Types

type Authenticator

type Authenticator interface {
	// ValidateCreds authenticate the information present in ctx.
	ValidateCreds(ctx context.Context) (*SecurityContext, error)
}

Authenticator provides services to authenticate users.

type FakeAuth

type FakeAuth struct{}

FakeAuth provides a fake authenticator for testing.

func NewFake

func NewFake() *FakeAuth

NewFake returns a new authenticator.

func (*FakeAuth) ValidateCreds

func (a *FakeAuth) ValidateCreds(ctx context.Context) (*SecurityContext, error)

ValidateCreds authenticate the information present in ctx.

type SecurityContext

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

SecurityContext contains information generated by the authentication module.

func NewSecurityContext

func NewSecurityContext(identity string) *SecurityContext

NewSecurityContext creates a new SecurityContext given an identity.

func (*SecurityContext) Identity

func (c *SecurityContext) Identity() string

Identity returns the identity of the current security context.

Jump to

Keyboard shortcuts

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