Skip to content

Commit

Permalink
Merge branch 'main' into fix/dco-yshyn-iohk
Browse files Browse the repository at this point in the history
  • Loading branch information
yshyn-iohk authored Sep 11, 2024
2 parents 2e9f708 + c2f1547 commit fb6ff4c
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.109.0](https://github.com/hyperledger/identus-docs/compare/v1.108.0...v1.109.0) (2024-09-11)

### :rocket: New Content

* Docker Logging Considerations ([#162](https://github.com/hyperledger/identus-docs/issues/162)) ([cea862b](https://github.com/hyperledger/identus-docs/commit/cea862b4f7b111d84461597dd192de2a0f09ee96))

## [1.108.0](https://github.com/hyperledger/identus-docs/compare/v1.107.0...v1.108.0) (2024-09-09)

### :rocket: New Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ The following enviroment variables can be used to configure Cloud Agent:
| KEYCLOAK_CLIENT_SECRET | The Keycloak client secret. | String | `prism-agent-demo-secret` |
| KEYCLOAK_UMA_AUTO_UPGRADE_RPT | Whether or not to enable automatic upgrade of RPT tokens. If disabled, `accessToken` must be RPT and include the permission claims. | Boolean | true |
| KEYKLOAK_ROLES_CLAIM_PATH | The json path to the `roles` claim in the JWT payload . Used for role-based authorization (e.g. admin or tenant). | String | `resource_access.<KEYCLOAK_CLIENT_ID>.roles` |
| PRESENTATION_INVITATION_EXPIRY | The presentation invitation expiry duration e.g 300 seconds. After which the OOB Request Presentation will expire | String | 300 seconds |
| ISSUANCE_INVITATION_EXPIRY | The presentation invitation expiry duration e.g 300 seconds. After which the OOB Credential Offer will expire | String | 300 seconds |
63 changes: 63 additions & 0 deletions documentation/docs/identus/troubleshooting&considerations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Troubleshooting & Considerations

## Docker Logging Management Considerations
When setting up a long-running environment using Docker Compose, it’s important to consider several factors to avoid issues such as excessive log file sizes leading to out-of-memory errors.

### Configuring Docker Compose for Effective Log Management
To ensure your Docker containers run smoothly and avoid problems related to excessive log file growth, configure log rotation in your docker-compose.yml file. This will help manage log file sizes and prevent out-of-memory errors caused by uncontrolled log growth.

### Log Rotation Example

Here’s a example in the mediator how to set up log rotation in your Docker Compose configuration:

1. Open your docker-compose.yml file.
2. Add or update the logging configuration under your service definition. For example:

```yaml
version: '3.8'

services:
identus-mediator:
image: ghcr.io/input-output-hk/atala-prism-mediator:0.14.2
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
```
- `driver`: Specifies the logging driver to use. The json-file driver is the default and supports log rotation options.
- `max-size`: Sets the maximum size of the log file before it gets rotated. In the example above, the log file will be rotated when it reaches 10 MB.
- `max-file`: Determines the number of rotated log files to keep. In this example, up to 3 log files will be kept before old files are deleted.

```shell
docker-compose up -d
```

3. Save the changes to your `docker-compose.yml` file and **Restart** your Docker containers to apply the new logging configuration.

### Configuring Docker Daemon for Effective Log Management

We should consider configuring the logging Options in the **Docker Daemon**. For a global logging configuration applicable to all Docker containers. We can modify the Docker daemon settings. This approach ensures consistent log management across all containers.

1. Edit the Docker daemon configuration file (usually located at /etc/docker/daemon.json). If the file doesn’t exist, you can create it.
2. Add or update the logging options in the `daemon.json` file:

```json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
```
3. Restart the Docker daemon to apply the new settings:

```shell
sudo systemctl restart docker
```

#### Docker logging drivers

For more information see https://docs.docker.com/engine/logging/configure/#supported-logging-drivers
194 changes: 192 additions & 2 deletions documentation/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,13 @@ agent.acceptOutOfBandInvitation(invitation)

The credential issuance flow consists of multiple steps, detailed in this section. It starts with the Issuer sending a [Credential Offer](/docs/concepts/glossary/#credential-offer) to the Holder, which would accept or reject this invitation and create a `credentialRequest` from it. The [credential request](/docs/concepts/glossary/#credential-request) gets sent through DIDComm to the Issuer, issuing and sending the credential back to the Holder.

### Create a Credential Offer **Issuer Agent**
The Issuer can create a credential offer in two ways:
1. As a direct credential offer DIDComm message for a holder with an existing connection
2. As an credential offer as attachment in an OOB invitation message for connectionless issuance

<Tabs>
<TabItem value="existing" label="With Existing Connection">
### Create a Credential Offer with an existing connection **Issuer Agent**

1. To trigger the creation of a credential-offer, we call the credential-offers-endpoint, as follows:

Expand Down Expand Up @@ -630,7 +636,98 @@ curl --location --request POST 'http://localhost:8000/cloud-agent/issue-credenti
"automaticIssuance": true
}'
```
</TabItem>
<TabItem value="connectionless" label="Connectionless Issuance">
### Create a Credential Offer as Invitation for connectionless issuance **Issuer Agent**

1. To trigger the creation of a credential-offer, we call the credential-offers-invitation-endpoint, as follows:

:::info

Please replace the following variables in the example request before sending:

- `goalCode`: OPTIONAL A self-attested code the receiver may want to display to the user or use in automatically deciding what to do with the out-of-band message,
- `goal`: OPTIONAL. A self-attested string that the receiver may want to display to the user about the context-specific goal of the out-of-band message.
- `publishedPrismDID`: The short form of the PRISM DID created when setting up the Issuer agent

The Issuing DID is the published PRISM DID in its short version which was also used to create and publish the credential schema.

- ``

:::

```bash
curl --location --request POST 'http://localhost:8000/cloud-agent/issue-credentials/credential-offers/invitation' \
--header 'Content-Type: application/json' \
--data-raw '{
"claims": {"emailAddress":"sampleEmail", "familyName":"", "dateOfIssuance":"2023-01-01T02:02:02Z", "drivingLicenseID":"", "drivingClass":1},
"goalCode": [[goalCode]],
"goal": [[goal]],
"credentialFormat": "JWT",
"issuingDID": [[publishedPrismDID]],
"automaticIssuance": true
}'
```


### Accept Credential Offer Invitation for connectionless issuance **Holder**

For connectionless issuance, the Holder needs to accept the invitation containing the credential offer. This step is necessary before creating the Credential Request.
#### Demo application
<Tabs>
<TabItem value="js" label="Typescript Sample APP">

1. In the browser at localhost:3000, navigate to the "Credential Offer" section.
2. Paste the invitation URL received from the Issuer into the provided input field.
3. Click on "Accept Invitation" to process the credential offer.

</TabItem>
<TabItem value="swift" label="Swift Sample APP">

1. In the Swift mobile app, go to the "Credential Offer" section.
2. Enter the invitation URL received from the Issuer.
3. Tap on "Accept Invitation" to process the credential offer.

</TabItem>
<TabItem value="android" label="Android Sample APP">

1. In the Android mobile app, navigate to the "Credential Offer" section.
2. Input the invitation URL provided by the Issuer.
3. Tap "Accept Invitation" to process the credential offer.

</TabItem>
</Tabs>

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

```js
const parsed = await props.agent.parseOOBInvitation(new URL([[OOB URL]]));
await props.agent.acceptDIDCommInvitation(parsed);
```

</TabItem>
<TabItem value="swift" label="Swift">

```swift
let message = try agent.parseOOBInvitation(url: oobUrl)
try await agent.acceptDIDCommInvitation(invitation: message)
```

</TabItem>
<TabItem value="android" label="Android">

```kotlin
val invitation = agent.parseInvitation(oobUrl)
agent.acceptOutOfBandInvitation(invitation)
```

</TabItem>
</Tabs>

</TabItem>
</Tabs>
### Create CredentialRequest from CredentialOffer **Holder**

2. Because this credential Offer was created with the `automaticIssuance` true, as soon as the `CloudAgent` receives this `credentialRequest` it will respond with the `IssuedCredential` message and send this back to the holder.
Expand Down Expand Up @@ -829,12 +926,16 @@ Now that the Holder has received a credential, it can be used in a verification

:::info

In the example, we show a verification flow that assumes a connection between Holder and Verifier. In the future, we will also support connectionless verification.
In the example, we demonstrate two verification flows:

1. Verification with an established connection between the Holder and the Verifier.
2. Connectionless verification in which the Holder and Verifier do not have a pre-established connection.
:::


### Verifier Agent
<Tabs>
<TabItem value="existing" label="With Existing Connection">

5. To run this section, we will use [the connection](/docs/quick-start#establish-connection-on-the-verifier-cloud-agent) we created between the Holder and the Verifier.

Expand All @@ -861,6 +962,95 @@ curl --location \

* This API request will return a `presentationRequestId,` which the verifier can use later to check the current status of the request.

</TabItem>
<TabItem value="connectionless" label="Connectionless Request Presentation">

5. To run this section, we'll use the presentation invitation endpoint to create a request presentation invitation, which the holder can scan to receive the invitation or the verifier can share directly.

```bash
curl --location \
--request POST 'http://localhost:9000/cloud-agent/present-proof/presentations/invitation' \
--header 'Content-Type: application/json' \
--data-raw '{
"goalCode": [[goalCode]],
"goal": [[goal]],
"credentialFormat": "JWT",
"proofs": [
{
"schemaId": [[schemaId]],
"trustIssuers": [
[[PUBLISHED PRISM DID FROM THE ISSUER]]
]
}
],
"options": {
"challenge": "A challenge for the holder to sign",
"domain": "domain.com"
}
}'
```

* This API request will return an `invitationId` along with an Out-Of-Band (OOB) message. The OOB message includes a Request Presentation in JSON format as an attachment and is encoded as a base64 URL-encoded string, which can be shared with the holder.

### Accept Request Presentation invitation for connectionless verification **Holder**

For connectionless verification, the Holder needs to accept the invitation containing the Request Presentation.
#### Demo application
<Tabs>
<TabItem value="js" label="Typescript Sample APP">

1. In the browser at localhost:3000, navigate to the "Request Presentation" section.
2. Paste the invitation URL received from the Issuer into the provided input field.
3. Click on "Accept Invitation" to process the request presentation.

</TabItem>
<TabItem value="swift" label="Swift Sample APP">

1. In the Swift mobile app, go to the "Request Presentation" section.
2. Enter the invitation URL received from the Issuer.
3. Tap on "Accept Invitation" to process the request presentation.

</TabItem>
<TabItem value="android" label="Android Sample APP">

1. In the Android mobile app, navigate to the "Request Presentation" section.
2. Input the invitation URL provided by the Issuer.
3. Tap "Accept Invitation" to process the request presentation.

</TabItem>
</Tabs>

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

```js
const parsed = await props.agent.parseOOBInvitation(new URL([[OOB URL]]));
await props.agent.acceptDIDCommInvitation(parsed);
```

</TabItem>
<TabItem value="swift" label="Swift">

```swift
let message = try agent.parseOOBInvitation(url: oobUrl)
try await agent.acceptDIDCommInvitation(invitation: message)
```

</TabItem>
<TabItem value="android" label="Android">

```kotlin
val invitation = agent.parseInvitation(oobUrl)
agent.acceptOutOfBandInvitation(invitation)
```

</TabItem>
</Tabs>

</TabItem>
</Tabs>



### Holder: Receives the Presentation proof request
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const sidebars = {
],
},
"identus/mediator",
"identus/troubleshooting&considerations",
"identus/getting-help",
],
},
Expand Down
2 changes: 1 addition & 1 deletion identus-cloud-agent
2 changes: 1 addition & 1 deletion identus-edge-agent-sdk-ts
Submodule identus-edge-agent-sdk-ts updated 94 files
+1 −1 .github/workflows/ci.yml
+10 −7 .github/workflows/e2e-tests.yml
+3 −7 .github/workflows/release.yml
+3 −37 CONTRIBUTING.md
+15 −18 README.md
+146 −24 demos/next/package-lock.json
+1 −5 demos/next/src/actions/types.ts
+1 −2 demos/next/src/components/OOB.tsx
+1 −5 demos/next/src/pages/debug.tsx
+2 −9 demos/next/src/reducers/app.ts
+0 −1 demos/next/src/reducers/store.ts
+0 −56 docs/examples/ConnectionlessPresentation.md
+2 −9 docs/examples/index.md
+6 −15 externals/run.sh
+1 −1 integration-tests/e2e-tests/.eslintrc.yml
+0 −1 integration-tests/e2e-tests/.gitignore
+18 −0 integration-tests/e2e-tests/cucumber.js
+0 −22 integration-tests/e2e-tests/cucumber.mjs
+1 −1 integration-tests/e2e-tests/features/create_connection.feature
+0 −14 integration-tests/e2e-tests/features/provide_anoncred_proof.feature
+6 −1 integration-tests/e2e-tests/features/verify_jwt_credential.feature
+3 −5 integration-tests/e2e-tests/package.json
+0 −1 integration-tests/e2e-tests/run-local-e2e.sh
+20 −31 integration-tests/e2e-tests/src/abilities/WalletSdk.ts
+3 −3 integration-tests/e2e-tests/src/configuration/CloudAgentConfiguration.ts
+0 −3 integration-tests/e2e-tests/src/configuration/allure-reporter.mjs
+30 −30 integration-tests/e2e-tests/src/configuration/inmemory/index.ts
+17 −17 integration-tests/e2e-tests/src/configuration/inmemory/instance.ts
+12 −16 integration-tests/e2e-tests/src/configuration/inmemory/internal.ts
+1 −1 integration-tests/e2e-tests/src/configuration/inmemory/types.ts
+6 −18 integration-tests/e2e-tests/src/steps/CloudAgentSteps.ts
+59 −35 integration-tests/e2e-tests/src/steps/EdgeAgentSteps.ts
+2 −12 integration-tests/e2e-tests/src/steps/LifecycleSteps.ts
+1 −69 integration-tests/e2e-tests/src/workflow/CloudAgentWorkflow.ts
+16 −23 integration-tests/e2e-tests/src/workflow/EdgeAgentWorkflow.ts
+673 −742 integration-tests/e2e-tests/yarn.lock
+1,560 −629 package-lock.json
+6 −6 package.json
+2 −5 publish.sh
+7 −7 release-dev.config.js
+7 −7 release-prod.config.js
+12 −12 release.base.config.js
+59 −39 src/apollo/Apollo.ts
+1 −1 src/apollo/utils/Ed25519PrivateKey.ts
+4 −5 src/apollo/utils/Secp256k1PrivateKey.ts
+1 −1 src/apollo/utils/Secp256k1PublicKey.ts
+22 −19 src/apollo/utils/derivation/DerivationPath.ts
+1 −1 src/castor/did/prismDID/PrismDIDPublicKey.ts
+0 −1 src/domain/index.ts
+12 −54 src/domain/models/Api.ts
+0 −9 src/domain/models/DIDDocument.ts
+1 −0 src/domain/models/Errors.ts
+6 −13 src/domain/models/Message.ts
+8 −21 src/domain/models/MessageAttachment.ts
+5 −0 src/domain/models/errors/Api.ts
+58 −77 src/domain/models/errors/Apollo.ts
+4 −8 src/domain/models/errors/Common.ts
+23 −0 src/domain/models/errors/Mnemonic.ts
+1 −6 src/domain/models/errors/Pollux.ts
+1 −1 src/domain/models/keyManagement/Key.ts
+0 −83 src/domain/utils/JWT.ts
+36 −19 src/domain/utils/hash.ts
+6 −6 src/domain/utils/randomBytes.ts
+11 −14 src/edge-agent/Agent.Credentials.ts
+15 −26 src/edge-agent/Agent.Invitations.ts
+7 −5 src/edge-agent/Agent.ts
+69 −0 src/edge-agent/helpers/ApiImpl.ts
+0 −76 src/edge-agent/helpers/FetchApi.ts
+9 −0 src/edge-agent/helpers/HttpError.ts
+6 −35 src/edge-agent/protocols/invitation/v2/DIDCommInvitationRunner.ts
+12 −0 src/edge-agent/protocols/invitation/v2/InvitationRunner.ts
+23 −13 src/edge-agent/protocols/invitation/v2/OutOfBandInvitation.ts
+24 −0 src/edge-agent/protocols/invitation/v2/OutOfBandParser.ts
+1 −3 src/edge-agent/protocols/pickup/PickupRunner.ts
+1 −1 src/index.ts
+0 −10 src/mercury/didcomm/Wrapper.ts
+19 −15 src/pluto/Pluto.ts
+32 −53 src/pollux/Pollux.ts
+35 −66 src/pollux/utils/Bitstring.ts
+27 −19 src/pollux/utils/JWT.ts
+26 −27 src/pollux/utils/SDJWT.ts
+23 −5 src/pollux/utils/jwt/JWTCore.ts
+54 −0 src/pollux/utils/jwt/types.ts
+6 −42 tests/agent/Agent.test.ts
+10 −8 tests/apollo/Apollo.test.ts
+2 −1 tests/castor/PrismDID.test.ts
+0 −79 tests/domain/JWT.test.ts
+4 −4 tests/mercury/Mercury.test.ts
+0 −67 tests/pollux/Bitstring.test.ts
+0 −66 tests/pollux/JWT.test.ts
+12 −25 tests/pollux/Pollux.revocation.test.ts
+211 −208 tests/pollux/Pollux.test.ts
+0 −150 tests/utils/api.test.ts
+0 −79 tests/utils/server.js
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "identus-documentation-portal",
"version": "1.108.0",
"version": "1.109.0",
"private": true,
"license": "Apache-2.0",
"scripts": {
Expand Down

0 comments on commit fb6ff4c

Please sign in to comment.