diff --git a/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/Credentials.scala b/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/Credentials.scala deleted file mode 100644 index ca0bdd4..0000000 --- a/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/Credentials.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2024 Dominic Grimm - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.dergrimm.keycloak.providers.events.mqtt - -private final case class Credentials( - username: String, - password: String -) diff --git a/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/MqttEventListenerProviderFactory.scala b/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/MqttEventListenerProviderFactory.scala index b58d759..5658491 100644 --- a/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/MqttEventListenerProviderFactory.scala +++ b/src/main/scala/net/dergrimm/keycloak/providers/events/mqtt/MqttEventListenerProviderFactory.scala @@ -81,8 +81,7 @@ class MqttEventListenerProviderFactory( val credentials = val username = config.get("username") val password = config.get("password") - if username != null && password != null then - Some(Credentials(username, password)) + if username != null && password != null then Some((username, password)) else None val cleanSession = config.getBoolean("cleanSession", true) @@ -100,8 +99,8 @@ class MqttEventListenerProviderFactory( credentials match case Some(creds) => connectionSettings = connectionSettings.withAuth( - username = creds.username, - password = creds.password + username = creds(0), + password = creds(1) ) case None => {}