handlers

package
v0.0.0-...-7296e1c Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMyAccountHandler

func GetMyAccountHandler(w http.ResponseWriter, r *http.Request)

GetMyAccountHandler retrieves the user information from the OIDC context and responds with the user details.

If the user is not found in the context or an error occurs, an HTTP 401 Unauthorized error is returned.

func GetMyPgRoleHandler

func GetMyPgRoleHandler() http.HandlerFunc

func GetSimpleAuthzHandler

func GetSimpleAuthzHandler(w http.ResponseWriter, r *http.Request)

GetSimpleAuthzHandler performs an authorization check based on a requested /endpoint/{claim}/{value} path eg `GET /endpoint/editor/true` will check if the user has the claim `editor` with the value `true` The response is an `AuthzResponse` object indicating whether the user is authorized (Allowed: true) or not (Allowed: false)

func HealthHandler

func HealthHandler(w http.ResponseWriter, r *http.Request)

HealthHandler returns the request ID as a plain text response with a 200 OK status code.

Types

type AuthzResponse

type AuthzResponse struct {
	Allowed bool `json:"allowed"`
}

Jump to

Keyboard shortcuts

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