Skip to content

Commit

Permalink
docs: iam oas improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
patlo-iog committed May 3, 2024
1 parent eeb8a4d commit 9ccaf99
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.hyperledger.identus.agent.server.http
import org.hyperledger.identus.castor.controller.{DIDEndpoints, DIDRegistrarEndpoints}
import org.hyperledger.identus.connect.controller.ConnectionEndpoints
import org.hyperledger.identus.event.controller.EventEndpoints
import org.hyperledger.identus.iam.entity.http.EntityEndpoints
import org.hyperledger.identus.iam.wallet.http.WalletManagementEndpoints
import org.hyperledger.identus.issue.controller.IssueEndpoints
import org.hyperledger.identus.pollux.credentialdefinition.CredentialDefinitionRegistryEndpoints
Expand Down Expand Up @@ -117,7 +118,8 @@ object DocModels {
DIDRegistrarEndpoints.tag,
WalletManagementEndpoints.tag,
SystemEndpoints.tag,
EventEndpoints.tag
EventEndpoints.tag,
EntityEndpoints.tag
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ object EventEndpoints {

private val tagName = "Events"
private val tagDescription =
s"""
|The __${tagName}__ endpoints enable users to manage event-related resources, such as webhook notifications.
s"""The __${tagName}__ endpoints enable users to manage event-related resources, such as webhook notifications.
|These notifications are specifically designed to inform about events occurring within the wallet, including but not limited to:
|
|- DID publication notifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.hyperledger.identus.iam.authentication.admin.AdminApiKeySecurityLogic
import org.hyperledger.identus.iam.authentication.oidc.JwtCredentials
import org.hyperledger.identus.iam.authentication.oidc.JwtSecurityLogic.jwtAuthHeader
import org.hyperledger.identus.iam.entity.http.model.*
import sttp.apispec.Tag
import sttp.model.StatusCode
import sttp.tapir.json.zio.jsonBody
import sttp.tapir.{Endpoint, EndpointInput, endpoint, extractFromRequest, path, query, statusCode, stringToPath}
Expand All @@ -16,6 +17,22 @@ import java.util.UUID

object EntityEndpoints {

private val tagName = "Identity and Access Management"
private val tagDescription =
s"""
|The __${tagName}__ endpoints allow [agent administrators](https://docs.atalaprism.io/docs/concepts/glossary#administrator)
|to manage identity and access management for the agent's tenants.
|It provides basic IAM capabilities as an alternative to more feature rich external IAM solutions.
|
|Entities are resources that represent individual tenants and
|wallets act as containers for Self-Sovereign Identity (SSI) resources within the agent.
|The administrator can grant tenant access to specific wallets by associating the wallet ID with the Entity.
|Additionally, the administrator can create API keys for entities and provide them to the tenants out-of-band.
|These API keys can then be used for authorization to access specific wallets.
|""".stripMargin

val tag = Tag(tagName, Some(tagDescription))

val createEntityEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
(RequestContext, CreateEntityRequest),
Expand Down Expand Up @@ -48,7 +65,7 @@ object EntityEndpoints {
.description(
"Create the new entity record. The entity record is a representation of the account in the system."
)
.tag("Identity and Access Management")
.tag(tagName)

val updateEntityNameEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand Down Expand Up @@ -84,7 +101,7 @@ object EntityEndpoints {
.description(
"Update the entity record name by `id`"
)
.tag("Identity and Access Management")
.tag(tagName)

val updateEntityWalletIdEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand Down Expand Up @@ -120,7 +137,7 @@ object EntityEndpoints {
.description(
"Update the entity record `walletId` field by `id`"
)
.tag("Identity and Access Management")
.tag(tagName)

val getEntityByIdEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand All @@ -145,7 +162,7 @@ object EntityEndpoints {
.description(
"Get the entity by the unique identifier"
)
.tag("Identity and Access Management")
.tag(tagName)

private val paginationInput: EndpointInput[PaginationInput] = EndpointInput.derived[PaginationInput]
val getEntitiesEndpoint: Endpoint[
Expand All @@ -171,7 +188,7 @@ object EntityEndpoints {
.description(
"Get all entities with the pagination by `offset` and `limit` parameters "
)
.tag("Identity and Access Management")
.tag(tagName)

val deleteEntityByIdEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand All @@ -198,7 +215,7 @@ object EntityEndpoints {
.description(
"Delete the entity by the unique identifier"
)
.tag("Identity and Access Management")
.tag(tagName)

val addEntityApiKeyAuthenticationEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand Down Expand Up @@ -229,7 +246,7 @@ object EntityEndpoints {
.description(
"Register the `apikey` for the entity."
)
.tag("Identity and Access Management")
.tag(tagName)

val deleteEntityApiKeyAuthenticationEndpoint: Endpoint[
(AdminApiKeyCredentials, JwtCredentials),
Expand Down Expand Up @@ -260,5 +277,5 @@ object EntityEndpoints {
.description(
"Unregister the `apikey` for the entity."
)
.tag("Identity and Access Management")
.tag(tagName)
}

0 comments on commit 9ccaf99

Please sign in to comment.