mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
fix(libclient): option to disable external http request [BE-11696] (#745)
This commit is contained in:
parent
ee65223ee7
commit
e243a6bf1c
5 changed files with 51 additions and 2 deletions
22
pkg/libhttp/client/client.go
Normal file
22
pkg/libhttp/client/client.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/portainer/portainer/pkg/featureflags"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrExternalRequestsBlocked = errors.New("external requests are blocked by feature flag")
|
||||
)
|
||||
|
||||
// DisableExternalRequest is the feature flag name for blocking outbound requests
|
||||
const DisableExternalRequests = "disable-external-requests"
|
||||
|
||||
func ExternalRequestDisabled(url string) error {
|
||||
if featureflags.IsEnabled(DisableExternalRequests) {
|
||||
return ErrExternalRequestsBlocked
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue