-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from ing-bank/feature/auth-interface
Introducing authorization interface
- Loading branch information
Showing
18 changed files
with
319 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.7.1 | ||
sbt.version =1.8.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/com/ing/wbaa/rokku/proxy/security/AccessControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.ing.wbaa.rokku.proxy.security; | ||
|
||
public interface AccessControl { | ||
String AUDIT_ENABLED_PARAM = "auditEnabled"; | ||
|
||
void init(); | ||
|
||
boolean isAccessAllowed(AccessControlRequest request); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/ing/wbaa/rokku/proxy/security/AccessControlRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.ing.wbaa.rokku.proxy.security; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
public record AccessControlRequest( | ||
String user, | ||
Set<String> userGroups, | ||
String userRole, | ||
String path, | ||
String accessType, | ||
String action, | ||
String clientIpAddress, | ||
String remoteIpAddress, | ||
List<String> forwardedIpAddresses) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/scala/com/ing/wbaa/rokku/proxy/config/AccessControlProviderSettings.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.ing.wbaa.rokku.proxy.config | ||
|
||
import akka.actor.{ ExtendedActorSystem, Extension, ExtensionId, ExtensionIdProvider } | ||
import com.typesafe.config.Config | ||
|
||
import scala.jdk.CollectionConverters._ | ||
|
||
class AccessControlProviderSettings(config: Config) extends Extension { | ||
val listBucketsEnabled: Boolean = config.getBoolean("rokku.access-control.allow-list-buckets") | ||
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") | ||
.entrySet().asScala.map(e => e.getKey -> e.getValue.unwrapped().toString).toMap | ||
} | ||
|
||
object AccessControlProviderSettings extends ExtensionId[AccessControlProviderSettings] with ExtensionIdProvider { | ||
override def createExtension(system: ExtendedActorSystem): AccessControlProviderSettings = new AccessControlProviderSettings(system.settings.config) | ||
|
||
override def lookup: ExtensionId[AccessControlProviderSettings] = AccessControlProviderSettings | ||
} | ||
|
20 changes: 0 additions & 20 deletions
20
src/main/scala/com/ing/wbaa/rokku/proxy/config/RangerSettings.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.