Documentation ¶
Index ¶
- func AuthedRequest(req *http.Request) *http.Request
- func CorsMiddleware(ctx huma.Context, next func(huma.Context))
- func Error424FailedDependency(msg string, code int, errs ...error) huma.StatusError
- func FailOnError(err error, msg string)
- func GetDelLogTags(msg *amqp.Delivery) string
- func GetEnv(key, fallback string) string
- func LoadConfig()
- func LogResponse(ctx context.Context, resp *http.Response, req *http.Request)
- func LogWithContext(ctx context.Context, msg ...string)
- func MockLoadConfig()
- func OidcMiddleware(ctx huma.Context, next func(huma.Context))
- func PrettyPrint(i interface{}) string
- func RegisterOidcProvider(ctx context.Context)
- func TraceTags(ctx context.Context) string
- type ClientClaims
- type ConfigValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorsMiddleware ¶
func CorsMiddleware(ctx huma.Context, next func(huma.Context))
func Error424FailedDependency ¶
Error424UnprocessableEntity returns a 424.
func FailOnError ¶
func GetDelLogTags ¶
func LoadConfig ¶
func LoadConfig()
LoadConfig loads and validates the configuration from a .env and environment variables
func LogWithContext ¶
Logs the message and appends span/traceId tags from the passed context
func MockLoadConfig ¶
func MockLoadConfig()
func OidcMiddleware ¶
func OidcMiddleware(ctx huma.Context, next func(huma.Context))
func PrettyPrint ¶
func PrettyPrint(i interface{}) string
func RegisterOidcProvider ¶
Types ¶
type ClientClaims ¶
type ClientClaims struct { //The user id Uid string `json:"sub"` Groups []string `json:"groups"` jwt.RegisteredClaims }
func Authorize ¶
func Authorize(w http.ResponseWriter, r *http.Request, allowedMethods []string, requiredScope string) (claims *ClientClaims, err error)
func ValidateToken ¶
func ValidateToken(ctx context.Context, tokenString string) (claims *ClientClaims, err error)
type ConfigValues ¶
type ConfigValues struct { MQ_HOST string `validate:"required"` MQ_PORT string `validate:"required"` MQ_USER string `validate:"required"` MQ_PASS string `validate:"required"` GEN_XCHANGE string `validate:"required"` PROG_XCHANGE string `validate:"required"` OIDC_ISSUER string `validate:"required"` OIDC_CLIENT_ID string `validate:"required"` OIDC_CLIENT_SECRET string `validate:"required"` GEN_HANDLER_SECRET string `validate:"required"` GEN_HANDLER_SA string `validate:"required"` API_SEND_URL string MQ_PREFIX string PORT_NUM int CHECK_INTERVAL int }
var Config *ConfigValues
func MockConfig ¶
func MockConfig() ConfigValues
func (*ConfigValues) GetGenXchange ¶
func (c *ConfigValues) GetGenXchange() string
func (*ConfigValues) GetMqUrl ¶
func (c *ConfigValues) GetMqUrl() string
func (*ConfigValues) GetProgXchange ¶
func (c *ConfigValues) GetProgXchange() string
Click to show internal directories.
Click to hide internal directories.