Skip to content

Commit c943922

Browse files
authored
[v18] Fix case where renewed X509 SVIDs would not be sent via SDS (#62830)
* Fix case where renewed X509 SVIDs would not be sent via SDS * Add comment
1 parent 8124764 commit c943922

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/tbot/internal/sds/handler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ func (h *Handler) StreamSecrets(
338338
case <-renewalTimer.C:
339339
// Handle renewal time!
340340
log.DebugContext(ctx, "Renewing SVIDs for StreamSecrets stream")
341+
// Set svids to nil to fetching of fresh SVIDs
342+
svids = nil
341343
}
342344

343345
// Fetch the SVIDs if necessary

lib/tbot/services/workloadidentity/workload_api.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ func (s *WorkloadAPIService) Run(ctx context.Context) error {
198198
)
199199
workloadpb.RegisterSpiffeWorkloadAPIServer(srv, s)
200200
sdsHandler, err := sds.NewHandler(sds.HandlerConfig{
201-
Logger: s.log,
202-
RenewalInterval: s.defaultCredentialLifetime.RenewalInterval,
201+
Logger: s.log,
202+
RenewalInterval: cmp.Or(
203+
s.cfg.CredentialLifetime, s.defaultCredentialLifetime,
204+
).RenewalInterval,
203205
TrustBundleCache: s.trustBundleCache,
204206
ClientAuthenticator: func(ctx context.Context) (*slog.Logger, sds.SVIDFetcher, error) {
205207
log, attrs, err := s.authenticateClient(ctx)

0 commit comments

Comments
 (0)