From 9bf448be7aa5e2468d5a6302d7c37ebad0f84176 Mon Sep 17 00:00:00 2001 From: 9p4 Date: Tue, 27 Feb 2024 10:07:29 -0500 Subject: [feature/oidc] Add support for very basic RBAC (#2642) * Add support for very basic RBAC * Add some small tests for allowedGroup and adminGroup * Switch to table-driven tests --- internal/config/helpers.gen.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'internal/config/helpers.gen.go') 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() -- cgit v1.2.3