Skip to content

Commit

Permalink
Merge pull request #33 from hivemq/release/bump-version
Browse files Browse the repository at this point in the history
Release / Bump Version
  • Loading branch information
LukasBrand authored Apr 30, 2024
2 parents 36b4fc2 + 4799e31 commit 6d314c6
Show file tree
Hide file tree
Showing 37 changed files with 72 additions and 64 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1072,9 +1072,9 @@ ij_kotlin_method_call_chain_wrap = normal
ij_kotlin_method_parameters_new_line_after_left_paren = true
ij_kotlin_method_parameters_right_paren_on_new_line = true
ij_kotlin_method_parameters_wrap = on_every_item
ij_kotlin_name_count_to_use_star_import = 5
ij_kotlin_name_count_to_use_star_import_for_members = 3
ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**, io.ktor.**
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_packages_to_use_import_on_demand =
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
Expand Down
2 changes: 2 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ tasks.hivemqExtensionJar {
}

dependencies {
compileOnly(libs.jetbrains.annotations)

implementation(libs.commonsLang)
implementation(libs.commonsText)
implementation(libs.bouncycastle.prov)
Expand All @@ -43,6 +45,7 @@ testing {
}
"test"(JvmTestSuite::class) {
dependencies {
compileOnly(libs.jetbrains.annotations)
implementation(libs.mockito)
}
targets.configureEach {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.6.0
version=4.6.1
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
[versions]
bouncycastle = "1.70"
bouncycastle = "1.78.1"
caffeine = "3.1.8"
commonsLang = "3.14.0"
commonsText = "1.12.0"
hivemq-extensionSdk = "4.4.0"
jaxb-api = "2.3.3"
jaxb-impl = "2.3.9"
jcommander = "1.82"
jetbrains-annotations = "24.1.0"
junit-jupiter = "5.10.0"
mockito = "5.11.0"

[libraries]
bouncycastle-prov = { module = "org.bouncycastle:bcprov-jdk15on", version.ref = "bouncycastle" }
bouncycastle-prov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncycastle" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }
commonsLang = { module = "org.apache.commons:commons-lang3", version.ref = "commonsLang" }
commonsText = { module = "org.apache.commons:commons-text", version.ref = "commonsText" }
jaxb-api = { module = "jakarta.xml.bind:jakarta.xml.bind-api", version.ref = "jaxb-api" }
jaxb-impl = { module = "com.sun.xml.bind:jaxb-impl", version.ref = "jaxb-impl" }
jcommander = { module = "com.beust:jcommander", version.ref = "jcommander" }
jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" }
mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }

[plugins]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
*/
package com.hivemq.extensions.rbac.file;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import org.jetbrains.annotations.NotNull;

/**
* @author Yannick Weber
*/
public class ExtensionConstants {

public static final @NotNull String EXTENSION_NAME = "HiveMQ File RBAC Extension";
public static final @NotNull String EXTENSION_ID = "hivemq-file-rbac-extension";

public static final @NotNull String EXTENSION_CONFIG_LEGACY_LOCATION = "extension-config.xml";
public static final @NotNull String EXTENSION_CONFIG_LOCATION = "conf/config.xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.hivemq.extensions.rbac.file;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.auth.SimpleAuthenticator;
import com.hivemq.extension.sdk.api.auth.parameter.SimpleAuthInput;
import com.hivemq.extension.sdk.api.auth.parameter.SimpleAuthOutput;
Expand All @@ -25,6 +24,7 @@
import com.hivemq.extension.sdk.api.packets.connect.ConnackReasonCode;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.utils.CredentialsValidator;
import org.jetbrains.annotations.NotNull;

import java.nio.ByteBuffer;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.hivemq.extensions.rbac.file;

import com.hivemq.extension.sdk.api.ExtensionMain;
import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.parameter.ExtensionStartInput;
import com.hivemq.extension.sdk.api.parameter.ExtensionStartOutput;
import com.hivemq.extension.sdk.api.parameter.ExtensionStopInput;
Expand All @@ -26,6 +25,7 @@
import com.hivemq.extensions.rbac.file.configuration.ExtensionConfiguration;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.utils.CredentialsValidator;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package com.hivemq.extensions.rbac.file;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extension.sdk.api.auth.Authenticator;
import com.hivemq.extension.sdk.api.auth.parameter.AuthenticatorProviderInput;
import com.hivemq.extension.sdk.api.services.auth.provider.AuthenticatorProvider;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.utils.CredentialsValidator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

class FileAuthenticatorProvider implements AuthenticatorProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extension.sdk.api.annotations.ThreadSafe;
import com.hivemq.extensions.rbac.file.configuration.entities.FileAuthConfig;
import org.apache.commons.lang3.time.FastDateFormat;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -72,7 +72,7 @@ synchronized void archive(final @Nullable FileAuthConfig config) throws IOExcept
if (!archiveFolder.mkdir()) {
throw new IOException("Could not create credentials archive folder " + archiveFolder.getAbsolutePath());
} else {
LOG.info("Created credentials Archive folder {}." + archiveFolder.getAbsolutePath());
LOG.info("Created credentials Archive folder {}.", archiveFolder.getAbsolutePath());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.FileAuthConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.PasswordType;
import com.hivemq.extensions.rbac.file.configuration.entities.Permission;
import com.hivemq.extensions.rbac.file.configuration.entities.Role;
import com.hivemq.extensions.rbac.file.configuration.entities.User;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.FileAuthConfig;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extensions.rbac.file.ExtensionConstants;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extension.sdk.api.annotations.ThreadSafe;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.FileAuthConfig;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import org.jetbrains.annotations.NotNull;

class NotMarshallableException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package com.hivemq.extensions.rbac.file.configuration;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.ThreadSafe;
import com.hivemq.extensions.rbac.file.configuration.entities.ExtensionConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.FileAuthConfig;
import com.hivemq.extensions.rbac.file.configuration.entities.User;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -57,8 +57,7 @@ class XmlParser {
* @param file the file where the XML should be written to
* @throws NotMarshallableException if the XML cannot be marshalled
*/
void marshal(final @NotNull FileAuthConfig config, final @NotNull File file)
throws NotMarshallableException {
void marshal(final @NotNull FileAuthConfig config, final @NotNull File file) throws NotMarshallableException {
if (file.isDirectory()) {
throw new NotMarshallableException("Could not write config to file " +
file.getAbsolutePath() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration.entities;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration.entities;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
package com.hivemq.extensions.rbac.file.configuration.entities;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extension.sdk.api.auth.parameter.TopicPermission;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration.entities;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand All @@ -36,6 +36,7 @@ public class Role {
@XmlElement(name = "permission")
private @Nullable List<Permission> permissions;

@SuppressWarnings("unused")
public Role() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.hivemq.extensions.rbac.file.configuration.entities;

import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand All @@ -41,6 +41,7 @@ public class User {
@XmlElement(name = "id")
private @Nullable List<String> roles;

@SuppressWarnings("unused")
public User() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extensions.rbac.file.utils.Hashing;
import org.apache.commons.lang3.RandomStringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
Expand All @@ -38,14 +38,15 @@ public class PasswordGenerator {
description = "The salt to use for hashing (optional). If no salt is specified, a random salt is used")
private @Nullable String salt;

@SuppressWarnings({"FieldCanBeLocal", "CanBeFinal"})
@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal"})
@Parameter(names = {"--iterations", "-i"}, description = "The amount of hashing iterations. Default: 100")
private int iterations = 100;

@SuppressWarnings("unused")
@Parameter(names = "--help", help = true)
private boolean help;

@SuppressWarnings({"FieldCanBeLocal", "CanBeFinal"})
@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal"})
@Parameter(names = "-q", description = "Only outputs the hash string.")
private boolean quiet = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import com.codahale.metrics.Timer;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.ThreadSafe;
import org.jetbrains.annotations.NotNull;

import java.security.MessageDigest;
import java.util.Base64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
package com.hivemq.extensions.rbac.file.utils;

import com.codahale.metrics.MetricRegistry;
import com.hivemq.extension.sdk.api.annotations.NotNull;
import com.hivemq.extension.sdk.api.annotations.Nullable;
import com.hivemq.extension.sdk.api.annotations.ThreadSafe;
import com.hivemq.extension.sdk.api.auth.parameter.TopicPermission;
import com.hivemq.extension.sdk.api.services.builder.Builders;
Expand All @@ -28,6 +26,8 @@
import com.hivemq.extensions.rbac.file.configuration.entities.Permission;
import com.hivemq.extensions.rbac.file.configuration.entities.Role;
import com.hivemq.extensions.rbac.file.configuration.entities.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
Expand Down
Loading

0 comments on commit 6d314c6

Please sign in to comment.