aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/config.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-12-11 17:05:12 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-12-11 17:05:12 +0100
commit1e45ae2ea3497958b2ea6a20137955cfc3bbc964 (patch)
tree00af0e28864d79d7a9cbb8b693aff1b397b1a949 /pkg/config/config.go
parente6ded0d01117c592ec124f3e02d6c89eeafec382 (diff)
downloadcerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.tar.gz
cerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.tar.bz2
cerrado-1e45ae2ea3497958b2ea6a20137955cfc3bbc964.zip
feat: Add UI/Handler login process
It adds the whole workflow to store and handle login on both UI and handler level. With that the login information should be available at any point given the context.
Diffstat (limited to 'pkg/config/config.go')
-rw-r--r--pkg/config/config.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 812a06e..da6e0e7 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -55,8 +55,8 @@ type (
ConfigurationRepository struct {
rootReadme string
listenAddr string
- passphrase string
- aesKey string
+ passphrase []byte
+ aesKey []byte
syntaxHighlight string
repositories []*GitRepositoryConfiguration
}
@@ -74,9 +74,9 @@ func LoadConfigurationRepository(configPath string) (*ConfigurationRepository, e
}
repo := &ConfigurationRepository{
- aesKey: config.AESKey,
+ aesKey: []byte(config.AESKey),
listenAddr: config.ListenAddr,
- passphrase: config.Passphrase,
+ passphrase: []byte(config.Passphrase),
repositories: config.Repositories,
rootReadme: config.RootReadme,
syntaxHighlight: config.SyntaxHighlight,
@@ -105,6 +105,14 @@ func (c *ConfigurationRepository) GetListenAddr() string {
return c.listenAddr
}
+func (c *ConfigurationRepository) GetPassphrase() []byte {
+ return c.passphrase
+}
+
+func (c *ConfigurationRepository) GetBase64AesKey() []byte {
+ return c.aesKey
+}
+
// 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 {