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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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