Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix the release flow and upgrade the docusaurus to the latest version #125

Merged
merged 21 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4d7e168
feat: start another try
yshyn-iohk Jul 8, 2024
5a81547
feat: with dispatch
yshyn-iohk Jul 8, 2024
859d10d
chore(release): release the Identus documentation portal 1.102.0-snap…
hyperledger-bot Jul 8, 2024
60b2649
Revert "chore(release): release the Identus documentation portal 1.10…
yshyn-iohk Jul 8, 2024
b7e329d
deps: upgrade dependencies #1
yshyn-iohk Jul 8, 2024
c842a56
deps: upgrade dependencies #2
yshyn-iohk Jul 8, 2024
8c935e9
feat: upgrade docusaurus and semantic-release packages
yshyn-iohk Jul 8, 2024
3ad2cec
ci: add gpgsign
yshyn-iohk Jul 8, 2024
3070060
ci: remove persist_auth
yshyn-iohk Jul 8, 2024
dd30868
ci: change gpg sign option
yshyn-iohk Jul 8, 2024
a5b250c
feat: revert release
hyperledger-bot Jul 8, 2024
7667771
chore(release): release the Identus documentation portal 1.102.0-snap…
hyperledger-bot Jul 8, 2024
70d76f5
chore: add submodules
yshyn-iohk Jul 9, 2024
a23a16f
ci: add mega-linter configuration
yshyn-iohk Jul 9, 2024
450f95b
feat: updated CODEOWNERS to protect the main branch
yshyn-iohk Jul 9, 2024
12759ab
chore(release): release the Identus documentation portal 1.102.0-snap…
hyperledger-bot Jul 9, 2024
85bc2cd
fix: rendering issues
yshyn-iohk Jul 9, 2024
61eca76
Merge remote-tracking branch 'origin/beta' into beta4
yshyn-iohk Jul 9, 2024
6a6630d
feat: add megalinter github action
yshyn-iohk Jul 9, 2024
f3ea376
chore(release): release the Identus documentation portal 1.102.0-snap…
hyperledger-bot Jul 9, 2024
fdcd71b
chore: cleanup the CHANGELOG.md and downgrade the version before maki…
yshyn-iohk Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence
* @petevielhaber
* @petevielhaber @yshyn-iohk @amagyar-iohk @bvoiturier @lohanspies @mkbreuningIOHK @Dale-iohk @elribonazo @essbante-io

# Docs:
*.md @petevielhaber
85 changes: 85 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter

