Skip to content

Commit

Permalink
Grpc Security (#189)
Browse files Browse the repository at this point in the history
* update dependencies

* - add option to protobuf messages
- interceptor first implementation

* add security class end variable

* fix write request options and integration tests

* add debug logs to the interceptor

* token applier

* fix tests and apis

* add examples
  • Loading branch information
Saverio Veltri authored Feb 11, 2021
1 parent 124848c commit 6a1cb88
Show file tree
Hide file tree
Showing 38 changed files with 1,345 additions and 520 deletions.
11 changes: 8 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@ lazy val `nsdb-rpc` = project
.settings(PublishSettings.settings: _*)
.settings(libraryDependencies ++= Dependencies.RPC.libraries)
.settings(coverageExcludedPackages := "io\\.radicalbit\\.nsdb.*")
.settings(PB.targets in Compile := Seq(
.settings(
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
))
),
PB.targets in Test := Seq(
scalapb.gen() -> (sourceManaged in Test).value
)
)
.settings(LicenseHeader.settings: _*)
.enablePlugins(AutomateHeaderPlugin)
.dependsOn(`nsdb-sql`)
.dependsOn(`nsdb-sql`, `nsdb-security`, `nsdb-common` % "compile->compile;test->test")
lazy val `nsdb-cluster` = project
.settings(Commons.settings: _*)
.settings(PublishSettings.dontPublish: _*)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version: '3'
services:

nsdb:
image: weareradicalbit/nsdb:1.0.0-SNAPSHOT
image: weareradicalbit/nsdb:1.3.0-SNAPSHOT
volumes:
- ./nsdb-cluster/src/main/resources:/opt/nsdb-cluster/conf
- ./data:/opt/nsdb/data
Expand Down
1 change: 1 addition & 0 deletions nsdb-cluster/src/main/resources/nsdb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ nsdb {
enabled = false
enabled = ${?SECURITY_ENABLED}
auth-provider-class = ""
auth-provider-class = ${?SECURITY_AUTH_PROVIDER_CLASS}
}

read {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@ class NsdbNodeEndpoint(nodeId: String,

authProvider match {
case Right(provider: NSDbAuthorizationProvider) =>
new GrpcEndpoint(nodeId = nodeId,
readCoordinator = readCoordinator,
writeCoordinator = writeCoordinator,
metadataCoordinator = metadataCoordinator)
new GrpcEndpoint(
nodeId = nodeId,
readCoordinator = readCoordinator,
writeCoordinator = writeCoordinator,
metadataCoordinator = metadataCoordinator,
authorizationProvider = provider
)

initWebEndpoint(nodeId, writeCoordinator, readCoordinator, metadataCoordinator, publisher, provider)
case Left(error) =>
logger.error(s"Error during Security initialization \n $error")
logger.error(s"Error during Security initialization: $error")
System.exit(1)
}

Expand Down
Loading

0 comments on commit 6a1cb88

Please sign in to comment.