auth

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationMode

type AuthenticationMode string
const (
	TokenAuth AuthenticationMode = "token"
	CertAuth  AuthenticationMode = "cert"
)

type Client

type Client interface {
	Login() (*Credentials, error)
}

func NewClient

func NewClient(config *rest.Config, url string) Client

type Credentials

type Credentials struct {
	User struct {
		Name   string   `json:"name"`
		Groups []string `json:"groups"`
		// Token is an ID token containing user info and capabilities loaded at login
		Token string `json:"token"`
		// WrappedToken is a very short lifetime encrypted token that wraps the ID token.
		// It's for cases where the token must be exposed as HTTP GET parameters over a
		// secure connection where the token will available in access logs and/or browser
		// history which would mean a potential security risk.
		WrappedToken string `json:"wrappedToken"`
	} `json:"user"`
}

type RequestBody

type RequestBody struct {
	Mode       AuthenticationMode `json:"mode"`
	Token      string             `json:"token,omitempty"`
	ClientCert struct {
		// base64 encoded client key
		Key string `json:"key"`
		// base64 encoded client cert
		Cert string `json:"cert"`
	} `json:"cert,omitempty"`
}

Jump to

Keyboard shortcuts

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