Documentation
¶
Index ¶
- type GenericRestService
- type JWTService
- func (jwtService *JWTService) CreateSession(w http.ResponseWriter, r *http.Request) (service.Session, error)
- func (jwtService *JWTService) GenerateToken(w http.ResponseWriter, req *http.Request)
- func (jwtService *JWTService) RefreshToken(w http.ResponseWriter, req *http.Request)
- func (jwtService *JWTService) Validate(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- type JsonWebToken
- type JsonWebTokenClaims
- type JsonWebTokenServicer
- type RestRegistry
- type RestService
- type RestServiceRegistry
- type SystemRestService
- func (restService *SystemRestService) Certificate(w http.ResponseWriter, r *http.Request)
- func (restService *SystemRestService) Config(w http.ResponseWriter, r *http.Request)
- func (restService *SystemRestService) Endpoints(w http.ResponseWriter, r *http.Request)
- func (restService *SystemRestService) EventsPage(w http.ResponseWriter, r *http.Request)
- func (restService *SystemRestService) PublicKey(w http.ResponseWriter, r *http.Request)
- func (restService *SystemRestService) Status(w http.ResponseWriter, r *http.Request)
- type SystemRestServicer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenericRestService ¶
type GenericRestService[E any] struct { SystemRestService // contains filtered or unexported fields }
type JWTService ¶
type JWTService struct {
JsonWebTokenServicer
middleware.JsonWebTokenMiddleware
// contains filtered or unexported fields
}
func (*JWTService) CreateSession ¶
func (jwtService *JWTService) CreateSession(w http.ResponseWriter, r *http.Request) (service.Session, error)
Creates a new web service session by parsing the organization and Service from the JWT Claims and creating a service.Session object that represents the user and their organization and Service membership.
func (*JWTService) GenerateToken ¶
func (jwtService *JWTService) GenerateToken(w http.ResponseWriter, req *http.Request)
func (*JWTService) RefreshToken ¶
func (jwtService *JWTService) RefreshToken(w http.ResponseWriter, req *http.Request)
func (*JWTService) Validate ¶
func (jwtService *JWTService) Validate(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Validates the raw JWT token to ensure it's not expired or contains any invalid claims. This is used by the negroni middleware to enforce authenticated access to procted resources.
type JsonWebToken ¶
type JsonWebTokenClaims ¶
type JsonWebTokenServicer ¶
type JsonWebTokenServicer interface {
ParseToken(r *http.Request, extractor request.Extractor) (*jwt.Token, *JsonWebTokenClaims, error)
middleware.AuthMiddleware
middleware.JsonWebTokenMiddleware
}
func CreateJsonWebTokenService ¶
func CreateJsonWebTokenService( app *app.App, responseWriter response.HttpWriter, expiration int, keyAttributes *keystore.KeyAttributes, keystore keystore.KeyStorer) (JsonWebTokenServicer, error)
Createa a new JsonWebBokenService with custom expiration
func NewJsonWebTokenService ¶
func NewJsonWebTokenService( app *app.App, keyAttributes *keystore.KeyAttributes, keystore keystore.KeyStorer, responseWriter response.HttpWriter) (JsonWebTokenServicer, error)
Creates a new JsonWebTokenService with default configuration
type RestRegistry ¶
type RestRegistry struct {
RestServiceRegistry
// contains filtered or unexported fields
}
func (*RestRegistry) JsonWebTokenService ¶
func (registry *RestRegistry) JsonWebTokenService() JsonWebTokenServicer
func (*RestRegistry) SystemRestService ¶
func (registry *RestRegistry) SystemRestService() SystemRestServicer
type RestService ¶
type RestServiceRegistry ¶
type RestServiceRegistry interface {
JsonWebTokenService() JsonWebTokenServicer
SystemRestService() SystemRestServicer
}
func NewRestServiceRegistry ¶
func NewRestServiceRegistry(app *app.App) RestServiceRegistry
type SystemRestService ¶
type SystemRestService struct {
SystemRestServicer
// contains filtered or unexported fields
}
func (*SystemRestService) Certificate ¶
func (restService *SystemRestService) Certificate(w http.ResponseWriter, r *http.Request)
Writes the web server x509 certificate in PEM form
func (*SystemRestService) Config ¶
func (restService *SystemRestService) Config(w http.ResponseWriter, r *http.Request)
Writes the application configuration
func (*SystemRestService) Endpoints ¶
func (restService *SystemRestService) Endpoints(w http.ResponseWriter, r *http.Request)
Writes a list of webservice REST and WebSocket endpoints
func (*SystemRestService) EventsPage ¶
func (restService *SystemRestService) EventsPage(w http.ResponseWriter, r *http.Request)
Writes a page of system event log entries
func (*SystemRestService) PublicKey ¶
func (restService *SystemRestService) PublicKey(w http.ResponseWriter, r *http.Request)
Writes the web server public key in PEM form
func (*SystemRestService) Status ¶
func (restService *SystemRestService) Status(w http.ResponseWriter, r *http.Request)
Writes the current system status and metrics
type SystemRestServicer ¶
type SystemRestServicer interface {
Config(w http.ResponseWriter, r *http.Request)
Certificate(w http.ResponseWriter, r *http.Request)
Endpoints(w http.ResponseWriter, r *http.Request)
EventsPage(w http.ResponseWriter, r *http.Request)
PublicKey(w http.ResponseWriter, r *http.Request)
Status(w http.ResponseWriter, r *http.Request)
}
func NewSystemRestService ¶
func NewSystemRestService( app *app.App, httpWriter response.HttpWriter, endpointList *[]string) SystemRestServicer