Skip to content

Commit

Permalink
Merge pull request #79 from 0xPolygonID/testing
Browse files Browse the repository at this point in the history
sync: testing to main
  • Loading branch information
javip97 authored Apr 19, 2024
2 parents 88d2136 + b26634c commit d8bb423
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 155 deletions.
5 changes: 0 additions & 5 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
VERIFIER_BACKEND_HOST=http://localhost:3010
VERIFIER_BACKEND_PORT=3010
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
33 changes: 28 additions & 5 deletions .github/workflows/deploy_new_account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@ on:
- completed

env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"

POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_AMOY_SENDER_DID: "did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq"
POLYGON_AMOY_NETWORK_FLAG: "0b0001_0011"
POLYGON_AMOY_CHAIN_ID: "80002"

POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
POLYGON_MAIN_SENDER_DID: "did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv"
POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001"
POLYGON_MAIN_CHAIN_ID: "137"

CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601"
CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc"
CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov"
CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011"
CAMINO_COLUMBUS_CHAIN_ID: "501"

jobs:
build-backend:
Expand Down Expand Up @@ -48,12 +61,22 @@ jobs:
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
echo -e " chainID: ${{ env.POLYGON_AMOY_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_AMOY_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_AMOY_SENDER_DID }}" >> resolvers_settings.yaml
echo -e " main:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAINET_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml
echo -e "camino:" >> resolvers_settings.yaml
echo -e " columbus:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ env.CAMINO_COLUMBUS_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.CAMINO_COLUMBUS_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.CAMINO_COLUMBUS_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.CAMINO_COLUMBUS_SENDER_DID }}" >> resolvers_settings.yaml
cat resolvers_settings.yaml
- run: make build/docker

Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ on:

