aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/config.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-12-11 18:10:12 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-12-11 18:10:12 +0100
commit3784181e4fad3c947dfa95081d8a0b34f5be12d4 (patch)
tree48263aa693149f997cdd7ac0c51bf0f994743748 /pkg/config/config.go
parent57efc8d2173fdff1ef99157a2633d3f1d366a290 (diff)
downloadcerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.tar.gz
cerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.tar.bz2
cerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.zip
feat: Disable auth if passphrase is empty
Disable all auth mechanism when passphrase is empty. That will allow for a simpler setup.
Diffstat (limited to 'pkg/config/config.go')
-rw-r--r--pkg/config/config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go
index da6e0e7..c17e6df 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -113,6 +113,10 @@ func (c *ConfigurationRepository) GetBase64AesKey() []byte {
return c.aesKey
}
+func (c *ConfigurationRepository) IsAuthEnabled() bool {
+ return len(c.passphrase) != 0
+}
+
// GetByName returns configuration of repository for a given name.
// It returns nil if there is not match for it.
func (c *ConfigurationRepository) GetByName(name string) *GitRepositoryConfiguration {