Documentation
¶
Index ¶
- func AreValidUUIDs(candidates ...string) bool
- func BindAndValidate[DTO interface{}](c echo.Context) (DTO, error)
- func CheckAPIKey(keyStr string, hashStr string) bool
- func CheckAgentKey(keyStr string, hashStr string) bool
- func CleanPath(filePath string) string
- func GenAPIKeyAndHash() (keyStr string, hashStr string, err error)
- func GenAgentKeyAndHash() (keyStr string, hashStr string, err error)
- func GenericServerError(internal error) *echo.HTTPError
- func HashAPIKey(keyStr string) string
- func HashAgentKey(keyStr string) string
- func ServerError(message string, internal error) *echo.HTTPError
- func UnmarshalJSON[T interface{}](jsonBlob string) (out T, err error)
- func ValidatePasswordStrength(password string) (ok bool, feedback string)
- type RequestValidator
- type WrappedServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreValidUUIDs ¶
func BindAndValidate ¶
func BindAndValidate[DTO interface{}](c echo.Context) (DTO, error)
func CheckAPIKey ¶
func CheckAgentKey ¶
func GenAPIKeyAndHash ¶
func GenAgentKeyAndHash ¶
Note: because we're using a large, random key, there's no need to salt. Plus, we get more efficient lookups as we can deterministically hash the incoming key... ...when we do an auth lookup.
func GenericServerError ¶
func GenericServerError(internal error) *echo.HTTPError
func HashAPIKey ¶
All just the same as the Agent Key stuff, but duplicating the code to keep it uncoupled
func HashAgentKey ¶
func ServerError ¶
func UnmarshalJSON ¶
Types ¶
type RequestValidator ¶
type RequestValidator struct { Validator *validator.Validate // contains filtered or unexported fields }
func NewRequestValidator ¶
func NewRequestValidator() *RequestValidator
func (*RequestValidator) Validate ¶
func (v *RequestValidator) Validate(i interface{}) error
type WrappedServerError ¶
type WrappedServerError struct {
// contains filtered or unexported fields
}
func (WrappedServerError) Error ¶
func (e WrappedServerError) Error() string
func (WrappedServerError) ID ¶
func (e WrappedServerError) ID() string
func (WrappedServerError) Unwrap ¶
func (e WrappedServerError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.