Auth: Introduce authn.SSOClientConfig to get client config from SSOSettings service (#94618)

* wip

* possible solution

* Separate interface for SSO settings clients

* Rename interface

* Fix tests

* Rename

* Change GetClientConfig to comma ok idiom
This commit is contained in:
Misi
2024-10-16 16:27:44 +02:00
committed by GitHub
parent c4f906f7fa
commit 50a635bc7e
14 changed files with 156 additions and 39 deletions
+14
View File
@@ -380,6 +380,20 @@ func (s *Service) IsClientEnabled(name string) bool {
return client.IsEnabled()
}
func (s *Service) GetClientConfig(name string) (authn.SSOClientConfig, bool) {
client, ok := s.clients[name]
if !ok {
return nil, false
}
ssoSettingsAwareClient, ok := client.(authn.SSOSettingsAwareClient)
if !ok {
return nil, false
}
return ssoSettingsAwareClient.GetConfig(), true
}
func (s *Service) SyncIdentity(ctx context.Context, identity *authn.Identity) error {
ctx, span := s.tracer.Start(ctx, "authn.SyncIdentity")
defer span.End()