🚀 Ready
This commit is contained in:
parent
a740467f76
commit
5b71f9b7ab
@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:8080/api/metrics/POD-2/WORKLOAD
|
||||
url: http://localhost:4000/api/metrics/POD-2/WORKLOAD
|
||||
body: json
|
||||
auth: basic
|
||||
}
|
||||
@ -15,17 +15,17 @@ headers {
|
||||
}
|
||||
|
||||
auth:basic {
|
||||
username: michaeltheduck
|
||||
password: blabla
|
||||
username: test
|
||||
password: test
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"owner": "kubooboo",
|
||||
"values": {
|
||||
"RELATIVE_CPU": "20",
|
||||
"RELATIVE_MEMORY": "23",
|
||||
"RELATIVE_DISK_USAGE": "56"
|
||||
"x": "20",
|
||||
"y": "23",
|
||||
"z": "56"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
pom.xml
8
pom.xml
@ -76,6 +76,14 @@
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-smallrye-jwt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-flyway</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-database-postgresql</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -2,11 +2,7 @@ package dev.dinauer.metrics.service.client.auth;
|
||||
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
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;
|
||||
|
||||
@ -22,15 +18,8 @@ public class BearerAuthClientProvider
|
||||
@Inject
|
||||
JWTParser parser;
|
||||
|
||||
@ConfigProperty(name = "big.bucket.auth.client-only")
|
||||
Boolean clientOnly;
|
||||
|
||||
public Client get(String credentials)
|
||||
{
|
||||
if (clientOnly)
|
||||
{
|
||||
throw new WebApplicationException(Response.status(403).type(MediaType.TEXT_PLAIN).entity("endusers_disabled").build());
|
||||
}
|
||||
try
|
||||
{
|
||||
JsonWebToken token = parser.parse(credentials);
|
||||
|
||||
@ -7,22 +7,20 @@ quarkus.http.root-path=/api/metrics
|
||||
|
||||
big.bucket.units=RAW,HOURLY,DAILY,WEEKLY,MONTHLY,YEARLY,TOTAL
|
||||
|
||||
dev.dinauer.metrics-service.client.kubooboo.ro=3749832748923748923
|
||||
dev.dinauer.metrics-service.jwt.client.field=upn
|
||||
|
||||
quarkus.smallrye-jwt.enabled=false
|
||||
%dev.big.bucket.auth.client-only=false
|
||||
|
||||
# Postgres
|
||||
quarkus.datasource.db-kind = postgresql
|
||||
%dev.quarkus.datasource.username = postgres
|
||||
%dev.quarkus.datasource.password = postgres
|
||||
%dev.quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:8888/postgres
|
||||
%dev,test.quarkus.hibernate-orm.schema-management.strategy=drop-and-create
|
||||
# Prod
|
||||
%prod.quarkus.datasource.username=${DB_USER}
|
||||
%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
|
||||
quarkus.banner.path=banner.txt
|
||||
|
||||
# Flyway
|
||||
%test,dev.quarkus.flyway.clean-at-start=true
|
||||
quarkus.flyway.migrate-at-start=true
|
||||
14
src/main/resources/db/migration/V1.0.0__init.sql
Normal file
14
src/main/resources/db/migration/V1.0.0__init.sql
Normal file
@ -0,0 +1,14 @@
|
||||
CREATE TABLE public.bucket (
|
||||
created_at timestamptz(6) NULL,
|
||||
unix_timestamp int8 NOT NULL,
|
||||
updated_at timestamptz(6) NULL,
|
||||
bucket_name varchar(255) NOT NULL,
|
||||
bucket_unit varchar(255) NOT NULL,
|
||||
id varchar(255) NOT NULL,
|
||||
metrics text NOT NULL,
|
||||
"owner" varchar(255) NULL,
|
||||
resource varchar(255) NOT NULL,
|
||||
"timestamp" varchar(255) NOT NULL,
|
||||
CONSTRAINT bucket_bucket_unit_check CHECK (((bucket_unit)::text = ANY ((ARRAY['RAW'::character varying, 'HOURLY'::character varying, 'DAILY'::character varying, 'WEEKLY'::character varying, 'MONTHLY'::character varying, 'YEARLY'::character varying, 'TOTAL'::character varying])::text[]))),
|
||||
CONSTRAINT bucket_pkey PRIMARY KEY (id)
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user