Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AddressForbidden error = errors.New("address forbidden, you may need to set AllowedUntrustedInternalConnections to allow an integration access to your internal network")
Functions ¶
func IsOwnIP ¶
IsOwnIP handles the special case that a request might be made to the public IP of the host which on Linux is routed directly via the loopback IP to any listening sockets, effectively bypassing host-based firewalls such as firewalld
func IsReservedIP ¶
IsReservedIP checks whether the target IP belongs to reserved IP address ranges to avoid SSRF attacks to the internal network of the Mattermost server
Types ¶
type Client ¶
func NewHTTPClient ¶
func NewHTTPClient(enableInsecureConnections bool, allowHost func(host string) bool, allowIP func(ip net.IP) bool) *Client
NewHTTPClient returns a variation the default implementation of Client. It uses a Transport with the same settings as the default Transport but with the following modifications:
- shorter timeout for dial and TLS handshake (defined as constant "connectTimeout")
- timeout for the end-to-end request (defined as constant "requestTimeout")
type DialContextFunction ¶
type HTTPService ¶
Wraps the functionality for creating a new http.Client to encapsulate that and allow it to be mocked when testing
func MakeHTTPService ¶
func MakeHTTPService(configService configservice.ConfigService) HTTPService
type HTTPServiceImpl ¶
type HTTPServiceImpl struct {
// contains filtered or unexported fields
}
func (*HTTPServiceImpl) Close ¶
func (h *HTTPServiceImpl) Close()
func (*HTTPServiceImpl) MakeClient ¶
func (h *HTTPServiceImpl) MakeClient(trustURLs bool) *Client