on:
pull_request:
branches: [ main, feature/*, feat/*, docs/*, ci/*, bug/*, fix/* ]

env: # Comment env block if you don't want to apply fixes
# Apply linter fixes configuration
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances

- name: MegaLinter
id: ml
uses: oxsecurity/megalinter@v7
env:
# All available variables are described in documentation
# https://megalinter.io/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Upload MegaLinter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log

- uses: crazy-max/ghaction-import-gpg@v3
if: failure() && steps.ml.outputs.has_updated_sources == 1
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: false

# 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 }}
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: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
17 changes: 14 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Release docs image
on:
workflow_call:
workflow_dispatch:
inputs:
release-branch:
description: "Branch to release from"
required: false
default: "main"

jobs:
release:
Expand All @@ -17,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.IDENTUS_CI }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.inputs.release-branch }}
fetch-depth: 0

Expand All @@ -26,15 +31,15 @@ jobs:
with:
node-version: 16

- uses: crazy-max/ghaction-import-gpg@v5
- uses: crazy-max/ghaction-import-gpg@v6
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
git_tag_gpgsign: false

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -49,6 +54,12 @@ jobs:
npm install -g log4brains
log4brains build --out ../static/adrs --basePath /adrs
touch ../static/adrs/.nojekyll

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Release
env:
GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }}
Expand Down
61 changes: 61 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# MegaLinter configuration for Docusaurus

ENABLE:
- JAVASCRIPT_ES
- TYPESCRIPT_ES
- MARKDOWN_MARKDOWNLINT
- YAML_YAMLLINT
- JSON_JSONLINT
- HTML_HTMLHINT

FILE_EXTENSIONS:
- js
- jsx
- ts
- tsx
- md
- yml
- yaml
- json
- html

DIRECTORY_INCLUDE:
# - src TODO: consider to uncomment this line later
- infra
- documentation

DIRECTORY_EXCLUDE:
- node_modules
- static
- identus-cloud-agent
- identus-edge-agent-ts
- .docusaurus
- src

MARKDOWN_MARKDOWNLINT:
config: .markdownlint.json

YAML_YAMLLINT:
config: .yamllint

JSON_JSONLINT:
config: .jsonlintrc

HTML_HTMLHINT:
config: .htmlhintrc

JAVASCRIPT_ES:
config: .eslintrc.js
prettier: true

TYPESCRIPT_ES:
config: .eslintrc.js
prettier: true

REPORT_OUTPUTS:
- json
- html
- markdown

DISABLE_LINTERS_ERRORS_REPORT: false
LINTERS_CLI_OPTIONS: '--fix'
4 changes: 3 additions & 1 deletion documentation/docs/identus/cloud-agent/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ and the `KEYCLOAK_ROLES_CLAIM_PATH` should be set to `resource_access.<KEYCLOAK_

The current authorization logic is built on the UMA specification, configuring permissions as user A controls resource W. In this model, user A is a registered user in Keycloak, and wallet W is a resource registered in Keycloak.

These configurations are managed manually in Keycloak. However, for a better experience, the Agent can execute these actions through the REST API endpoint. For each wallet, a corresponding resource gets created with the name wallet-{wallet_id} in Keycloak. Similarly, a corresponding policy is created for each user and resource with the name user {userId} on wallet {wallet_resource_name} permission.
These configurations are managed manually in Keycloak. However, for a better experience, the Agent can execute these actions through the REST API endpoint.
For each wallet, a corresponding resource gets created with the name wallet-`wallet_id` in Keycloak.
Similarly, a corresponding policy is created for each user and resource with the name user `userId` on wallet `wallet_resource_name` permission.

The REST API endpoint to configure permissions in Keycloak is:

Expand Down
18 changes: 5 additions & 13 deletions documentation/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ Follow the steps in your desired platform as stated below:

The below code examples show how to establish mediation when building your own application.

<details><summary>Code examples</summary>
<summary>Code examples</summary>
3. The following code examples represent establishing mediation and instantiating the Cloud Agent.

<Tabs>
Expand Down Expand Up @@ -487,9 +487,6 @@ agent.startFetchingMessages()

</TabItem>
</Tabs>
</details>



## Establish Holder connections
To connect the Holder to both Cloud Agent instances, you must run this in both Issuer and Verifier endpoints.
Expand Down Expand Up @@ -556,7 +553,7 @@ curl --location \
</TabItem>
</Tabs>

<details><summary>Code examples</summary>
<summary>Code examples</summary>
<Tabs>
<TabItem value="js" label="Typescript">

Expand All @@ -583,7 +580,6 @@ agent.acceptOutOfBandInvitation(invitation)

</TabItem>
</Tabs>
</details>

## Issue a Credential from the Issuer to the holder

Expand Down Expand Up @@ -649,7 +645,7 @@ automaticIssuance is optional. It can also be manually triggered and confirmed b
</Tabs>


<details><summary>Code examples</summary>
<summary>Code examples</summary>

5. The exchange between CredentialOffer and CredentialRequest is demonstrated through more advanced code samples below, showcasing how different platforms handle it.

Expand Down Expand Up @@ -731,7 +727,6 @@ agent.handleReceivedMessagesEvents().collect { list ->

</TabItem>
</Tabs>
</details>

### Store the Issued Credential [Holder]
:::caution
Expand All @@ -740,7 +735,7 @@ The sample application are using an insecure storage solution which should only

:::

<details><summary>Code examples</summary>
<summary>Code examples</summary>
6. Once the Holder receives a credential from the Cloud Agent, it needs to store the credential somewhere:

<Tabs>
Expand Down Expand Up @@ -807,7 +802,6 @@ agent.handleReceivedMessagesEvents().collect { list ->

</TabItem>
</Tabs>
</details>

## Request a verification from the Verifier Cloud Agent to the Holder (JWT W3C Credential)
Now that the Holder has received a credential, it can be used in a verification workflow between a Holder and a Verifier. This requires the following steps:
Expand Down Expand Up @@ -857,7 +851,7 @@ curl --location \

6. The Holder needs an Edge Agent running with the message listener active. It will receive the presentation proof request from the Verifier Cloud Agent for the correct type of messages as detailed below:

<details><summary>Code examples</summary>
<summary>Code examples</summary>

<Tabs>
<TabItem value="js" label="Typescript">
Expand Down Expand Up @@ -945,8 +939,6 @@ agent.handleReceivedMessagesEvents().collect { list ->
</TabItem>

</Tabs>
</details>


### Verifier: Will then check on the API if the Presentation Request has been completed or not.

Expand Down
8 changes: 4 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';

const path = require('path')
// const {useColorMode} = require('@docusaurus/theme-common');
// const {colorMode} = useColorMode()
Expand Down Expand Up @@ -164,8 +164,8 @@ const config = {
copyright: `© ${new Date().getFullYear()} Identus. All rights reserved.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},

},
Expand Down
2 changes: 1 addition & 1 deletion identus-cloud-agent
Submodule identus-cloud-agent updated 39 files
+1 −1 cloud-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/BackgroundJobError.scala
+4 −2 ...d-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/ConnectBackgroundJobs.scala
+1 −1 ...d-agent/service/server/src/main/scala/org/hyperledger/identus/agent/server/jobs/PresentBackgroundJobs.scala
+0 −7 ...d-agent/service/server/src/main/scala/org/hyperledger/identus/oid4vci/CredentialIssuerServerEndpoints.scala
+0 −2 .../service/server/src/test/scala/org/hyperledger/identus/oid4vci/domain/OIDCCredentialIssuerServiceSpec.scala
+1 −1 ...e/wallet-api/src/main/scala/org/hyperledger/identus/agent/walletapi/model/error/DIDSecretStorageError.scala
+1 −2 connect/core/src/main/scala/org/hyperledger/identus/connect/core/repository/ConnectionRepository.scala
+0 −1 ...ect/core/src/test/scala/org/hyperledger/identus/connect/core/repository/ConnectionRepositorySpecSuite.scala
+2 −2 docs/docusaurus/credentials/issue.md
+1 −1 docs/docusaurus/schemas/credential-schema.md
+1 −1 docs/docusaurus/secrets/seed-generation.md
+2 −2 examples/.nickel/versions.ncl
+1 −1 examples/mt-keycloak-vault/compose.yaml
+1 −1 examples/mt-keycloak/compose.yaml
+1 −1 examples/mt/compose.yaml
+3 −3 examples/st-multi/compose.yaml
+2 −2 examples/st-oid4vci/compose.yaml
+1 −1 examples/st-vault/compose.yaml
+1 −1 examples/st/compose.yaml
+1 −1 mercury/models/src/main/scala/org/hyperledger/identus/mercury/model/error/package.scala
+1 −1 shared/core/src/main/scala/org/hyperledger/identus/shared/models/Failure.scala
+11 −0 tests/integration-tests/build.gradle.kts
+2 −0 tests/integration-tests/hosts_test
+7 −0 tests/integration-tests/src/test/kotlin/abilities/ListenToEvents.kt
+61 −5 tests/integration-tests/src/test/kotlin/config/services/Keycloak.kt
+27 −0 tests/integration-tests/src/test/kotlin/eu/europa/ec/eudi/openid4vci/Types.kt
+17 −6 tests/integration-tests/src/test/kotlin/steps/Setup.kt
+172 −0 tests/integration-tests/src/test/kotlin/steps/oid4vci/IssueCredentialSteps.kt
+7 −2 tests/integration-tests/src/test/resources/configs/basic.conf
+7 −2 tests/integration-tests/src/test/resources/configs/mt_keycloak.conf
+14 −0 tests/integration-tests/src/test/resources/configs/mt_keycloak_agent_role.conf
+14 −0 tests/integration-tests/src/test/resources/configs/mt_keycloak_vault.conf
+14 −0 tests/integration-tests/src/test/resources/configs/mt_vault_approle.conf
+14 −0 tests/integration-tests/src/test/resources/configs/mt_vault_token.conf
+14 −0 tests/integration-tests/src/test/resources/configs/two_agents_basic.conf
+14 −0 tests/integration-tests/src/test/resources/configs/two_agents_sharing_keycloak.conf
+4 −2 tests/integration-tests/src/test/resources/containers/keycloak-oid4vci.yml
+22 −0 tests/integration-tests/src/test/resources/features/oid4vci/issue_jwt.feature
+2 −0 tests/integration-tests/src/test/resources/logback-test.xml
Loading
Loading