proxy

package
v0.0.0-...-583cc2f Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHostNotConfigured = errors.New("acme/autocert: host not configured")

ErrHostNotConfigured indicates the hostname was not configured

Functions

func WithOAuthURI

func WithOAuthURI(baseURI string, oauthURI string) func(uri string) string

WithOAuthURI returns the oauth uri

func WithUMAIdentity

func WithUMAIdentity(
	req *http.Request,
	targetPath string,
	user *models.UserContext,
	cookieUMAName string,
	provider *oidc3.Provider,
	clientID string,
	skipClientIDCheck bool,
	skipIssuerCheck bool,
	getIdentity func(req *http.Request, tokenCookie string, tokenHeader string) (*models.UserContext, error),
	authzFunc func(targetPath string, userPerms models.Permissions) (authorization.AuthzDecision, error),
) (authorization.AuthzDecision, error)

Types

type OauthProxy

type OauthProxy struct {
	Provider  *oidc3.Provider
	Config    *config.Config
	Endpoint  *url.URL
	IdpClient *gocloak.GoCloak
	Listener  net.Listener
	Log       *zap.Logger

	Router http.Handler

	Server   *http.Server
	Store    storage.Storage
	Upstream reverseProxy

	GetIdentity  func(req *http.Request, tokenCookie string, tokenHeader string) (*models.UserContext, error)
	Cm           *cookie.Manager
	WithOAuthURI func(uri string) string
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(config *config.Config, log *zap.Logger, upstream reverseProxy) (*OauthProxy, error)

NewProxy create's a new proxy from configuration

func (*OauthProxy) CreateReverseProxy

func (r *OauthProxy) CreateReverseProxy() error

createReverseProxy creates a reverse proxy

func (*OauthProxy) NewOpenIDProvider

func (r *OauthProxy) NewOpenIDProvider() (*oidc3.Provider, *gocloak.GoCloak, error)

newOpenIDProvider initializes the openID configuration, note: the redirection url is deliberately left blank in order to retrieve it from the host header on request

func (*OauthProxy) Run

func (r *OauthProxy) Run() error

Run starts the proxy service

type OpenIDRoundTripper

type OpenIDRoundTripper struct {
	http.Header
	// contains filtered or unexported fields
}

func NewOpenIDRoundTripper

func NewOpenIDRoundTripper(rt http.RoundTripper) OpenIDRoundTripper

func (OpenIDRoundTripper) RoundTrip

func (r OpenIDRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type PAT

type PAT struct {
	Token *gocloak.JWT
	// contains filtered or unexported fields
}

type RPT

type RPT struct {
	Token string
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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