diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 1 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 292b6b7ee..c810222a1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -133,6 +133,7 @@ type Configuration struct { OIDCClientSecret string `name:"oidc-client-secret" usage:"ClientSecret of GoToSocial, as registered with the OIDC provider."` OIDCScopes []string `name:"oidc-scopes" usage:"OIDC scopes."` OIDCLinkExisting bool `name:"oidc-link-existing" usage:"link existing user accounts to OIDC logins based on the stored email value"` + OIDCAllowedGroups []string `name:"oidc-allowed-groups" usage:"Membership of one of the listed groups allows access to GtS. If this is empty, all groups are allowed."` OIDCAdminGroups []string `name:"oidc-admin-groups" usage:"Membership of one of the listed groups makes someone a GtS admin"` TracingEnabled bool `name:"tracing-enabled" usage:"Enable OTLP Tracing"` diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index 9549d67c1..f458074b1 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -1975,6 +1975,31 @@ func GetOIDCLinkExisting() bool { return global.GetOIDCLinkExisting() } // SetOIDCLinkExisting safely sets the value for global configuration 'OIDCLinkExisting' field func SetOIDCLinkExisting(v bool) { global.SetOIDCLinkExisting(v) } +// GetOIDCAllowedGroups safely fetches the Configuration value for state's 'OIDCAllowedGroups' field +func (st *ConfigState) GetOIDCAllowedGroups() (v []string) { + st.mutex.RLock() + v = st.config.OIDCAllowedGroups + st.mutex.RUnlock() + return +} + +// SetOIDCAllowedGroups safely sets the Configuration value for state's 'OIDCAllowedGroups' field +func (st *ConfigState) SetOIDCAllowedGroups(v []string) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.OIDCAllowedGroups = v + st.reloadToViper() +} + +// OIDCAllowedGroupsFlag returns the flag name for the 'OIDCAllowedGroups' field +func OIDCAllowedGroupsFlag() string { return "oidc-allowed-groups" } + +// GetOIDCAllowedGroups safely fetches the value for global configuration 'OIDCAllowedGroups' field +func GetOIDCAllowedGroups() []string { return global.GetOIDCAllowedGroups() } + +// SetOIDCAllowedGroups safely sets the value for global configuration 'OIDCAllowedGroups' field +func SetOIDCAllowedGroups(v []string) { global.SetOIDCAllowedGroups(v) } + // GetOIDCAdminGroups safely fetches the Configuration value for state's 'OIDCAdminGroups' field func (st *ConfigState) GetOIDCAdminGroups() (v []string) { st.mutex.RLock() |