aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-02-19 15:19:46 +0000
committerLeonardo Bishop <me@leonardobishop.com>2025-02-19 15:19:46 +0000
commit141c08bc5fe1432be8372cdae7c7544b9f862c35 (patch)
tree2ac26da7fcfa298f7c32101cca923b9c9ed2f37f /pkg
parent7eee9e83517338c784d428596bbc32ca149a002a (diff)
Add permissioned setupHEADmaster
Diffstat (limited to 'pkg')
-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
}