Documentation
¶
Index ¶
- func NewConfigProvider() (config.Provider, error)
- func NewHTTPServer(mux *mux.Router, cfg config.Provider) *http.Server
- func NewLogger() (*zap.Logger, error)
- func NewServerRouter(s *SSRFSheriffRouter) *mux.Router
- func StartFilesGenerator(cfg config.Provider)
- func StartServer(server *http.Server, lc fx.Lifecycle)
- type SSRFSheriffRouter
- type SerializableResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfigProvider ¶
NewConfigProvider returns a config.Provider for YAML configuration
func NewHTTPServer ¶
NewHTTPServer provides a new HTTP server listener
func NewServerRouter ¶
func NewServerRouter(s *SSRFSheriffRouter) *mux.Router
NewServerRouter returns a new mux.Router for handling any HTTP request to /.*
func StartFilesGenerator ¶
StartFilesGenerator starts the function which is dynamically generating JPG/PNG formats with the secret token rendered in the media
Types ¶
type SSRFSheriffRouter ¶
type SSRFSheriffRouter struct {
// contains filtered or unexported fields
}
SSRFSheriffRouter is a wrapper around mux.Router to handle HTTP requests to the sheriff, with logging
func NewSSRFSheriffRouter ¶
func NewSSRFSheriffRouter( logger *zap.Logger, cfg config.Provider, ) *SSRFSheriffRouter
NewSSRFSheriffRouter returns a new SSRFSheriffRouter which is used to route and handle all HTTP requests
func (*SSRFSheriffRouter) PathHandler ¶
func (s *SSRFSheriffRouter) PathHandler(w http.ResponseWriter, r *http.Request)
PathHandler is the main handler for all inbound requests
type SerializableResponse ¶
type SerializableResponse struct {
SecretToken string `json:"token" xml:"token"`
}
SerializableResponse is a generic type which both can be safely serialized to both XML and JSON