mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(waiting-room): show and filter by check in [EE-5186] (#8701)
This commit is contained in:
parent
b5771df6a8
commit
4b9c857d85
10 changed files with 108 additions and 25 deletions
|
@ -1,12 +1,11 @@
|
|||
package security
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/apikey"
|
||||
|
@ -147,13 +146,19 @@ func (bouncer *RequestBouncer) AuthorizedEdgeEndpointOperation(r *http.Request,
|
|||
return errors.New("invalid Edge identifier")
|
||||
}
|
||||
|
||||
if endpoint.LastCheckInDate > 0 || endpoint.UserTrusted {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TrustedEdgeEnvironmentAccess defines a security check for Edge environments, checks if
|
||||
// the request is coming from a trusted Edge environment
|
||||
func (bouncer *RequestBouncer) TrustedEdgeEnvironmentAccess(endpoint *portainer.Endpoint) error {
|
||||
if endpoint.UserTrusted {
|
||||
return nil
|
||||
}
|
||||
|
||||
settings, err := bouncer.dataStore.Settings().Settings()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not retrieve the settings: %w", err)
|
||||
return errors.WithMessage(err, "could not retrieve the settings")
|
||||
}
|
||||
|
||||
if !settings.TrustOnFirstConnect {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue