Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllHttpStatuses = []int{ http.StatusContinue, http.StatusSwitchingProtocols, http.StatusProcessing, http.StatusEarlyHints, http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNonAuthoritativeInfo, http.StatusNoContent, http.StatusResetContent, http.StatusPartialContent, http.StatusMultiStatus, http.StatusAlreadyReported, http.StatusIMUsed, http.StatusMultipleChoices, http.StatusMovedPermanently, http.StatusFound, http.StatusSeeOther, http.StatusNotModified, http.StatusUseProxy, http.StatusTemporaryRedirect, http.StatusPermanentRedirect, http.StatusBadRequest, http.StatusUnauthorized, http.StatusPaymentRequired, http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed, http.StatusNotAcceptable, http.StatusProxyAuthRequired, http.StatusRequestTimeout, http.StatusConflict, http.StatusGone, http.StatusLengthRequired, http.StatusPreconditionFailed, http.StatusRequestEntityTooLarge, http.StatusRequestURITooLong, http.StatusUnsupportedMediaType, http.StatusRequestedRangeNotSatisfiable, http.StatusExpectationFailed, http.StatusTeapot, http.StatusMisdirectedRequest, http.StatusUnprocessableEntity, http.StatusLocked, http.StatusFailedDependency, http.StatusTooEarly, http.StatusUpgradeRequired, http.StatusPreconditionRequired, http.StatusTooManyRequests, http.StatusRequestHeaderFieldsTooLarge, http.StatusUnavailableForLegalReasons, http.StatusInternalServerError, http.StatusNotImplemented, http.StatusBadGateway, http.StatusServiceUnavailable, http.StatusGatewayTimeout, http.StatusHTTPVersionNotSupported, http.StatusVariantAlsoNegotiates, http.StatusInsufficientStorage, http.StatusLoopDetected, http.StatusNotExtended, http.StatusNetworkAuthenticationRequired, } )
Functions ¶
func ValidateStatusList ¶
func ValidateStatusList(fl validator.FieldLevel) bool
Types ¶
type APIFWConfiguration ¶
type APIFWConfiguration struct { conf.Version TLS TLS Server Server APIHost string `conf:"default:http://0.0.0.0:8282,env:URL" validate:"required,url"` HealthAPIHost string `conf:"default:0.0.0.0:9667,env:HEALTH_HOST" validate:"required"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` LogLevel string `conf:"default:DEBUG" validate:"required,oneof=DEBUG INFO ERROR WARNING"` LogFormat string `conf:"default:TEXT" validate:"required,oneof=TEXT JSON"` RequestValidation string `conf:"required" validate:"required,oneof=DISABLE BLOCK LOG_ONLY"` ResponseValidation string `conf:"required" validate:"required,oneof=DISABLE BLOCK LOG_ONLY"` CustomBlockStatusCode int `conf:"default:403" validate:"HttpStatusCodes"` AddValidationStatusHeader bool `conf:"default:false"` APISpecs string `conf:"default:swagger.json,env:API_SPECS"` ShadowAPI ShadowAPI Denylist Denylist }
type HTTPStatusCodeList ¶
type HTTPStatusCodeList struct {
StatusCodes []int
}
type Introspection ¶
type Oauth ¶
type Oauth struct { ValidationType string `conf:"default:JWT"` JWT JWT Introspection Introspection }
type Server ¶
type Server struct { URL string `conf:"default:http://localhost:3000/v1/" validate:"required,url"` ClientPoolCapacity int `conf:"default:1000" validate:"gt=0"` InsecureConnection bool `conf:"default:false"` RootCA string `conf:""` MaxConnsPerHost int `conf:"default:512"` ReadTimeout time.Duration `conf:"default:5s"` WriteTimeout time.Duration `conf:"default:5s"` DialTimeout time.Duration `conf:"default:200ms"` DeleteAcceptEncoding bool `conf:"default:false"` Oauth Oauth }
type ShadowAPI ¶
type ShadowAPI struct {
ExcludeList []int `conf:"default:404,env:SHADOW_API_EXCLUDE_LIST" validate:"HttpStatusCodes"`
}
Click to show internal directories.
Click to hide internal directories.