auth

package
v0.0.0-...-dbfd891 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: CC-BY-SA-4.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(config *HydraConfiguration) (token string, err error)

CreateToken creates an OAuth client and client credentials token, retrying while Hydra initializes

func NewHydraSDK

func NewHydraSDK(ctx context.Context, config *HydraConfiguration) (*hydra.CodeGenSDK, error)

NewHydraSDK returns a Hydra SDK

Types

type HydraConfiguration

type HydraConfiguration struct {
	AdminURL     string
	Authority    string
	PublicURL    string
	ClientID     string
	ClientSecret string
	Scopes       []string
}

HydraConfiguration is config for Hydra

type Server

type Server struct {
	HydraConfig *HydraConfiguration
}

Server implements the auth/v2alpha interface

func (*Server) Check

func (s *Server) Check(ctx context.Context, in *auth.CheckRequest) (*auth.CheckResponse, error)

Check does an auth header check and returns a 200 on auth, non-200 otherwise

type Transport

type Transport struct {
	Authority string
	TraceID   string
}

Transport adds host and trace headers to requests

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface It rewrites the host for Envoy forwarding and propogates a trace ID

Jump to

Keyboard shortcuts

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