diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-02-19 15:19:46 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-02-19 15:19:46 +0000 |
| commit | 141c08bc5fe1432be8372cdae7c7544b9f862c35 (patch) | |
| tree | 2ac26da7fcfa298f7c32101cca923b9c9ed2f37f /pkg | |
| parent | 7eee9e83517338c784d428596bbc32ca149a002a (diff) | |
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/config/service.go | 8 |
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 } |
