Clean the caches properly to avoid memleak

This commit is contained in:
2025-02-19 11:55:32 +00:00
parent 3ad8fb4518
commit 803a1e5e21
4 changed files with 32 additions and 2 deletions
+6
View File
@@ -135,6 +135,12 @@ func (m *MockJWKCache) GetJWKS(jwksURL string, httpClient *http.Client) (*JWKSet
return m.JWKS, m.Err
}
func (m *MockJWKCache) Cleanup() {
// Mock cleanup implementation
m.JWKS = nil
m.Err = nil
}
// Helper function to create a JWT token
func createTestJWT(privateKey *rsa.PrivateKey, alg, kid string, claims map[string]interface{}) (string, error) {
header := map[string]interface{}{