Skip to content

Commit

Permalink
Merge branch 'main' into oidc
Browse files Browse the repository at this point in the history
  • Loading branch information
patlo-iog committed May 6, 2024
2 parents 829d3a6 + 393c296 commit 5922023
Show file tree
Hide file tree
Showing 27 changed files with 321 additions and 107 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# Pollux:
/pollux/ @patlo-iog @CryptoKnightIOG @mineme0110

# PRISM Agent:
/prism-agent/ @bvoiturier @yshyn-iohk @patlo-iog
# Cloud Agent:
/cloud-agent/ @bvoiturier @yshyn-iohk @patlo-iog

# CI pipelines:
/.github/ @mineme0110
/.github/ @mineme0110 @patlo-iog

# PRISM Node:
/prism-node/ @shotexa
Expand Down
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pollux:
- changed-files:
- any-glob-to-any-file:
- pollux/**/*
prism-agent:
cloud-agent:
- changed-files:
- any-glob-to-any-file:
- prism-agent/**/*
- cloud-agent/**/*
prism-node:
- changed-files:
- any-glob-to-any-file:
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ jobs:
pull-requests: write

steps:
# Git Chekcout
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false

- name: MegaLinter
id: ml
Expand All @@ -47,16 +48,31 @@ jobs:
mega-linter.log
overwrite: true

- uses: crazy-max/ghaction-import-gpg@v3
id: import_gpg
with:
gpg-private-key: ${{ secrets.HYP_BOT_GPG_PRIVATE }}
passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }}
git-user-signingkey: true
git-commit-gpgsign: true
git_config_global: true
git_tag_gpgsign: true

# Create pull request if applicable (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "style: Apply linters automatic fixes"
title: "style: Apply linters automatic fixes"
labels: "hyperledger-bot"
base: ${{ github.head_ref }}
branch-suffix: short-commit-hash
commit-message: "style: apply linters automatic fixes"
title: "style: apply linters automatic fixes"
signoff: true
committer: "Hyperledger Bot <hyperledger-bot@hyperledger.org>"
author: "Hyperledger Bot <hyperledger-bot@hyperledger.org>"

- name: Create PR output
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<i> <font size="18">Identus Cloud Agent</font> </i>
<br>
<br>
<a href='https://coveralls.io/github/input-output-hk/atala-prism-building-blocks?branch=main'><img src='https://coveralls.io/repos/github/input-output-hk/atala-prism-building-blocks/badge.svg?branch=main&amp;t=91BUzX&kill_cache=1' alt='Coverage Status' /></a>
<a href='https://coveralls.io/github/hyperledger/identus-cloud-agent?branch=main'><img src='https://coveralls.io/repos/github/hyperledger/identus-cloud-agent/badge.svg?branch=main' alt='Coverage Status' /></a>
<a href="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/unit-tests.yml"> <img src="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/unit-tests.yml/badge.svg" alt="Unit tests" /> </a>
<a href="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/integration-tests.yml"> <img src="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/integration-tests.yml/badge.svg" alt="End-to-end tests" /> </a>
<a href="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/performance-tests.yml"> <img src="https://github.com/hyperledger/identus-cloud-agent/actions/workflows/performance-tests.yml/badge.svg" alt="Performance tests" /> </a>
Expand Down Expand Up @@ -96,7 +96,7 @@ The following sections describe how to run the Cloud Agent in different configur
The Cloud Agent can be configured to use different types of ledger, secret storage and DID persistence. Any combination of options is available, but the most common configurations are:

| Configuration | Secret Storage | DIDs persistence | Prism Node |
| -------------- | -------------- | ---------------- |-------------------------------------------------|
|----------------|----------------|------------------|-------------------------------------------------|
| Dev | PostgreSQL | No | In-memory |
| Pre-production | PostgreSQL | Yes | Distributed Ledger testnet (preview or preprod) |
| Production | Hashicorp | Yes | Distributed Ledger mainnet |
Expand Down Expand Up @@ -179,7 +179,7 @@ The following tutorials will help you get started with the Cloud Agent and issue

## User documentation

All extended documentation, tutorials and API references for the Identus ecosystem can be found at https://docs.atalaprism.io/
All extended documentation, tutorials and API references for the Identus ecosystem can be found at <https://docs.atalaprism.io/>

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions cloud-agent/client/kotlin/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ src/main/kotlin/org/hyperledger/identus/client/models/ServiceType.kt

src/main/kotlin/org/hyperledger/identus/client/models/StatusPurpose.kt
src/main/kotlin/org/hyperledger/identus/client/models/CredentialSubject.kt

src/main/kotlin/org/hyperledger/identus/client/models/DateTimeParameter.kt
src/main/kotlin/org/hyperledger/identus/client/models/DidParameter.kt
src/main/kotlin/org/hyperledger/identus/client/models/VcVerificationParameter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/

@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)

package org.hyperledger.identus.client.models


import com.google.gson.annotations.SerializedName

/**
*
*
* @param dateTime
* @param parameterType
*/


data class DateTimeParameter (

@SerializedName("did")
override val did: kotlin.String? = null,

@SerializedName("parameterType")
override val parameterType: kotlin.String = "DateTimeParameter",

@SerializedName("dateTime")
override val dateTime: java.time.OffsetDateTime,

) : VcVerificationParameter

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/

@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)

package org.hyperledger.identus.client.models


import com.google.gson.annotations.SerializedName

