From 1e45ae2ea3497958b2ea6a20137955cfc3bbc964 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 11 Dec 2024 17:05:12 +0100 Subject: 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. --- pkg/config/config.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'pkg/config/config.go') 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 { -- cgit v1.2.3