♻️ Cleanup for release
This commit is contained in:
parent
9414d5f07f
commit
9986053d19
@ -52,10 +52,6 @@ public class AuthenticationService
|
|||||||
}
|
}
|
||||||
case BEARER:
|
case BEARER:
|
||||||
{
|
{
|
||||||
if (false)
|
|
||||||
{
|
|
||||||
return bearerAuthClientProvider.get(header.credentials());
|
|
||||||
}
|
|
||||||
throw new NotImplementedYet();
|
throw new NotImplementedYet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,20 @@
|
|||||||
package dev.dinauer.metrics.service.client.auth;
|
package dev.dinauer.metrics.service.client.auth;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import jakarta.ws.rs.NotFoundException;
|
|
||||||
import jakarta.ws.rs.WebApplicationException;
|
import jakarta.ws.rs.WebApplicationException;
|
||||||
import jakarta.ws.rs.core.MediaType;
|
import jakarta.ws.rs.core.MediaType;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
|
|
||||||
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
import org.eclipse.microprofile.config.inject.ConfigProperty;
|
||||||
import org.eclipse.microprofile.jwt.JsonWebToken;
|
import org.eclipse.microprofile.jwt.JsonWebToken;
|
||||||
|
import org.jboss.resteasy.reactive.common.NotImplementedYet;
|
||||||
|
|
||||||
import io.quarkus.security.UnauthorizedException;
|
import io.quarkus.security.UnauthorizedException;
|
||||||
import io.smallrye.jwt.auth.principal.JWTParser;
|
import io.smallrye.jwt.auth.principal.JWTParser;
|
||||||
import io.smallrye.jwt.auth.principal.ParseException;
|
import io.smallrye.jwt.auth.principal.ParseException;
|
||||||
|
|
||||||
import dev.dinauer.metrics.service.client.Client;
|
import dev.dinauer.metrics.service.client.Client;
|
||||||
import dev.dinauer.metrics.service.client.Permission;
|
|
||||||
|
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class BearerAuthClientProvider
|
public class BearerAuthClientProvider
|
||||||
@ -25,9 +22,6 @@ public class BearerAuthClientProvider
|
|||||||
@Inject
|
@Inject
|
||||||
JWTParser parser;
|
JWTParser parser;
|
||||||
|
|
||||||
@ConfigProperty(name = "big.bucket.jwt.client-id.field")
|
|
||||||
String clientIdField;
|
|
||||||
|
|
||||||
@ConfigProperty(name = "big.bucket.auth.client-only")
|
@ConfigProperty(name = "big.bucket.auth.client-only")
|
||||||
Boolean clientOnly;
|
Boolean clientOnly;
|
||||||
|
|
||||||
@ -42,12 +36,7 @@ public class BearerAuthClientProvider
|
|||||||
JsonWebToken token = parser.parse(credentials);
|
JsonWebToken token = parser.parse(credentials);
|
||||||
if (token != null)
|
if (token != null)
|
||||||
{
|
{
|
||||||
Optional<String> user = token.claim(clientIdField);
|
throw new NotImplementedYet();
|
||||||
if (user.isPresent())
|
|
||||||
{
|
|
||||||
return new Client(user.get(), null, Permission.RO);
|
|
||||||
}
|
|
||||||
throw new NotFoundException();
|
|
||||||
}
|
}
|
||||||
throw new UnauthorizedException();
|
throw new UnauthorizedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
# HTTP
|
# HTTP
|
||||||
quarkus.http.root-path=/api/metrics
|
quarkus.http.root-path=/api/metrics
|
||||||
|
%dev.quarkus.http.port=4000
|
||||||
|
|
||||||
dev.dinauer.metrics-service.buckets=RAW,HOURLY,DAILY,WEEKLY,MONTHLY,YEARLY,TOTAL
|
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
|
# JWT
|
||||||
mp.jwt.verify.publickey.location=dev/publicKey.pem
|
mp.jwt.verify.publickey.location=dev/publicKey.pem
|
||||||
|
|
||||||
%dev.big.bucket.jwt.client-id.field=upn
|
|
||||||
%dev.big.bucket.auth.client-only=false
|
%dev.big.bucket.auth.client-only=false
|
||||||
|
|
||||||
# Postgres
|
# Postgres
|
||||||
@ -22,4 +22,6 @@ quarkus.datasource.db-kind = postgresql
|
|||||||
%prod.quarkus.datasource.username=${DB_USER}
|
%prod.quarkus.datasource.username=${DB_USER}
|
||||||
%prod.quarkus.datasource.password=${DB_PASSWORD}
|
%prod.quarkus.datasource.password=${DB_PASSWORD}
|
||||||
%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?currentSchema=${DB_SCHEMA}
|
%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
|
%prod.quarkus.hibernate-orm.schema-management.strategy=drop-and-create
|
||||||
|
|
||||||
|
quarkus.banner.path=banner.txt
|
||||||
Loading…
x
Reference in New Issue
Block a user