rest

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BearerToken  tokenType = "Bearer"
	RefreshToken tokenType = "Refresh"
)

Variables

This section is empty.

Functions

func Validate added in v0.9.2

func Validate(str string) bool

Validate function that checks that whether a string consists of allowed characters or not

Types

type WebApiContext

type WebApiContext struct {
	Address              string
	Schema               string
	DataProvider         *managers.DataContext
	AuthDefs             *data.AuthenticationDefs
	Security             *services.SecurityService
	BruteforceProtection *bruteforce.ProtectionService
	TokenGenerator       *services.JwtGenerator
	Logger               *logging.AppLogger
}

WebApiContext is a central Application logic processor manages from Web via HTTP/HTTPS

func (*WebApiContext) GetOpenIdConfiguration added in v0.9.2

func (wCtx *WebApiContext) GetOpenIdConfiguration(c *gin.Context)

GetOpenIdConfiguration this function is a Http Request Handler that is responsible for getting available URL and some other configs related to OpenId @Summary Getting Info about Url and other config values @Description Getting Info about Url and other config values @Tags configuration @Accept json @Produce json @Param realm path string true "Realm" @Success 200 {object} dto.OpenIdConfiguration @Failure 400 {string} dto.ErrorDetails @Failure 404 {string} dto.ErrorDetails @Router /auth/realms/{realm}/.well-known/openid-configuration [get] @Router /realms/{realm}/.well-known/openid-configuration [get]

func (*WebApiContext) GetUserInfo

func (wCtx *WebApiContext) GetUserInfo(c *gin.Context)

GetUserInfo this function is a Http Request Handler that is responsible for getting public data.UserInfo @Summary Getting UserInfo by token @Description Getting UserInfo by token @Tags users @Accept json @Produce json @Param Authorization header string true "Bearer TOKEN" @Param realm path string true "Realm" @Success 200 {object} interface{} @Failure 400 {string} dto.ErrorDetails @Failure 401 {string} dto.ErrorDetails @Failure 404 {string} dto.ErrorDetails @Router /auth/realms/{realm}/protocol/openid-connect/userinfo [get] @Router /realms/{realm}/protocol/openid-connect/userinfo [get]

func (*WebApiContext) Introspect added in v0.1.3

func (wCtx *WebApiContext) Introspect(c *gin.Context)

Introspect - is a function that analyzes state of a token and getting some data from it @Summary Analyzes state of a token and getting some data from it @Description Analyzes state of a token and getting some data from it @Tags token @Accept json @Produce json @Param Authorization header string true "Basic client_id:client_secret as Base64 i.e. Basic V2lzc2FuY2VXZWJEZW1vOmZiNlo0UnNPYWRWeWNRb2VRaU41N3hwdTh3OHcxMTEx" @Param realm path string true "Realm" @Success 200 {object} dto.IntrospectTokenResult @Failure 400 {string} dto.ErrorDetails @Failure 401 {string} dto.ErrorDetails @Failure 404 {string} dto.ErrorDetails @Router /auth/realms/{realm}/protocol/openid-connect/token/introspect [post] @Router /realms/{realm}/protocol/openid-connect/token/introspect [post]

func (*WebApiContext) IssueNewToken

func (wCtx *WebApiContext) IssueNewToken(c *gin.Context)

IssueNewToken this function is a Http Request Handler that is responsible for issue New or Refresh existing tokens @Summary Issues new or Refreshes existing token @Description Issues new or Refreshes existing token @Tags token @Accept x-www-form-urlencoded @Produce json @Param function body dto.TokenGenerationData true "Token generation data" @Param realm path string true "Realm" @Success 200 {object} dto.Token @Failure 400 {string} dto.ErrorDetails @Failure 401 {string} dto.ErrorDetails @Failure 404 {string} dto.ErrorDetails @Router /auth/realms/{realm}/protocol/openid-connect/token [post] @Router /realms/{realm}/protocol/openid-connect/token [post]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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