/**
*
*
* @param did
* @param parameterType
*/


data class DidParameter (

@SerializedName("did")
override val did: kotlin.String,

@SerializedName("parameterType")
override val parameterType: kotlin.String = "DidParameter",

@get:SerializedName("dateTime")
override val dateTime: java.time.OffsetDateTime? = null,
) : VcVerificationParameter

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/

@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)

package org.hyperledger.identus.client.models

import org.hyperledger.identus.client.models.DateTimeParameter
import org.hyperledger.identus.client.models.DidParameter

import com.google.gson.annotations.SerializedName

/**
*
*
* @param dateTime
* @param parameterType
* @param did
*/


interface VcVerificationParameter {

@get:SerializedName("dateTime")
val dateTime: java.time.OffsetDateTime?
@get:SerializedName("parameterType")
val parameterType: kotlin.String
@get:SerializedName("did")
val did: kotlin.String?
}

8 changes: 4 additions & 4 deletions cloud-agent/service/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# PrismAgent service
# CloudAgent service

## Quickstart

### Running PrismAgent service locally
### Running CloudAgent service locally

see `./infrastucture/local/README.md` for instruction

---

## DID key management

`prism-agent` is a cloud agent that represents the digital identity (is a DID controller)
`cloud-agent` is a cloud agent that represents the digital identity (is a DID controller)
of the Issuing / Verification organization. As a DID controller, it needs to perform
the operation with private and public keys through the Wallet API abstraction level.
The interface for key-mangement is heavily inspired by
Expand All @@ -31,7 +31,7 @@ Basic documentation on how to execute the Connect flow from command line can be
Basic documentation on how to execute the Issue flow from the command line can be found [here](./issue.md).

---
## Presnt Proof flow
## Present Proof flow
Basic documentation on how to execute the Present Proof flow from the command line can be found [here](./present-proof.md).


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import org.hyperledger.identus.verification.controller.VcVerificationServerEndpo
import zio.*
import zio.metrics.*

object PrismAgentApp {
object CloudAgentApp {

def run = for {
_ <- AgentInitialization.run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ object MainApp extends ZIOAppDefault {
_ <- preMigrations
_ <- migrations

app <- PrismAgentApp.run
app <- CloudAgentApp.run
.provide(
DidCommX.liveLayer,
// infra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ 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
import org.hyperledger.identus.pollux.credentialschema.{SchemaRegistryEndpoints, VerificationPolicyEndpoints}
import org.hyperledger.identus.system.controller.SystemEndpoints
Expand All @@ -11,7 +14,6 @@ import sttp.apispec.{SecurityScheme, Tag}
import sttp.model.headers.AuthenticationScheme

import scala.collection.immutable.ListMap
import org.hyperledger.identus.issue.controller.IssueEndpoints

object DocModels {

Expand Down Expand Up @@ -115,7 +117,9 @@ object DocModels {
DIDEndpoints.tag,
DIDRegistrarEndpoints.tag,
WalletManagementEndpoints.tag,
SystemEndpoints.tag
SystemEndpoints.tag,
EventEndpoints.tag,
EntityEndpoints.tag
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.hyperledger.identus.iam.authentication.apikey.ApiKeyCredentials
import org.hyperledger.identus.iam.authentication.apikey.ApiKeyEndpointSecurityLogic.apiKeyHeader
import org.hyperledger.identus.iam.authentication.oidc.JwtCredentials
import org.hyperledger.identus.iam.authentication.oidc.JwtSecurityLogic.jwtAuthHeader
import sttp.apispec.Tag
import sttp.model.StatusCode
import sttp.tapir.*
import sttp.tapir.json.zio.jsonBody
Expand All @@ -19,8 +20,23 @@ import java.util.UUID

object EventEndpoints {

private val tagName = "Events"
private val tagDescription =
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
|- DIDComm connection notifications
|- Issuance protocol notifications
|- Presentation protocol notifications
|
|For more detailed information regarding event notifications, please refer to this [documentation](https://docs.atalaprism.io/tutorials/webhooks/webhook).
|""".stripMargin

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

private val baseEndpoint = endpoint
.tag("Events")
.tag(tagName)
.in("events")
.securityIn(apiKeyHeader)
.securityIn(jwtAuthHeader)
Expand All @@ -39,6 +55,11 @@ object EventEndpoints {
.out(statusCode(StatusCode.Ok).description("Webhook notification has been created successfully"))
.out(jsonBody[WebhookNotification])
.summary("Create wallet webhook notifications")
.description(
"""Create a new wallet webhook notification and subscribe to events.
|A dispatched webhook request may contain static custom headers for authentication or custom metadata.
""".stripMargin
)

val listWebhookNotification: Endpoint[
(ApiKeyCredentials, JwtCredentials),
Expand All @@ -52,6 +73,12 @@ object EventEndpoints {
.out(statusCode(StatusCode.Ok).description("List wallet webhook notifications"))
.out(jsonBody[WebhookNotificationPage])
.summary("List wallet webhook notifications")
.description(
"""List all registered webhook notifications.
|Each webhook notification contains a unique identifier, the URL to which the events are sent,
|and the custom headers to be included in the dispatched webhook request.
""".stripMargin
)

val deleteWebhookNotification: Endpoint[
(ApiKeyCredentials, JwtCredentials),
Expand Down
Loading

0 comments on commit 5922023

Please sign in to comment.