Skip to content

Commit

Permalink
Merge pull request #69 from 0xPolygonID/testing
Browse files Browse the repository at this point in the history
Sync: testing with main
  • Loading branch information
javip97 authored Apr 12, 2024
2 parents 5b433bb + 079d0e1 commit 88d2136
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 155 deletions.
1 change: 1 addition & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ VERIFIER_BACKEND_KEY_DIR=./keys
VERIFIER_IPFS_URL=https://gateway.pinata.cloud
VERIFIER_BACKEND_MUMBAI_SENDER_DID=did:polygonid:polygon:mumbai:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT
VERIFIER_BACKEND_MAIN_SENDER_DID=did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv
VERIFIER_BACKEND_AMOY_SENDER_DID=did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq
VERIFIER_BACKEND_RESOLVER_SETTINGS_PATH=./resolvers_settings.yaml
VERIFIER_BACKEND_CACHE_EXPIRATION=60m
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
name: Deploy verifier backend to Development AWS Environment new account
name: Deploy verifier backend to AWS Environment new account

on:
workflow_run:
workflows: ["Checks"]
branches: ["develop"]
branches: ["develop", "main"]
types:
- completed

env:
AWS_ACCOUNT_ID: ${{ secrets.DEV_AWS_ACCOUNT_ID_NEW }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
ENVIRONMENT: dev
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"
POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"

jobs:
build-backend:
environment:
name: ${{ github.ref_name }}

name: Build and push latest image to AWS
permissions:
id-token: write
contents: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: dev

steps:
- name: Checkout code
Expand All @@ -44,6 +45,9 @@ jobs:
- name: Build file with supported networks
run: |
echo -e "polygon:" > resolvers_settings.yaml
echo -e " amoy:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_AMOY_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers_settings.yaml
echo -e " mumbai:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MUMBAI_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_NODE_URL }}" >> resolvers_settings.yaml
Expand All @@ -55,6 +59,8 @@ jobs:

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_NEW }}
with:
aws-region: ${{ env.AWS_DEFAULT_REGION }}
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
ENVIRONMENT: dev
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"
POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"

jobs:
Expand Down Expand Up @@ -44,6 +45,9 @@ jobs:
- name: Build file with supported networks
run: |
echo -e "polygon:" > resolvers_settings.yaml
echo -e " amoy:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_AMOY_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers_settings.yaml
echo -e " mumbai:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MUMBAI_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_NODE_URL }}" >> resolvers_settings.yaml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/prod_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
ENVIRONMENT: production
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"
POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"

jobs:
Expand Down Expand Up @@ -44,6 +45,9 @@ jobs:
- name: Build file with supported networks
run: |
echo -e "polygon:" > resolvers_settings.yaml
echo -e " amoy:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_AMOY_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers_settings.yaml
echo -e " mumbai:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MUMBAI_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_NODE_URL }}" >> resolvers_settings.yaml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/testing_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
ENVIRONMENT: testing
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"
POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"

