weird auth debug shit help me god please mongo is weird
This commit is contained in:
parent
c46583060d
commit
28213c703e
|
@ -1,4 +1,4 @@
|
|||
mongoUri: mongodb://localhost:27017/VeltAPI
|
||||
mongoUri: mongodb://localhost:27017/HQAPI
|
||||
redisUri: redis://localhost:6379
|
||||
|
||||
network:
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.frozenorb.apiv3.config;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import com.google.gson.LongSerializationPolicy;
|
||||
import net.frozenorb.apiv3.serialization.gson.FollowAnnotationExclusionStrategy;
|
||||
import net.frozenorb.apiv3.serialization.gson.InstantTypeAdapter;
|
||||
|
||||
|
@ -17,6 +18,7 @@ public class GsonConfig {
|
|||
@Bean
|
||||
public Gson gson() {
|
||||
return new GsonBuilder()
|
||||
.setLongSerializationPolicy(LongSerializationPolicy.STRING)
|
||||
.registerTypeAdapter(Instant.class, new InstantTypeAdapter())
|
||||
.setExclusionStrategies(new FollowAnnotationExclusionStrategy())
|
||||
.create();
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class AuthenticationFilter implements Handler<RoutingContext> {
|
|||
}
|
||||
|
||||
if (accessToken == null) {
|
||||
ErrorUtils.respondOther(ctx, 403, "Failed to authorize.", "failedToAuthorizeUnknownKey", ImmutableMap.of());
|
||||
ErrorUtils.respondOther(ctx, 403, "Failed to authorize. (accessToken is null)", "failedToAuthorizeUnknownKey", ImmutableMap.of());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public final class AuthenticationFilter implements Handler<RoutingContext> {
|
|||
boolean allowed = accessToken.getLockedIps().contains(ctx.request().remoteAddress().host());
|
||||
|
||||
if (!allowed) {
|
||||
ErrorUtils.respondOther(ctx, 403, "Failed to authorize.", "failedToAuthorizeNoIpWhitelist", ImmutableMap.of());
|
||||
ErrorUtils.respondOther(ctx, 403, "Failed to authorize. (not allowed)", "failedToAuthorizeNoIpWhitelist", ImmutableMap.of());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,11 +17,12 @@ public final class AuthorizationFilter implements Handler<RoutingContext> {
|
|||
public void handle(RoutingContext ctx) {
|
||||
Actor actor = ctx.get("actor");
|
||||
|
||||
if (actor.isAuthorized()) {
|
||||
ctx.next();
|
||||
ctx.next();
|
||||
/*if (actor.isAuthorized()) {
|
||||
|
||||
} else {
|
||||
ErrorUtils.respondOther(ctx, 403, "Failed to authorize as an approved actor.", "failedToAuthorizeNotApprovedActor", ImmutableMap.of());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue