aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/config/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/config/service.go')
-rw-r--r--pkg/config/service.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/config/service.go b/pkg/config/service.go
index 3c9a27e..90d0d11 100644
--- a/pkg/config/service.go
+++ b/pkg/config/service.go
@@ -22,6 +22,10 @@ type Config struct {
Port string `yaml:"port" validate:"required"`
InterfaceName string `yaml:"interfaceName" validate:"required"`
} `yaml:"wireGuard"`
+ Permissions struct {
+ Enabled bool `yaml:"enabled"`
+ SecretKey string `yaml:"secretKey"`
+ }
ExpireAfter int `yaml:"expireAfter"`
}
@@ -95,5 +99,9 @@ func (s *service) validateConfig(c *Config) error {
}
}
+ if c.Permissions.Enabled && len(c.Permissions.SecretKey) == 0 {
+ return fmt.Errorf("requested permissioned setup but no secret key was given")
+ }
+
return nil
}