rest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 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

Checks that the string consists of allowed characters.

Types

type WebApiContext

type WebApiContext struct {
	Address        string
	Schema         string
	DataProvider   *managers.DataContext
	AuthDefs       *data.AuthenticationDefs
	Security       *services.SecurityService
	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(respWriter http.ResponseWriter, request *http.Request)

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(respWriter http.ResponseWriter, request *http.Request)

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(respWriter http.ResponseWriter, request *http.Request)

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(respWriter http.ResponseWriter, request *http.Request)

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]

Jump to

Keyboard shortcuts

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