Skip to content

Commit

Permalink
Merge pull request #843 from 0xPolygonID/develop
Browse files Browse the repository at this point in the history
Release 3.0.1
  • Loading branch information
x1m3 authored Nov 8, 2024
2 parents a35e1a4 + acb18ab commit e8b5667
Show file tree
Hide file tree
Showing 17 changed files with 384 additions and 243 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ Welcome to Issuer Node! We're thrilled to have you here. Before you get started,

## How to Contribute

**Reporting Issues**: If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. If the bug is a security vulnerability, please report it directly [here](https://support.polygon.technology/support/solutions/categories/82000473421/folders/82000694808).
**Reporting Issues**: If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. If the bug is a security vulnerability, please report it directly [in our Telegram channel](https://t.me/PrivadoID_Official/2).

**Requesting Features**: If you have ideas for new features or enhancements, please submit a feature request on GitHub.

**Submitting Changes**: Fork the repository, make your changes, and submit a pull request. The `develop` branch is the default branch for development. Pull request to `main` branch only will be accepted for hotfixes or releases. Please follow the guidelines outlined below.
**Submitting Changes**: Fork the repository, make your changes, and submit a pull request. The `develop` branch is the default branch for development. Pull request to `main` branch only will be accepted for hot-fixes or releases. Please follow the guidelines outlined below.

## Getting Started

To set up the project locally, follow the [README](./README.md#quick-start-installation) instructions.

For an advanced setup, visit our [extended documentation](https://devs.polygonid.com/docs/issuer/issuer-configuration).
For an advanced setup, visit our [extended documentation](https://docs.privado.id/docs/issuer/issuer-configuration).

## Issue Tracker Guidelines

Expand All @@ -36,7 +36,7 @@ Provide detailed information and steps to reproduce when reporting bugs.
Follow the issue template if available.

## Code Contribution Guidelines
Before submitting a contribution, please consider whether it will be useful to the community and try to minimise breaking changes. In general, a Pull Request with breaking changes is unlikely to be accepted immediately.
Before submitting a contribution, please consider whether it will be useful to the community and try to minimize breaking changes. In general, a Pull Request with breaking changes is unlikely to be accepted immediately.
Submit concise and focused pull requests with clear descriptions.

Follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification both for the commits and PR names.
Expand Down Expand Up @@ -69,4 +69,4 @@ By contributing to this project, you agree to the terms of licenses [Apache](LIC

## Contact Information

If you have any questions or need assistance, feel free to contact the project maintainers [here](https://support.polygon.technology/support/solutions/categories/82000473421/folders/82000694808).
If you have any questions or need assistance, feel free to contact the project maintainers [in our Telegram channel](https://t.me/PrivadoID_Official/2).
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Streamline the **Verifiable Credentials issuance** process with the user-friendl

## Quick Start Installation
> [!NOTE]
> The provided installation guide is **non-production** ready. For production deployments please refer to [Standalone Mode Guide](https://devs.polygonid.com/docs/issuer/setup-issuer-core/).
> The provided installation guide is **non-production** ready. For production deployments please refer to [Standalone Mode Guide](https://docs.privado.id/docs/issuer/setup-issuer-core).
>
> There is no compatibility with Windows environments at this time. While using WSL should be ok, it's not officially supported.
>
Expand All @@ -57,9 +57,10 @@ Streamline the **Verifiable Credentials issuance** process with the user-friendl
### Run Issuer Node API and UI (docker compose with images from privadoid registry)
To run the issuer node (API and UI) quickly and without too many customizations follow the following steps:

1. Copy the config sample file:
1. Copy the config sample files:
```shell
cp .env-issuer.sample .env-issuer
cp .env-ui.sample .env-ui
```
2. Fill the .env-issuer config file with the proper variables:

Expand Down Expand Up @@ -251,26 +252,27 @@ make private_key <private-key> import-private-key-to-kms

## Quick Start Demo

This [Quick Start Demo](https://devs.polygonid.com/docs/quick-start-demo/) will walk you through the process of **issuing** and **verifying** your **first credential**.
This [Quick Start Demo](https://docs.privado.id/docs/quick-start-demo) will walk you through the process of **issuing** and **verifying** your **first credential**.

## Documentation

* [Issuer Node resources](https://devs.polygonid.com/docs/category/issuer/)
* [Privado ID core concepts](https://devs.polygonid.com/docs/introduction/)
* [Issuer Node resources](https://docs.privado.id/docs/category/issuer)
* [Privado ID core concepts](https://docs.privado.id/docs/introduction)

## Tools
> [!WARNING]
> **Demo Issuer** and **Verifier Demo** are for **testing** purposes **only**.

* [Schema Builder](https://schema-builder.polygonid.me/) - Create your custom schemas to issue VC.
* [Demo Issuer UI](https://user-ui:password-ui@issuer-ui.polygonid.me/) - Test our Issuer Node UI.
* [Verifier Demo](https://verifier-demo.polygonid.me/) - Verify your VCs.
* [Polygon ID Android Mobile App](https://play.google.com/store/apps/details?id=com.polygonid.wallet&hl=en&gl=US)
* [Polygon ID IOS Mobile App](https://apps.apple.com/us/app/polygon-id/id1629870183)
* [Marketplace](https://marketplace.polygonid.me/) - Explore credentials submitted by trusted issuers.
> **Privado ID Demo Issuer** and **Privado ID Verifier Backend Demo** are for **testing** purposes **only**.
* [Privado ID Schema Explorer](https://tools.privado.id): Browse and reuse community-maintained VC schemas.
* [Privado ID Schema Builder](https://tools.privado.id/builder): A tool for easy VC schema creation.
* [Privado ID Demo Issuer](https://user-ui:password-ui@issuer-node-testing.privado.id): A demo version of the Issuer Node in action.
* [Privado ID Query Builder](https://tools.privado.id/query-builder): Build and customize queries to verify VCs.
* [Privado ID Verifier Backend Demo](https://verifier-backend.privado.id): Demo of our [reference implementation](https://github.com/0xPolygonID/verifier-backend) of a verifier backend.
* [Privado ID Web Wallet](https://wallet.privado.id): Identity and credential wallet for web clients.
* [Privado ID Mobile Wallet for Android](https://play.google.com/store/apps/details?id=id.privado.wallet): Wallet for Android devices.
* [Privado ID Mobile Wallet for iOS](https://apps.apple.com/us/app/privadoid/id6566184703): Wallet for iOS devices.
* [Privado ID Marketplace](https://marketplace.privado.id): Explore credentials submitted by trusted issuers.

## License

See [LICENSE](LICENSE.md).

By contributing to this project, you agree to the terms of licenses [Apache](LICENSE-APACHE) and [Mit](LICENSE-MIT).
26 changes: 20 additions & 6 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ components:
type: string
x-omitempty: true
example: "Iden3ReverseSparseMerkleTreeProof"
enum: [ Iden3commRevocationStatusv2.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
enum: [ Iden3commRevocationStatusV1.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
displayName:
type: string
x-omitempty: false
Expand Down Expand Up @@ -1403,7 +1403,7 @@ components:
credentialStatusType:
type: string
example: "Iden3ReverseSparseMerkleTreeProof"
enum: [ Iden3commRevocationStatusv2.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
enum: [ Iden3commRevocationStatusV1.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]

GetIdentityDetailsResponse:
type: object
Expand Down Expand Up @@ -1432,7 +1432,7 @@ components:
credentialStatusType:
type: string
example: "Iden3ReverseSparseMerkleTreeProof"
enum: [ Iden3commRevocationStatusv2.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
enum: [ Iden3commRevocationStatusV1.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]

IdentityState:
type: object
Expand Down Expand Up @@ -1566,7 +1566,7 @@ components:
type: string
x-omitempty: true
example: "Iden3ReverseSparseMerkleTreeProof"
enum: [ Iden3commRevocationStatusv2.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
enum: [ Iden3commRevocationStatusV1.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
method:
type: string
x-omitempty: false
Expand Down Expand Up @@ -1784,7 +1784,7 @@ components:
type: string
x-omitempty: true
example: "Iden3ReverseSparseMerkleTreeProof"
enum: [ Iden3commRevocationStatusv2.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
enum: [ Iden3commRevocationStatusV1.0, Iden3ReverseSparseMerkleTreeProof, Iden3OnchainSparseMerkleTreeProof2023 ]
example:
credentialSchema: "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json"
type: "KYCAgeCredential"
Expand Down Expand Up @@ -2205,10 +2205,24 @@ components:
type: string
example: "polygon"
networks:
type: array
items:
$ref: '#/components/schemas/NetworkData'

NetworkData:
type: object
required:
- name
- credentialStatus
properties:
name:
type: string
example: "amoy"
credentialStatus:
type: array
items:
type: string
example: [ "amoy", "mumbai" ]
example: "Iden3commRevocationStatusV1.0"

Offer:
type: object
Expand Down
16 changes: 9 additions & 7 deletions infrastructure/local/docker-compose-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ services:
- ./scripts/sql:/docker-entrypoint-initdb.d:ro
- postgres-data-full:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

redis:
image: redis:6-alpine
healthcheck:
test: [ "CMD", "redis-cli", "-p", "6379", "ping" ]
test: ["CMD", "redis-cli", "-p", "6379", "ping"]
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -61,8 +61,10 @@ services:
- "8088:80"
env_file:
- ../../.env-ui
- ../../.env-issuer

healthcheck:
test: [ "CMD", "curl", "-f", "ui/health" ]
test: ["CMD", "curl", "-f", "ui/health"]
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -80,7 +82,7 @@ services:
- ../../localstoragekeys:/localstoragekeys:rw
- ../../resolvers_settings.yaml:/resolvers_settings.yaml
healthcheck:
test: [ "CMD", "curl", "-f", "api:3001/status" ]
test: ["CMD", "curl", "-f", "api:3001/status"]
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -99,7 +101,7 @@ services:
- ../../resolvers_settings.yaml:/resolvers_settings.yaml
command: sh -c "./notifications"
healthcheck:
test: [ "CMD", "curl", "-f", "notifications:3004/status" ]
test: ["CMD", "curl", "-f", "notifications:3004/status"]
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -116,7 +118,7 @@ services:
- ../../resolvers_settings.yaml:/resolvers_settings.yaml
command: sh -c "./pending_publisher"
healthcheck:
test: [ "CMD", "curl", "-f", "pending_publisher:3005/status" ]
test: ["CMD", "curl", "-f", "pending_publisher:3005/status"]
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -132,4 +134,4 @@ volumes:
postgres-data-full:
vault-plugins-full:
vault-data-full:
vault-file-full:
vault-file-full:
20 changes: 13 additions & 7 deletions internal/api/api.gen.go

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

2 changes: 1 addition & 1 deletion internal/api/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *Server) CreateCredential(ctx context.Context, request CreateCredentialR
return CreateCredential400JSONResponse{N400JSONResponse{Message: "error getting reverse hash service settings"}}, nil
}

if !s.networkResolver.IsCredentialStatusTypeSupported(rhsSettings, *credentialStatusType) {
if !s.networkResolver.IsCredentialStatusTypeSupported(rhsSettings.Mode, *credentialStatusType) {
log.Warn(ctx, "unsupported credential status type", "req", request)
return CreateCredential400JSONResponse{N400JSONResponse{Message: fmt.Sprintf("Credential Status Type '%s' is not supported by the issuer", *credentialStatusType)}}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/api/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *Server) CreateIdentity(ctx context.Context, request CreateIdentityReque
return CreateIdentity400JSONResponse{N400JSONResponse{Message: fmt.Sprintf("error getting reverse hash service settings: %s", err.Error())}}, nil
}

if !s.networkResolver.IsCredentialStatusTypeSupported(rhsSettings, *credentialStatusType) {
if !s.networkResolver.IsCredentialStatusTypeSupported(rhsSettings.Mode, *credentialStatusType) {
log.Warn(ctx, "unsupported credential status type", "req", request)
return CreateIdentity400JSONResponse{N400JSONResponse{Message: fmt.Sprintf("Credential Status Type '%s' is not supported by the issuer", *credentialStatusType)}}, nil
}
Expand Down
28 changes: 25 additions & 3 deletions internal/api/networks.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
package api

import "context"
import (
"context"
)

// GetSupportedNetworks is the controller to get supported networks
func (s *Server) GetSupportedNetworks(ctx context.Context, request GetSupportedNetworksRequestObject) (GetSupportedNetworksResponseObject, error) {
func (s *Server) GetSupportedNetworks(ctx context.Context, _ GetSupportedNetworksRequestObject) (GetSupportedNetworksResponseObject, error) {
supportedNetworks := s.networkResolver.GetSupportedNetworks()

var supportedNetworksResponse []SupportedNetworks
for _, sn := range supportedNetworks {
supportedNetworksResponse = append(supportedNetworksResponse, SupportedNetworks{
Blockchain: sn.Blockchain,
Networks: sn.Networks,
Networks: s.supportedNetworksData(ctx, sn.Blockchain, sn.Networks),
})
}
return GetSupportedNetworks200JSONResponse(supportedNetworksResponse), nil
}

func (s *Server) supportedNetworksData(ctx context.Context, blockchain string, networks []string) []NetworkData {
var nd []NetworkData
for _, network := range networks {
rhsSettings, err := s.networkResolver.GetRhsSettings(ctx, blockchain+":"+network)
if err != nil {
continue
}
types := s.networkResolver.SupportedCredentialStatusTypes(rhsSettings.Mode)
credentialStatusTypes := make([]string, 0, len(types))
for _, t := range types {
credentialStatusTypes = append(credentialStatusTypes, string(t))
}
nd = append(nd, NetworkData{
Name: network,
CredentialStatus: credentialStatusTypes,
})
}
return nd
}
7 changes: 6 additions & 1 deletion internal/api/networks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ func TestServer_GetSupportedNetworks(t *testing.T) {
assert.NoError(t, json.Unmarshal(rr.Body.Bytes(), &response))
assert.Equal(t, 1, len(response))
assert.Equal(t, "polygon", response[0].Blockchain)
assert.Equal(t, "amoy", response[0].Networks[0])
assert.Equal(t, []NetworkData{
{
Name: "amoy",
CredentialStatus: []string{"Iden3commRevocationStatusV1.0"},
},
}, response[0].Networks)
}
})
}
Expand Down
Loading

0 comments on commit e8b5667

Please sign in to comment.