jobs:
Expand Down Expand Up @@ -44,6 +45,9 @@ jobs:
- name: Build file with supported networks
run: |
echo -e "polygon:" > resolvers_settings.yaml
echo -e " amoy:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_AMOY_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_AMOY_NODE_URL }}" >> resolvers_settings.yaml
echo -e " mumbai:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MUMBAI_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_NODE_URL }}" >> resolvers_settings.yaml
Expand Down
59 changes: 30 additions & 29 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ paths:
OffChain-SIG-V2:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand All @@ -117,7 +117,7 @@ paths:
OffChain-MTP-V2:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand All @@ -139,7 +139,7 @@ paths:
OffChain-SIG-V3:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand All @@ -161,7 +161,7 @@ paths:
OffChain-SIG-V3-Nullifiers:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand All @@ -186,7 +186,7 @@ paths:
OffChain-SIG-V3-Multiple-Queries:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand Down Expand Up @@ -222,7 +222,7 @@ paths:
OffChain-SIG-V3-Linked-Proofs:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand Down Expand Up @@ -261,7 +261,7 @@ paths:
OnChain-SIG-V2:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand All @@ -273,51 +273,51 @@ paths:
"type": "KYCAgeCredential",
"credentialSubject": {
"birthday": {
"$eq": 19960424
"$lt": 20020101
}
}
}
}
],
"transactionData": {
"contractAddress": "0xE826f870852D7eeeB79B2C030298f9B5DAA8C8a3",
"contractAddress": "0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880",
"methodID": "b68967e2",
"chainID": 80001,
"network": "polygon-mumbai"
"chainID": 80002,
"network": "polygon-amoy"
}
}
OnChain-SIG-V3:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
"circuitID": "credentialAtomicQueryV3OnChain-beta.1",
"id": 1,
"id": 200,
"query": {
"context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld",
"allowedIssuers": [ "*" ],
"type": "KYCAgeCredential",
"credentialSubject": {
"birthday": {
"$eq": 19960424
"$lt": 20020101
}
}
}
}
],
"transactionData": {
"contractAddress": "0xE826f870852D7eeeB79B2C030298f9B5DAA8C8a3",
"contractAddress": "0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4",
"methodID": "b68967e2",
"chainID": 80001,
"network": "polygon-mumbai"
"chainID": 80002,
"network": "polygon-amoy"
}
}
OffChain-SIG-V3-Own-Credential:
value:
{
"chainID": "80001",
"chainID": "80002",
"skipClaimRevocationCheck": false,
"scope": [
{
Expand Down Expand Up @@ -454,7 +454,7 @@ components:
}
]
},
"from":"did:polygonid:polygon:mumbai:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT"
"from":"did:polygonid:polygon:amoy:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT"
} '


Expand Down Expand Up @@ -489,7 +489,7 @@ components:
properties:
userDID:
type: string
example: 'did:polygonid:polygon:mumbai:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT'
example: 'did:polygonid:polygon:amoy:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT'
nullifiers:
type: array
x-omitempty: false
Expand Down Expand Up @@ -542,10 +542,10 @@ components:
$ref: '#/components/schemas/Body'
from:
type: string
example: 'did:polygonid:polygon:mumbai:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT'
example: 'did:polygonid:polygon:amoy:2qH7TstpRRJHXNN4o49Fu9H2Qismku8hQeUxDVrjqT'
to:
type: string
example: 'did:polygonid:polygon:mumbai:2qEATqfECVbCBzq9EhJpPSiv1xtJRpbMBKDaNM68Ci'
example: 'did:polygonid:polygon:amoy:2qEATqfECVbCBzq9EhJpPSiv1xtJRpbMBKDaNM68Ci'

Body:
type: object
Expand Down Expand Up @@ -623,9 +623,10 @@ components:
type: string
description: |
Only required when using off-chain verification
`80002`: `amoy`
`80001`: `mumbai`
`137` : `mainnet`
example: '80001'
example: '80002'
reason:
type: string
example: 'test flow'
Expand Down Expand Up @@ -679,16 +680,16 @@ components:
properties:
contract_address:
type: string
example: '0xE826f870852D7eeeB79B2C030298f9B5DAA8C8a3'
example: '0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 '
method_id:
type: string
example: 'b68967e2'
chain_id:
type: integer
example: 80001
example: 80002
network:
type: string
example: 'polygon-mumbai'
example: 'polygon-amoy'

TransactionData:
type: object
Expand All @@ -702,16 +703,16 @@ components:
properties:
contractAddress:
type: string
example: '0xE826f870852D7eeeB79B2C030298f9B5DAA8C8a3'
example: '0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 '
methodID:
type: string
example: 'b68967e2'
chainID:
type: integer
example: 80001
example: 80002
network:
type: string
example: 'polygon-mumbai'
example: 'polygon-amoy'

JWZProofs:
type: object
Expand Down
Loading

0 comments on commit 88d2136

Please sign in to comment.