-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not delete integration CAs on auth init #51938
base: master
Are you sure you want to change the base?
Conversation
@@ -637,6 +639,22 @@ func initializeAuthorities(ctx context.Context, asrv *Server, cfg *InitConfig) e | |||
return trace.Wrap(err) | |||
} | |||
|
|||
// Collect CAs from integrations to avoid deleting them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I attempted to create a UT for this but keyStore.DeleteUnusedKeys
has no effect on software keys. I've also tried test with TELEPORT_TEST_AWS_KMS_ACCOUNT
but keyStore.DeleteUnusedKeys
does not delete keys created in the last 5 minutes. I might leave as it is without tests
@@ -132,3 +132,38 @@ func GetIntegrationRef(ctx context.Context, integration string, igGetter Integra | |||
} | |||
return ref, nil | |||
} | |||
|
|||
// GetIntegrationCertAuthorities attempts to retrieve certificate authorities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not new logic, moved from lib/auth/integration/integrationsv1
to here. added some extra testing tho.
|
||
// IterateResources is a helper that iterates through each resource from all | ||
// pages and passes them one by one to the provided callback. | ||
func IterateResources[T any]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a proper go iterator and return an iter.Seq
instead of a manual loop with a callback?
Fixes #51920
changelog: Fix an issue that GitHub integration CA gets deleted during Auth restart for non-software key stores like KMS. For broken GitHub integrations, the
integration
resource must be deleted and recreated.