Skip to content

Commit 2cba305

Browse files
committed
Updated PostgreSQL and added configuration options
1 parent eca2f52 commit 2cba305

7 files changed

Lines changed: 16 additions & 9 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.lielamar</groupId>
88
<artifactId>2fa</artifactId>
9-
<version>1.5.7</version>
9+
<version>1.5.8</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -42,7 +42,7 @@
4242
<version.h2>2.1.210</version.h2>
4343
<version.mysql>8.0.26</version.mysql>
4444
<version.maria-db>2.7.3</version.maria-db>
45-
<version.postgres>42.3.1</version.postgres>
45+
<version.postgres>42.3.3</version.postgres>
4646
<version.mongo-db>3.12.10</version.mongo-db>
4747
<version.slf4j>2.0.0-alpha5</version.slf4j>
4848

shadowed_pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<version.h2>1.4.200</version.h2>
4343
<version.mysql>8.0.26</version.mysql>
4444
<version.maria-db>2.7.3</version.maria-db>
45-
<version.postgres>42.3.1</version.postgres>
45+
<version.postgres>42.3.3</version.postgres>
4646
<version.mongo-db>3.12.10</version.mongo-db>
4747
<version.slf4j>2.0.0-alpha5</version.slf4j>
4848

src/main/java/com/lielamar/auth/bukkit/TwoFactorAuthenticationPlaceholders.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.lielamar.auth.bukkit;
22

3+
import com.lielamar.auth.shared.handlers.MessageHandler;
34
import com.lielamar.auth.shared.utils.TimeUtils;
45
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
56
import org.bukkit.entity.Player;
@@ -33,14 +34,16 @@ public String getVersion() {
3334
public String onPlaceholderRequest(Player player, String identifier) {
3435
switch(identifier.toLowerCase()) {
3536
case "is_enabled":
36-
return plugin.getAuthHandler().is2FAEnabled(player.getUniqueId()) ? "Enabled" : "Disabled";
37+
return plugin.getAuthHandler().is2FAEnabled(player.getUniqueId()) ?
38+
MessageHandler.TwoFAMessages.KEYWORD_ENABLED.getMessage() : MessageHandler.TwoFAMessages.KEYWORD_DISABLED.getMessage();
3739
case "time_since_enabled":
3840
long enableDate = plugin.getAuthHandler().getStorageHandler().getEnableDate(player.getUniqueId());
3941
return enableDate == -1 ? "Not Enabled" : TimeUtils.parseTime(System.currentTimeMillis() - enableDate);
4042
case "key":
4143
return plugin.getAuthHandler().getStorageHandler().getKey(player.getUniqueId());
4244
case "is_required":
43-
return player.hasPermission("2fa.demand") ? "Required" : "Not Required";
45+
return player.hasPermission("2fa.demand") ?
46+
MessageHandler.TwoFAMessages.KEYWORD_REQUIRED.getMessage() : MessageHandler.TwoFAMessages.KEYWORD_NOT_REQUIRED.getMessage();
4447
}
4548

4649
return null;

src/main/java/com/lielamar/auth/bukkit/handlers/DependencyHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void loadDependencies(Plugin plugin, Properties properties) {
6161
String h2Version = properties.getProperty("version_h2", "2.1.210");
6262
String mysqlVersion = properties.getProperty("version_mysql", "8.0.26");
6363
String mariaDBVersion = properties.getProperty("version_maria_db", "2.7.3");
64-
String postgresVersion = properties.getProperty("version_postgres", "42.3.1");
64+
String postgresVersion = properties.getProperty("version_postgres", "42.3.3");
6565
String mongoDBVersion = properties.getProperty("version_mongo_db", "3.12.10");
6666
String slf4jVersion = properties.getProperty("version_slf4j", "2.0.0-alpha5");
6767

src/main/java/com/lielamar/auth/shared/handlers/MessageHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ public enum TwoFAMessages {
7272
RELOADED_CONFIG("&aConfig was reloaded"),
7373
FAILED_AUTHENTICATION_ALERT("&c%name% failed to authenticate %times% times"),
7474
SOMETHING_WENT_WRONG("&cSomething went wrong. Please contact a Staff Member!"),
75+
KEYWORD_ENABLED("Enabled"),
76+
KEYWORD_DISABLED("Disabled"),
77+
KEYWORD_REQUIRED("Required"),
78+
KEYWORD_NOT_REQUIRED("Not Required"),
7579
HELP_HEADER("&7----- &b2FA &7-----"),
7680
HELP_COMMAND("&7\u2022 &b%command% &e%aliases%&7: %description%"),
7781
HELP_FOOTER("&7----- -------- -----"),

src/main/resources/bungee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 2FA
2-
version: "1.5.7"
2+
version: "1.5.8"
33
author: "LielAmar"
44
main: com.lielamar.auth.bungee.TwoFactorAuthentication
55
description: Add another layer of protection to your server

src/main/resources/plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 2FA
2-
version: "1.5.7"
2+
version: "1.5.8"
33
api-version: 1.13
44
authors: [LielAmar, SadGhost]
55
main: com.lielamar.auth.bukkit.TwoFactorAuthentication
@@ -13,7 +13,7 @@ libraries:
1313
- com.h2database:h2:2.1.210
1414
- mysql:mysql-connector-java:8.0.26
1515
- org.mariadb.jdbc:mariadb-java-client:2.7.3
16-
- org.postgresql:postgresql:42.3.1
16+
- org.postgresql:postgresql:42.3.3
1717
- org.mongodb:mongo-java-driver:3.12.10
1818
- org.slf4j:slf4j-api:2.0.0-alpha5
1919

0 commit comments

Comments
 (0)