-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Keycloak container support with clients and PermissionManagemen…
…t service (#755) Signed-off-by: Yurii Shynbuiev <[email protected]> Signed-off-by: Pat Losoponkul <[email protected]> Co-authored-by: Pat Losoponkul <[email protected]>
- Loading branch information
1 parent
a792f43
commit a1846aa
Showing
47 changed files
with
1,180 additions
and
53 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
2 changes: 1 addition & 1 deletion
2
...ct/lib/sql-doobie/src/test/scala/io/iohk/atala/test/container/PostgresTestContainer.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
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
version: "3.8" | ||
|
||
services: | ||
|
||
db: | ||
image: postgres:13 | ||
environment: | ||
|
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
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
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
35 changes: 35 additions & 0 deletions
35
...ice/server/src/main/scala/io/iohk/atala/iam/authorization/core/PermissionManagement.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,35 @@ | ||
package io.iohk.atala.iam.authorization.core | ||
|
||
import io.iohk.atala.shared.models.WalletId | ||
import zio.IO | ||
|
||
import java.util.UUID | ||
|
||
object PermissionManagement { | ||
trait Service { | ||
def grantWalletToUser(walletId: WalletId, userId: UUID): IO[Error, Unit] | ||
def revokeWalletFromUser(walletId: WalletId, userId: UUID): IO[Error, Unit] | ||
} | ||
|
||
trait Error(message: String) | ||
|
||
object Error { | ||
case class UserNotFoundById(userId: UUID, cause: Option[Throwable] = None) | ||
extends Error(s"User $userId is not found" + cause.map(t => s" Cause: ${t.getMessage}")) | ||
case class WalletNotFoundByUserId(userId: UUID) extends Error(s"Wallet for user $userId is not found") | ||
|
||
case class WalletNotFoundById(walletId: WalletId) extends Error(s"Wallet not found by ${walletId.toUUID}") | ||
|
||
case class WalletResourceNotFoundById(walletId: WalletId) | ||
extends Error(s"Wallet resource not found by ${walletId.toUUID}") | ||
|
||
case class PermissionNotFoundById(userId: UUID, walletId: WalletId, walletResourceId: String) | ||
extends Error( | ||
s"Permission not found by userId: $userId, walletId: ${walletId.toUUID}, walletResourceId: $walletResourceId" | ||
) | ||
|
||
case class UnexpectedError(cause: Throwable) extends Error(cause.getMessage) | ||
|
||
case class ServiceError(message: String) extends Error(message) | ||
} | ||
} |
Oops, something went wrong.