Skip to content

Commit

Permalink
fix plugin params configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kr7ysztof committed Nov 7, 2023
1 parent 9c1f88e commit 918746f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import com.typesafe.sbt.packager.MappingsHelper.contentOf
import com.typesafe.sbt.packager.docker
import com.typesafe.sbt.packager.docker.{Cmd, DockerChmodType, ExecCmd}
import com.typesafe.sbt.packager.docker.{DockerChmodType, ExecCmd}
import scalariform.formatter.preferences.*

val rokkuVersion = scala.sys.env.getOrElse("ROKKU_VERSION", "SNAPSHOT")
Expand Down
9 changes: 1 addition & 8 deletions src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ rokku {
allow-create-delete-buckets = true
enabled-audit = false
class-name = "com.ing.wbaa.rokku.proxy.provider.AccessControlProviderRanger"
plugin-params {
appId = "testservice"
# make sure the service_type is equal to what is specified in
# ranger-s3-security.xml
serviceType = "s3"
userDomainPostfix = ""
rolePrefix = "role_"
}
plugin-params = "{appId:testservice, serviceType:s3, rolePrefix:role_}"
}

storage.s3 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ing.wbaa.rokku.proxy.config

import akka.actor.{ ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider }
import com.typesafe.config.Config
import com.typesafe.config.{ Config, ConfigFactory }

import scala.jdk.CollectionConverters._

Expand All @@ -10,7 +10,7 @@ class AccessControlProviderSettings(config: Config) extends Extension {
val createDeleteBucketsEnabled: Boolean = config.getBoolean("rokku.access-control.allow-create-delete-buckets")
val auditEnabled: Boolean = config.getBoolean("rokku.access-control.enabled-audit")
val className: String = config.getString("rokku.access-control.class-name")
val pluginParams: Map[String, String] = config.getConfig("rokku.access-control.plugin-params")
val pluginParams: Map[String, String] = ConfigFactory.parseString(config.getString("rokku.access-control.plugin-params"))
.entrySet().asScala.map(e => e.getKey -> e.getValue.unwrapped().toString).toMap
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AccessControlProviderRanger(config: java.util.Map[String, String]) extends
prepareAccessRequest(rangerResource, request.accessType, null, Set(UserGroup(s"${config.get(ROLE_PREFIX_PARAM)}${roleValue}")).map(_.value.toLowerCase))
case _ =>
prepareAccessRequest(
rangerResource, request.accessType, request.user + config.get(USER_DOMAIN_POSTFIX_PARAM), request.userGroups.asScala.map(_.toLowerCase).toSet)
rangerResource, request.accessType, request.user + config.getOrDefault(USER_DOMAIN_POSTFIX_PARAM, ""), request.userGroups.asScala.map(_.toLowerCase).toSet)
}

rangerRequest.setAction(request.action)
Expand Down

0 comments on commit 918746f

Please sign in to comment.