commit
8f7f19035f
@ -193,33 +193,40 @@ public final class APIv3 extends AbstractVerticle {
|
||||
new IndexModel(new Document("user", 1)),
|
||||
new IndexModel(new Document("performedAt", 1)),
|
||||
new IndexModel(new Document("type", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("grants").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("user", 1)),
|
||||
new IndexModel(new Document("rank", 1)),
|
||||
new IndexModel(new Document("addedAt", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("ipLog").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("user", 1)),
|
||||
new IndexModel(new Document("user", 1).append("userIp", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("ipBans").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("userIp", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("punishments").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("user", 1)),
|
||||
new IndexModel(new Document("type", 1)),
|
||||
new IndexModel(new Document("addedAt", 1)),
|
||||
new IndexModel(new Document("addedBy", 1)),
|
||||
new IndexModel(new Document("linkedIpBanId", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("users").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("lastUsername", 1)),
|
||||
new IndexModel(new Document("emailToken", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
database.getCollection("userMeta").createIndexes(ImmutableList.of(
|
||||
new IndexModel(new Document("user", 1).append("serverGroup", 1))
|
||||
), (a, b) -> {});
|
||||
), (a, b) -> {
|
||||
});
|
||||
|
||||
BannedAsn.updateCache();
|
||||
BannedCellCarrier.updateCache();
|
||||
|
@ -3,7 +3,9 @@ package net.frozenorb.apiv3.actor;
|
||||
public interface Actor {
|
||||
|
||||
boolean isAuthorized();
|
||||
|
||||
String getName();
|
||||
|
||||
ActorType getType();
|
||||
|
||||
}
|
@ -35,7 +35,6 @@ public enum AuditLogActionType {
|
||||
CHAT_FILTER_ENTRY_UPDATE(false),
|
||||
CHAT_FILTER_ENTRY_DELETE(false),
|
||||
PUNISHMENT_CREATE(true) {
|
||||
|
||||
@Override
|
||||
public void reverse(AuditLogEntry entry, SingleResultCallback<Void> callback) {
|
||||
String punishmentId = (String) entry.getMetadata().get("punishmentId");
|
||||
|
@ -18,7 +18,7 @@ public final class MaxMindTraits {
|
||||
this.isp = legacy.getString("isp", "");
|
||||
this.domain = legacy.getString("domain", "");
|
||||
this.asn = legacy.getInteger("autonomous_system_number", -1);
|
||||
this.asnOrganization = legacy.getString("autonomous_system_organization" , "");
|
||||
this.asnOrganization = legacy.getString("autonomous_system_organization", "");
|
||||
this.userType = legacy.containsKey("user_type") ? MaxMindUserType.valueOf(legacy.getString("user_type").toUpperCase()) : MaxMindUserType.UNKNOWN;
|
||||
this.organization = legacy.getString("organization", "");
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public final class User {
|
||||
|
||||
private static final MongoCollection<User> usersCollection = APIv3.getDatabase().getCollection("users", User.class);
|
||||
|
||||
@Getter @Id @JsonSerialize(using=UuidJsonSerializer.class) @JsonDeserialize(using=UuidJsonDeserializer.class) private UUID id;
|
||||
@Getter @Id @JsonSerialize(using = UuidJsonSerializer.class) @JsonDeserialize(using = UuidJsonDeserializer.class) private UUID id;
|
||||
@Getter private String lastUsername;
|
||||
@Getter @ExcludeFromReplies private Map<String, Instant> aliases = new HashMap<>();
|
||||
@Getter @ExcludeFromReplies @Setter private String totpSecret;
|
||||
|
@ -60,7 +60,7 @@ public class TotpUtils {
|
||||
public static void wasRecentlyUsed(User user, int code, SingleResultCallback<Boolean> callback) {
|
||||
redisClient.exists(user.getId() + ":recentTotpCodes:" + code, (result) -> {
|
||||
if (result.succeeded()) {
|
||||
callback.onResult(result.result() == 1 , null);
|
||||
callback.onResult(result.result() == 1, null);
|
||||
} else {
|
||||
callback.onResult(null, result.cause());
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
<log4j:configuration>
|
||||
<appender name="RollingAppender" class="org.apache.log4j.DailyRollingFileAppender">
|
||||
<param name="File" value="log/apiv3.log" />
|
||||
<param name="DatePattern" value="'.'yyyy-MM-dd" />
|
||||
<param name="File" value="log/apiv3.log"/>
|
||||
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="[%p %d{yyyy-MM-dd HH:mm:ss}] [%t] %m%n"/>
|
||||
</layout>
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
<root>
|
||||
<priority value="INFO"/>
|
||||
<appender-ref ref="RollingAppender" />
|
||||
<appender-ref ref="ConsoleAppender" />
|
||||
<appender-ref ref="RollingAppender"/>
|
||||
<appender-ref ref="ConsoleAppender"/>
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
Loading…
Reference in New Issue
Block a user