Skip to content

Commit

Permalink
fixed failing unmarshaling & added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maurafortino committed Oct 4, 2023
1 parent e3960e9 commit 1a685f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions primaryHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ func NewPrimaryHandler(logger *zap.Logger, manager device.Manager, v *viper.Vipe
}

// the secured variant of the device connect handler - compatible with v2 and v3
var failOpen = true
// default functionality is to allow for talaria to accept devices with or without authorization
// failOpen must be set to false in config in order to require authorization from any device trying to connect
failOpen := true
if v.IsSet(FailOpenConfigKey) {
err := v.UnmarshalKey(FailOpenConfigKey, failOpen)
err := v.UnmarshalKey(FailOpenConfigKey, &failOpen)
if err != nil {
logger.Error("failOpen parse failure", zap.Error(err))
return nil, errors.New("failed parsing FailOpen boolean")
Expand Down

0 comments on commit 1a685f4

Please sign in to comment.