Skip to content
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

Update to Micronaut 4.5.0 #3

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>io.micronaut.platform</groupId>
<artifactId>micronaut-parent</artifactId>
<version>4.1.6</version>
<version>4.5.0</version>
</parent>

<name>Cloudgene</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public ApiToken createApiToken(User user, int lifetime) {

}

public ValidatedApiTokenResponse validateApiToken(String token) {
public Mono<ValidatedApiTokenResponse> validateApiToken(String token) {

Publisher<Authentication> authentication = validator.validateToken(token, null);

Expand Down Expand Up @@ -164,7 +164,7 @@ public void onSubscribe(Subscription subscription) {
}

});
}).block();
}).single();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.micronaut.security.authentication.Authentication;
import io.micronaut.security.rules.SecurityRule;
import jakarta.inject.Inject;
import reactor.core.publisher.Mono;

@Controller
public class ApiTokenController {
Expand Down Expand Up @@ -107,7 +108,7 @@ public HttpResponse<MessageResponse> revoke(String username, Authentication auth
@Post("/api/v2/tokens/verify")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Secured(SecurityRule.IS_ANONYMOUS)
public HttpResponse<ValidatedApiTokenResponse> verify(String token) {
public HttpResponse<Mono<ValidatedApiTokenResponse>> verify(String token) {

return HttpResponse.ok(authenticationService.validateApiToken(token));

Expand Down