@@ -51,7 +51,6 @@ type server struct {
5151 // down its per-issuer JWKS refresh worker pools; nothing else releases them.
5252 trustedIssuerValidator * tokenexchange.MultiIssuerTokenValidator
5353 configuredReconciler storage.ConfiguredClientReconciler
54- configuredClients []fosite.Client
5554 configuredLeaseID string
5655 configuredCancel context.CancelFunc
5756 configuredDone chan struct {}
@@ -178,7 +177,7 @@ func newServer(ctx context.Context, cfg Config, stor storage.Storage) (_ *server
178177 return nil , fmt .Errorf ("storage backend %T does not implement storage.DCRCredentialStore" , baseStore )
179178 }
180179
181- stor , configuredReconciler , configuredLeaseID , desiredClients , err := setupConfiguredClients (ctx , cfg , stor )
180+ stor , configuredReconciler , configuredLeaseID , err := setupConfiguredClients (ctx , cfg , stor )
182181 if err != nil {
183182 return nil , err
184183 }
@@ -193,23 +192,23 @@ func newServer(ctx context.Context, cfg Config, stor storage.Storage) (_ *server
193192
194193 // Create OAuth2 config from authserver.Config
195194 oauthParams := & oauthserver.AuthorizationServerParams {
196- Issuer : cfg .Issuer ,
197- AccessTokenLifespan : cfg .AccessTokenLifespan ,
198- RefreshTokenLifespan : cfg .RefreshTokenLifespan ,
199- AuthCodeLifespan : cfg .AuthCodeLifespan ,
200- HMACSecrets : cfg .HMACSecrets ,
201- SigningKeyID : signingKey .KeyID ,
202- SigningKeyAlgorithm : signingKey .Algorithm ,
203- SigningKey : signingKey .Key ,
204- ScopesSupported : cfg .ScopesSupported ,
205- BaselineClientScopes : cfg .BaselineClientScopes ,
206- AllowedAudiences : cfg .AllowedAudiences ,
207- AuthorizationEndpointBaseURL : cfg .AuthorizationEndpointBaseURL ,
208- CIMDEnabled : cfg .CIMDEnabled ,
209- AllowConfidentialClientRegistration : cfg .AllowConfidentialClientRegistration ,
210- AllowPrivateKeyJWTRegistration : cfg .AllowPrivateKeyJWTRegistration ,
211- HasStaticDelegateClients : len (cfg .DelegateClients ) > 0 ,
212- InsecureAllowHTTP : cfg .InsecureAllowHTTP ,
195+ Issuer : cfg .Issuer ,
196+ AccessTokenLifespan : cfg .AccessTokenLifespan ,
197+ RefreshTokenLifespan : cfg .RefreshTokenLifespan ,
198+ AuthCodeLifespan : cfg .AuthCodeLifespan ,
199+ HMACSecrets : cfg .HMACSecrets ,
200+ SigningKeyID : signingKey .KeyID ,
201+ SigningKeyAlgorithm : signingKey .Algorithm ,
202+ SigningKey : signingKey .Key ,
203+ ScopesSupported : cfg .ScopesSupported ,
204+ BaselineClientScopes : cfg .BaselineClientScopes ,
205+ AllowedAudiences : cfg .AllowedAudiences ,
206+ AuthorizationEndpointBaseURL : cfg .AuthorizationEndpointBaseURL ,
207+ CIMDEnabled : cfg .CIMDEnabled ,
208+ AllowConfidentialClientRegistration : cfg .AllowConfidentialClientRegistration ,
209+ AllowPrivateKeyJWTRegistration : cfg .AllowPrivateKeyJWTRegistration ,
210+ HasStaticDelegateClients : len (cfg .DelegateClients ) > 0 ,
211+ InsecureAllowHTTP : cfg .InsecureAllowHTTP ,
213212 InsecureAllowConfidentialOverLoopbackHTTP : cfg .InsecureAllowConfidentialOverLoopbackHTTP ,
214213 ForceConfidentialRedirectURIs : cfg .ForceConfidentialRedirectURIs ,
215214 DisableTokenExchange : cfg .DisableTokenExchange ,
@@ -289,7 +288,6 @@ func newServer(ctx context.Context, cfg Config, stor storage.Storage) (_ *server
289288 upstreamRefresher : refresher ,
290289 trustedIssuerValidator : trustedIssuerValidator ,
291290 configuredReconciler : configuredReconciler ,
292- configuredClients : desiredClients ,
293291 configuredLeaseID : configuredLeaseID ,
294292 }
295293 if configuredReconciler != nil {
@@ -317,7 +315,7 @@ func (s *server) startConfiguredClientLeaseRenewal() {
317315 case <- renewCtx .Done ():
318316 return
319317 case <- ticker .C :
320- err := s .configuredReconciler .ReconcileConfiguredClients (renewCtx , s .configuredLeaseID , s . configuredClients )
318+ err := s .configuredReconciler .RenewConfiguredClientLease (renewCtx , s .configuredLeaseID )
321319 if err != nil {
322320 slog .Warn ("configured client lease renewal failed" , "error" , err )
323321 }
@@ -332,33 +330,34 @@ func (s *server) startConfiguredClientLeaseRenewal() {
332330// registration otherwise. It returns the (possibly wrapped) storage, the
333331// reconciler the caller must use for lease renewal and release (nil if the
334332// backend doesn't support reconciliation), the lease ID that reconciliation
335- // claimed, and the desired client set for later renewal calls.
333+ // claimed. The desired set is used only for initial reconciliation; heartbeat
334+ // renewal mutates the lease only.
336335func setupConfiguredClients (ctx context.Context , cfg Config , stor storage.Storage ) (
337- storage.Storage , storage.ConfiguredClientReconciler , string , []fosite. Client , error ,
336+ storage.Storage , storage.ConfiguredClientReconciler , string , error ,
338337) {
339338 desiredClients , err := configuredClients (cfg )
340339 if err != nil {
341- return nil , nil , "" , nil , err
340+ return nil , nil , "" , err
342341 }
343342 stor , err = decorateStorageForSPIFFE (ctx , cfg , stor )
344343 if err != nil {
345- return nil , nil , "" , nil , err
344+ return nil , nil , "" , err
346345 }
347346
348347 baseStore := storage .Unwrap (stor )
349348 reconciler , ok := baseStore .(storage.ConfiguredClientReconciler )
350349 if ! ok {
351350 if err := registerDelegateClients (ctx , stor , cfg .DelegateClients ); err != nil {
352- return nil , nil , "" , nil , err
351+ return nil , nil , "" , err
353352 }
354- return stor , nil , "" , desiredClients , nil
353+ return stor , nil , "" , nil
355354 }
356355
357356 leaseID := uuid .NewString ()
358357 if err := reconciler .ReconcileConfiguredClients (ctx , leaseID , desiredClients ); err != nil {
359- return nil , nil , "" , nil , fmt .Errorf ("reconcile configured clients: %w" , err )
358+ return nil , nil , "" , fmt .Errorf ("reconcile configured clients: %w" , err )
360359 }
361- return stor , reconciler , leaseID , desiredClients , nil
360+ return stor , reconciler , leaseID , nil
362361}
363362
364363// configuredClients builds the desired set of operator-declared clients for
0 commit comments