env:
AWS_ACCOUNT_ID: ${{ secrets.DEV_AWS_ACCOUNT_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ENVIRONMENT: dev
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"

POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_AMOY_SENDER_DID: "did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq"
POLYGON_AMOY_NETWORK_FLAG: "0b0001_0011"
POLYGON_AMOY_CHAIN_ID: "80002"

POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
POLYGON_MAIN_SENDER_DID: "did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv"
POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001"
POLYGON_MAIN_CHAIN_ID: "137"

CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601"
CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc"
CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov"
CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011"
CAMINO_COLUMBUS_CHAIN_ID: "501"

jobs:
build-backend:
Expand Down Expand Up @@ -48,12 +61,22 @@ jobs:
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
echo -e " chainID: ${{ env.POLYGON_AMOY_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_AMOY_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_AMOY_SENDER_DID }}" >> resolvers_settings.yaml
echo -e " main:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAINET_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml
echo -e "camino:" >> resolvers_settings.yaml
echo -e " columbus:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ env.CAMINO_COLUMBUS_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.CAMINO_COLUMBUS_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.CAMINO_COLUMBUS_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.CAMINO_COLUMBUS_SENDER_DID }}" >> resolvers_settings.yaml
cat resolvers_settings.yaml
- run: make build/docker

Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/prod_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ on:

env:
AWS_ACCOUNT_ID: ${{ secrets.PROD_AWS_ACCOUNT_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ENVIRONMENT: production
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"

POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_AMOY_SENDER_DID: "did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq"
POLYGON_AMOY_NETWORK_FLAG: "0b0001_0011"
POLYGON_AMOY_CHAIN_ID: "80002"

POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
POLYGON_MAIN_SENDER_DID: "did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv"
POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001"
POLYGON_MAIN_CHAIN_ID: "137"

CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601"
CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc"
CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov"
CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011"
CAMINO_COLUMBUS_CHAIN_ID: "501"

jobs:
build-backend:
Expand Down Expand Up @@ -48,12 +61,22 @@ jobs:
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
echo -e " chainID: ${{ env.POLYGON_AMOY_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_AMOY_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_AMOY_SENDER_DID }}" >> resolvers_settings.yaml
echo -e " main:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAINET_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml
echo -e "camino:" >> resolvers_settings.yaml
echo -e " columbus:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ env.CAMINO_COLUMBUS_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.CAMINO_COLUMBUS_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.CAMINO_COLUMBUS_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.CAMINO_COLUMBUS_SENDER_DID }}" >> resolvers_settings.yaml
cat resolvers_settings.yaml
- run: make build/docker

Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/testing_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@ on:

env:
AWS_ACCOUNT_ID: ${{ secrets.TESTING_AWS_ACCOUNT_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ENVIRONMENT: testing
ECR_REPOSITORY: verifier_backend
POLYGON_MUMBAI_CONTRACT_ADDRESS: "0x134B1BE34911E39A8397ec6289782989729807a4"

POLYGON_AMOY_CONTRACT_ADDRESS: "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
POLYGON_AMOY_SENDER_DID: "did:polygonid:polygon:amoy:2qV9QXdhXXmN5sKjN1YueMjxgRbnJcEGK2kGpvk3cq"
POLYGON_AMOY_NETWORK_FLAG: "0b0001_0011"
POLYGON_AMOY_CHAIN_ID: "80002"

POLYGON_MAIN_CONTRACT_ADDRESS: "0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
POLYGON_MAIN_SENDER_DID: "did:polygonid:polygon:main:2q4Q7F7tM1xpwUTgWivb6TgKX3vWirsE3mqymuYjVv"
POLYGON_MAIN_NETWORK_FLAG: "0b0001_0001"
POLYGON_MAIN_CHAIN_ID: "137"

CAMINO_COLUMBUS_CONTRACT_ADDRESS: "0x34eCe5eCe59B978C95147bBa6db8fb62F127e601"
CAMINO_COLUMBUS_NODE_URL: "https://columbus.camino.network/ext/bc/C/rpc"
CAMINO_COLUMBUS_SENDER_DID: "did:polygonid:camino:columbus:3E1DZ5qrNCJctmUS3nphEkfsvqYs1kL5oGTtEpYiov"
CAMINO_COLUMBUS_NETWORK_FLAG: "0b10000011"
CAMINO_COLUMBUS_CHAIN_ID: "501"

jobs:
build-backend:
Expand Down Expand Up @@ -48,12 +61,22 @@ jobs:
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
echo -e " chainID: ${{ env.POLYGON_AMOY_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_AMOY_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_AMOY_SENDER_DID }}" >> resolvers_settings.yaml
echo -e " main:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.POLYGON_MAIN_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ secrets.POLYGON_MAINET_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.POLYGON_MAIN_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.POLYGON_MAIN_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.POLYGON_MAIN_SENDER_DID }}" >> resolvers_settings.yaml
echo -e "camino:" >> resolvers_settings.yaml
echo -e " columbus:" >> resolvers_settings.yaml
echo -e " contractAddress: ${{ env.CAMINO_COLUMBUS_CONTRACT_ADDRESS }}" >> resolvers_settings.yaml
echo -e " networkURL: ${{ env.CAMINO_COLUMBUS_NODE_URL }}" >> resolvers_settings.yaml
echo -e " chainID: ${{ env.CAMINO_COLUMBUS_CHAIN_ID }}" >> resolvers_settings.yaml
echo -e " networkFlag: ${{ env.CAMINO_COLUMBUS_NETWORK_FLAG }}" >> resolvers_settings.yaml
echo -e " did: ${{ env.CAMINO_COLUMBUS_SENDER_DID }}" >> resolvers_settings.yaml
cat resolvers_settings.yaml
- run: make build/docker

Expand Down
38 changes: 32 additions & 6 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ info:
Documentation for the Backend Verifier API
version: "1"

servers:
- description: Local
url: http://localhost:3010
- description: Dev
url: https://verifier-backend-dev.polygonid.me

tags:
- name: Public
description: Public endpoints for integrators
Expand Down Expand Up @@ -486,6 +480,7 @@ components:
type: object
required:
- userDID
- verifiablePresentations
properties:
userDID:
type: string
Expand All @@ -495,6 +490,8 @@ components:
x-omitempty: false
items:
$ref: '#/components/schemas/JWZProofs'
verifiablePresentations:
$ref: '#/components/schemas/VerifiablePresentations'



Expand Down Expand Up @@ -732,6 +729,35 @@ components:
type: string
example: '1234'

VerifiablePresentations:
type: array
items:
$ref: '#/components/schemas/VerifiablePresentation'

VerifiablePresentation:
type: object
required:
- proofType
- schemaContext
- schemaType
- credentialSubject
properties:
proofType:
type: string
example: 'VerifiablePresentation'
schemaContext:
type: array
items:
type: string
example: 'https://www.w3.org/2018/credentials/v1'
schemaType:
type: array
items:
type: string
example: 'KYCAgeCredential'
credentialSubject:
type: object

UUID:
type: string
x-go-type: uuid.UUID
Expand Down
10 changes: 10 additions & 0 deletions api/spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<rapi-doc
id = "the-doc"
spec-url="/static/docs/api/api.yaml"
theme = "light"
regular-font = "Nunito"
Expand All @@ -23,5 +24,14 @@
>
<!-- <img slot="nav-logo" src="{logo}" style="width:50px; height:50px"/>-->
</rapi-doc>
<script>
window.addEventListener('DOMContentLoaded', () => {
const rapidocEl = document.getElementById('the-doc');
rapidocEl["server-url"] = globalThis.origin;
rapidocEl.addEventListener('spec-loaded', () => {
rapidocEl.setApiServer(globalThis.origin);
});
});
</script>
</body>
</html>
Loading

0 comments on commit d8bb423

Please sign in to comment.