server

package
v0.0.0-...-af68207 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package server contains implementation of REST API server (HTTPServer) for the LDAP proxy.

Generated documentation is available at: https://godoc.org/github.com/RedHatInsights/insights-operator-ldapauth/server

Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-operator-ldapauth/packages/server/server.html

Index

Constants

This section is empty.

Variables

View Source
var APIPrefix = env.GetEnv("CONTROLLER_PREFIX", "/api/v1/")

APIPrefix is appended before all REST API endpoint addresses

View Source
var OkStatus = Status{
	Status: "ok",
}

OkStatus prepared successful response

Functions

This section is empty.

Types

type Server

type Server struct {
	Address     string
	LDAP        string
	Proxy       string
	ProxyPrefix string
	Transport   http.RoundTripper
}

Server basic configuration of server

func (*Server) HandleHTTP

func (s *Server) HandleHTTP(w http.ResponseWriter, req *http.Request)

HandleHTTP handle all routes, used for proxying them to controller

func (*Server) Initialize

func (s *Server) Initialize()

Initialize main function that start server

func (*Server) JWTAuthentication

func (s *Server) JWTAuthentication(next http.Handler) http.Handler

JWTAuthentication - middleware for authenticate user by Token

func (*Server) Login

func (s *Server) Login(writer http.ResponseWriter, request *http.Request)

Login handler for login route

type Status

type Status struct {
	Status string `json:"status"`
}

Status structure for RestAPI response

Jump to

Keyboard shortcuts

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