Skip to content

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Mar 3, 2023

JwksCacheSpec is really flaky:

https://ge.micronaut.io/scans/tests?search.timeZoneId=Europe/Madrid&tests.container=io.micronaut.security.token.jwt.signature.jwks.JwksCacheSpec

Error loooks to be related to the instantiation of DefaultAccessRefreshTokenGenerator

Unexpected error occurred: Error instantiating bean of type  [io.micronaut.security.token.jwt.generator.DefaultAccessRefreshTokenGenerator]
Message: Recursive update
Path Taken: new $LoginController$Definition$Intercepted(Authenticator authenticator,LoginHandler loginHandler,ApplicationEventPublisher eventPublisher,BeanResolutionContext $beanResolutionContext,BeanContext $beanContext,Qualifier $qualifier,List $interceptors) --> new $LoginController$Definition$Intercepted(Authenticator authenticator,[LoginHandler loginHandler],ApplicationEventPublisher eventPublisher,BeanResolutionContext $beanResolutionContext,BeanContext $beanContext,Qualifier $qualifier,List $interceptors) --> new AccessRefreshTokenLoginHandler([AccessRefreshTokenGenerator accessRefreshTokenGenerator]) --> new DefaultAccessRefreshTokenGenerator(AccessTokenConfiguration accessTokenConfiguration,TokenRenderer tokenRenderer,[TokenGenerator tokenGenerator],BeanContext beanContext,RefreshTokenGenerator refreshTokenGenerator,ClaimsGenerator claimsGenerator,ApplicationEventPublisher eventPublisher)
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type  [io.micronaut.security.token.jwt.generator.DefaultAccessRefreshTokenGenerator]
Message: Recursive update

This PR an attempt to refactor this class to see if it helps.

JwksCacheSpec is really flaky:

https://ge.micronaut.io/scans/tests?search.timeZoneId=Europe/Madrid&tests.container=io.micronaut.security.token.jwt.signature.jwks.JwksCacheSpec

Error loooks to be related to the instantiation of DefaultAccessRefreshTokenGenerator

```
Unexpected error occurred: Error instantiating bean of type  [io.micronaut.security.token.jwt.generator.DefaultAccessRefreshTokenGenerator]
Message: Recursive update
Path Taken: new $LoginController$Definition$Intercepted(Authenticator authenticator,LoginHandler loginHandler,ApplicationEventPublisher eventPublisher,BeanResolutionContext $beanResolutionContext,BeanContext $beanContext,Qualifier $qualifier,List $interceptors) --> new $LoginController$Definition$Intercepted(Authenticator authenticator,[LoginHandler loginHandler],ApplicationEventPublisher eventPublisher,BeanResolutionContext $beanResolutionContext,BeanContext $beanContext,Qualifier $qualifier,List $interceptors) --> new AccessRefreshTokenLoginHandler([AccessRefreshTokenGenerator accessRefreshTokenGenerator]) --> new DefaultAccessRefreshTokenGenerator(AccessTokenConfiguration accessTokenConfiguration,TokenRenderer tokenRenderer,[TokenGenerator tokenGenerator],BeanContext beanContext,RefreshTokenGenerator refreshTokenGenerator,ClaimsGenerator claimsGenerator,ApplicationEventPublisher eventPublisher)
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type  [io.micronaut.security.token.jwt.generator.DefaultAccessRefreshTokenGenerator]
Message: Recursive update
```

This PR an attempt to refactor this class to see if it helps.
@sdelamo sdelamo requested a review from timyates March 3, 2023 07:49
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

❌ GraalVM CE CI 17 latest failed: https://ge.micronaut.io/s/4773vomtaeyru

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

63.3% 63.3% Coverage
0.0% 0.0% Duplication

@timyates
Copy link
Contributor

timyates commented Mar 3, 2023

Ran it over and over and it failed with a recursive update after 18 runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants