Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/infrastructure/utils/python/g…
Browse files Browse the repository at this point in the history
…ithub-helpers/pip-aed9f6bbcd
  • Loading branch information
yshyn-iohk committed May 21, 2024
2 parents d532933 + 0c71414 commit e39b97f
Show file tree
Hide file tree
Showing 43 changed files with 445 additions and 600 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ defaults:
shell: bash
working-directory: "tests/integration-tests"

permissions:
checks: write
pull-requests: write

jobs:
run-integration-tests:
name: "Run integration tests"
Expand Down Expand Up @@ -64,16 +68,16 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '19'
distribution: "zulu"
java-version: "19"

- name: Run integration tests
env:
PRISM_NODE_VERSION: ${{ steps.build_local_cloud_agent.outputs.prism_node_version }}
OPEN_ENTERPRISE_AGENT_VERSION: ${{ steps.build_local_cloud_agent.outputs.open_enterprise_agent_version }}
GITHUB_ACTOR: hyperledger-bot
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# continue-on-error: true
# continue-on-error: true
run: |
./gradlew test --tests "IntegrationTestsRunner"
Expand Down Expand Up @@ -143,6 +147,6 @@ jobs:
Failed: ${{ steps.analyze_test_results.outputs.failures }}
Errors in tests: ${{ steps.analyze_test_results.outputs.errors }}
Skipped (known bugs): ${{ steps.analyze_test_results.outputs.skipped }}
SLACK_TITLE: "Open Enterprise Agent Integration Tests: ${{ steps.analyze_test_results.outputs.conclusion }}"
SLACK_TITLE: "Identus Cloud Agent Integration Tests: ${{ steps.analyze_test_results.outputs.conclusion }}"
SLACK_USERNAME: circleci
SLACK_WEBHOOK: ${{ secrets.E2E_TESTS_SLACK_WEBHOOK }}
31 changes: 24 additions & 7 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,38 @@ on:
- cron: "0 0 * * 0"
workflow_dispatch:

permissions:
contents: write
issues: write
pull-requests: write

jobs:
scala-steward:
runs-on: ubuntu-latest
name: Launch Scala Steward
steps:
- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false

- uses: crazy-max/ghaction-import-gpg@v3
- uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg-private-key: ${{ secrets.HYP_BOT_GPG_PRIVATE }}
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
git_user_signingkey: true
git_commit_gpgsign: true
git_push_gpgsign: true

- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
echo "name: ${{ steps.import_gpg.outputs.name }}"
echo "email: ${{ steps.import_gpg.outputs.email }}"
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
Expand All @@ -31,6 +46,8 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sign-commits: true
signing-key: ${{ steps.import_gpg.outputs.keyid }}
author-email: ${{ steps.import_gpg.outputs.email }}
author-name: ${{ steps.import_gpg.outputs.name }}
branches: main
repo-config: .scala-steward.conf
7 changes: 6 additions & 1 deletion .scala-steward.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ updates.ignore = [
# If set, Scala Steward will only create or update `n` PRs each time it runs (see `pullRequests.frequency` above).
# Useful if running frequently and/or CI build are costly
# Default: null
updates.limit = 5
updates.limit = 5

# If set, Scala Steward will use this message template for the commit messages and PR titles.
# Supported variables: ${artifactName}, ${currentVersion}, ${nextVersion} and ${default}
# Default: "${default}" which is equivalent to "Update ${artifactName} to ${nextVersion}"
commits.message = "${default}\n\nSigned-off-by: Hyperledger Bot <hyperledger-bot@hyperledger.org>"
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [1.33.1](https://github.com/hyperledger/identus-cloud-agent/compare/cloud-agent-v1.33.0...cloud-agent-v1.33.1) (2024-05-21)


### Bug Fixes

* broken link for the cloud agent packages in readme file ([#1032](https://github.com/hyperledger/identus-cloud-agent/issues/1032)) ([92d17c2](https://github.com/hyperledger/identus-cloud-agent/commit/92d17c2b5f82d0ca35313ab51bd90b6f55d2cd87))
* expose new key types in rest api ([#1066](https://github.com/hyperledger/identus-cloud-agent/issues/1066)) ([9ce8d3a](https://github.com/hyperledger/identus-cloud-agent/commit/9ce8d3a8742f86c9a593c705e0f3aa472ff10987))
* rename the folder to identus for vc-jwt ([#1063](https://github.com/hyperledger/identus-cloud-agent/issues/1063)) ([364a5dc](https://github.com/hyperledger/identus-cloud-agent/commit/364a5dc7eb2b9f23b18f3775c207feff02893cbe))


### Performance Improvements

* update ts client in the performance tests, cleanup `println` ([#1041](https://github.com/hyperledger/identus-cloud-agent/issues/1041)) ([7d5ceba](https://github.com/hyperledger/identus-cloud-agent/commit/7d5cebafb34191964acfdf190c743a2ba253e883))

# [1.33.0](https://github.com/hyperledger/identus-cloud-agent/compare/cloud-agent-v1.32.1...cloud-agent-v1.33.0) (2024-05-09)


Expand Down
58 changes: 29 additions & 29 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,33 +445,33 @@ MIT | [The MIT License (MIT)](https://opensource.org/licenses/MIT) | [com.dimafe
Public Domain | [Public Domain, per Creative Commons CC0](http://creativecommons.org/publicdomain/zero/1.0/) | [org.hdrhistogram # HdrHistogram # 2.1.12](http://hdrhistogram.github.io/HdrHistogram/) | <notextile></notextile>
Public Domain | [Public Domain, per Creative Commons CC0](http://creativecommons.org/publicdomain/zero/1.0/) | [org.latencyutils # LatencyUtils # 2.0.3](http://latencyutils.github.io/LatencyUtils/) | <notextile></notextile>
none specified | []() | [net.jcip # jcip-annotations # 1.0](http://jcip.net/) | <notextile></notextile>
none specified | []() | [org.hyperledger # castor-core_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # cloud-agent-wallet-api_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # connect-core_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # connect-sql-doobie_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # event-notification_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-agent-core_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-agent-didcommx_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-data-models_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-connection_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-coordinate-mediation_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-invitation_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-issue-credential_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-mailbox_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-outofband-login_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-present-proof_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-report-problem_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-revocation-notification_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-routing-2-0_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-trust-ping_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-resolver_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-verifiable-credentials_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-anoncreds_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-core_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-sql-doobie_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-vc-jwt_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # prism-node-client_3 # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared-crypto # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared-test # 1.32.1-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # castor-core_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # cloud-agent-wallet-api_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # connect-core_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # connect-sql-doobie_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # event-notification_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-agent-core_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-agent-didcommx_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-data-models_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-connection_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-coordinate-mediation_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-invitation_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-issue-credential_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-mailbox_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-outofband-login_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-present-proof_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-report-problem_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-revocation-notification_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-routing-2-0_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-protocol-trust-ping_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-resolver_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # mercury-verifiable-credentials_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-anoncreds_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-core_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-sql-doobie_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # pollux-vc-jwt_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # prism-node-client_3 # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared-crypto # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>
none specified | []() | [org.hyperledger # shared-test # 1.33.0-SNAPSHOT](https://github.com/hyperledger/identus-cloud-agent) | <notextile></notextile>

Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ package object error {
final case class TooManyDidPublicKeyAccess(limit: Int, access: Option[Int]) extends OperationValidationError
final case class TooManyDidServiceAccess(limit: Int, access: Option[Int]) extends OperationValidationError
final case class InvalidArgument(msg: String) extends OperationValidationError
final case class InvalidPublicKeyData(ids: Seq[String]) extends OperationValidationError
final case class InvalidMasterKeyType(ids: Seq[String]) extends OperationValidationError
final case class InvalidMasterKeyData(ids: Seq[String]) extends OperationValidationError
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.hyperledger.identus.shared.crypto.Apollo
import zio.*

import scala.collection.immutable.ArraySeq
import scala.util.Failure

object DIDOperationValidator {
final case class Config(
Expand Down Expand Up @@ -51,7 +50,6 @@ private object CreateOperationValidator extends BaseOperationValidator {
_ <- validateUniquePublicKeyId(operation, extractKeyIds)
_ <- validateUniqueServiceId(operation, extractServiceIds)
_ <- validateMasterKeyIsSecp256k1(operation, extractKeyData)
_ <- validateKeyData(operation, extractKeyData)
_ <- validateKeyIdIsUriFragment(operation, extractKeyIds)
_ <- validateKeyIdLength(config)(operation, extractKeyIds)
_ <- validateServiceIdIsUriFragment(operation, extractServiceIds)
Expand Down Expand Up @@ -102,7 +100,6 @@ private object UpdateOperationValidator extends BaseOperationValidator {
_ <- validateMaxPublicKeysAccess(config)(operation, extractKeyIds)
_ <- validateMaxServiceAccess(config)(operation, extractServiceIds)
_ <- validateMasterKeyIsSecp256k1(operation, extractKeyData)
_ <- validateKeyData(operation, extractKeyData)
_ <- validateKeyIdIsUriFragment(operation, extractKeyIds)
_ <- validateKeyIdLength(config)(operation, extractKeyIds)
_ <- validateServiceIdIsUriFragment(operation, extractServiceIds)
Expand Down Expand Up @@ -360,45 +357,26 @@ private trait BaseOperationValidator {
UriUtils.normalizeUri(uri).contains(uri)
}

protected def validateKeyData[T <: PrismDIDOperation](
operation: T,
keyDataExtractor: KeyDataExtractor[T]
): Either[OperationValidationError, Unit] = {
val keys = keyDataExtractor(operation)
val apollo = Apollo.default
val parsedKeys = keys.map { case (id, _, keyData) =>
val pk = keyData match {
case PublicKeyData.ECKeyData(EllipticCurve.SECP256K1, x, y) =>
apollo.secp256k1.publicKeyFromCoordinate(x.toByteArray, y.toByteArray)
case PublicKeyData.ECKeyData(EllipticCurve.ED25519, x, _) =>
apollo.ed25519.publicKeyFromEncoded(x.toByteArray)
case PublicKeyData.ECKeyData(EllipticCurve.X25519, x, _) =>
apollo.x25519.publicKeyFromEncoded(x.toByteArray)
case PublicKeyData.ECCompressedKeyData(EllipticCurve.SECP256K1, data) =>
apollo.secp256k1.publicKeyFromEncoded(data.toByteArray)
case PublicKeyData.ECCompressedKeyData(EllipticCurve.ED25519, data) =>
apollo.ed25519.publicKeyFromEncoded(data.toByteArray)
case PublicKeyData.ECCompressedKeyData(EllipticCurve.X25519, data) =>
apollo.x25519.publicKeyFromEncoded(data.toByteArray)
}
id -> pk
}

val invalidKeyDataIds = parsedKeys.collect { case (id, Failure(_)) => id }
if (invalidKeyDataIds.isEmpty) Right(())
else Left(OperationValidationError.InvalidPublicKeyData(invalidKeyDataIds))
}

protected def validateMasterKeyIsSecp256k1[T <: PrismDIDOperation](
operation: T,
keyDataExtractor: KeyDataExtractor[T]
): Either[OperationValidationError, Unit] = {
val keys = keyDataExtractor(operation)
val masterKeys = keys.collect { case (id, InternalKeyPurpose.Master, keyData) => id -> keyData }
val invalidKeyIds = masterKeys.filter(_._2.crv != EllipticCurve.SECP256K1).map(_._1)
val invalidKeyIds = masterKeys
.filter { case (_, pk) =>
pk match {
case PublicKeyData.ECKeyData(EllipticCurve.SECP256K1, x, y) =>
Apollo.default.secp256k1.publicKeyFromCoordinate(x.toByteArray, y.toByteArray).isFailure
case PublicKeyData.ECCompressedKeyData(EllipticCurve.SECP256K1, data) =>
Apollo.default.secp256k1.publicKeyFromEncoded(data.toByteArray).isFailure
case _ => true // master key must be secp256k1
}
}
.map(_._1)

if (invalidKeyIds.isEmpty) Right(())
else Left(OperationValidationError.InvalidMasterKeyType(invalidKeyIds))
else Left(OperationValidationError.InvalidMasterKeyData(invalidKeyIds))
}

}
Loading

0 comments on commit e39b97f

Please sign in to comment.