traefik_rpthandler

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 8 Imported by: 0

README

Traefik rpt handler plugin

This traefik plugin middleware replaces the access token present in the http headers by a request to an endpoint (in our case keycloak) that returns an RPT Token.

Documentation

Overview

Package rpthandler plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

New created a new RptHandler plugin.

Types

type Config

type Config struct {
	Keycloak string
	Audience string
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type RptHandler

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

func (*RptHandler) ServeHTTP

func (a *RptHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type RptTokenBody

type RptTokenBody struct {
	Upgraded           bool
	Access_token       string
	Expires_in         int
	Refresh_expires_in int
	Refresh_token      string
	Token_type         string
	Not_before_policy  int
	Error              string
}

Jump to

Keyboard shortcuts

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