groupware: introduce temporary configuration property GROUPWARE_ENABLE_MOCK_DATA that controls whether the mock addressbook and mock contacts should be injected or not; default is false/disabled since it is not fully functional yet

This commit is contained in:
Pascal Bleser
2026-06-23 11:39:51 +02:00
parent 845026d3f0
commit 02e53fe110
3 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ type Config struct {
TokenManager *TokenManager `yaml:"token_manager"`
Context context.Context `yaml:"-"`
EnableMockData bool `env:"GROUPWARE_ENABLE_MOCK_DATA"`
}
type MailMasterAuth struct {

View File

@@ -58,6 +58,7 @@ func DefaultConfig() *config.Config {
Service: config.Service{
Name: "groupware",
},
EnableMockData: false,
}
}

View File

@@ -399,7 +399,7 @@ func NewGroupware(config *config.Config, logger *log.Logger, mux *chi.Mux, prome
addressBookListSuppliers = append(addressBookListSuppliers, j)
contactCardQuerySuppliers = append(contactCardQuerySuppliers, j)
}
{
if config.EnableMockData {
m := newMockContactCardSupplier()
addressBookListSuppliers = append(addressBookListSuppliers, m)
contactCardQuerySuppliers = append(contactCardQuerySuppliers, m)