♻️ Cleanup for release

This commit is contained in:
andreas.dinauer 2025-11-16 17:59:11 +01:00
parent 9414d5f07f
commit 9986053d19
3 changed files with 6 additions and 19 deletions

View File

@ -52,10 +52,6 @@ public class AuthenticationService
}
case BEARER:
{
if (false)
{
return bearerAuthClientProvider.get(header.credentials());
}
throw new NotImplementedYet();
}
}

View File

@ -1,23 +1,20 @@
package dev.dinauer.metrics.service.client.auth;
import java.util.Optional;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.ws.rs.NotFoundException;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.jwt.JsonWebToken;
import org.jboss.resteasy.reactive.common.NotImplementedYet;
import io.quarkus.security.UnauthorizedException;
import io.smallrye.jwt.auth.principal.JWTParser;
import io.smallrye.jwt.auth.principal.ParseException;
import dev.dinauer.metrics.service.client.Client;
import dev.dinauer.metrics.service.client.Permission;
@ApplicationScoped
public class BearerAuthClientProvider
@ -25,9 +22,6 @@ public class BearerAuthClientProvider
@Inject
JWTParser parser;
@ConfigProperty(name = "big.bucket.jwt.client-id.field")
String clientIdField;
@ConfigProperty(name = "big.bucket.auth.client-only")
Boolean clientOnly;
@ -42,12 +36,7 @@ public class BearerAuthClientProvider
JsonWebToken token = parser.parse(credentials);
if (token != null)
{
Optional<String> user = token.claim(clientIdField);
if (user.isPresent())
{
return new Client(user.get(), null, Permission.RO);
}
throw new NotFoundException();
throw new NotImplementedYet();
}
throw new UnauthorizedException();
}

View File

@ -1,5 +1,6 @@
# HTTP
quarkus.http.root-path=/api/metrics
%dev.quarkus.http.port=4000
dev.dinauer.metrics-service.buckets=RAW,HOURLY,DAILY,WEEKLY,MONTHLY,YEARLY,TOTAL
@ -9,7 +10,6 @@ dev.dinauer.metrics-service.jwt.client.field=upn
# JWT
mp.jwt.verify.publickey.location=dev/publicKey.pem
%dev.big.bucket.jwt.client-id.field=upn
%dev.big.bucket.auth.client-only=false
# Postgres
@ -23,3 +23,5 @@ quarkus.datasource.db-kind = postgresql
%prod.quarkus.datasource.password=${DB_PASSWORD}
%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?currentSchema=${DB_SCHEMA}
%prod.quarkus.hibernate-orm.schema-management.strategy=drop-and-create
quarkus.banner.path=banner.txt