diff --git a/.env-sample b/.env-sample index c7a026a..fa0d05a 100644 --- a/.env-sample +++ b/.env-sample @@ -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 \ No newline at end of file diff --git a/.github/workflows/deploy_new_account.yml b/.github/workflows/deploy_new_account.yml index 21e9cca..b526d36 100644 --- a/.github/workflows/deploy_new_account.yml +++ b/.github/workflows/deploy_new_account.yml @@ -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: @@ -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 diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml index 6ae2187..e12ee9d 100644 --- a/.github/workflows/dev_deploy.yml +++ b/.github/workflows/dev_deploy.yml @@ -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: @@ -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 diff --git a/.github/workflows/prod_deploy.yml b/.github/workflows/prod_deploy.yml index 4da4c52..15a7ae3 100644 --- a/.github/workflows/prod_deploy.yml +++ b/.github/workflows/prod_deploy.yml @@ -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: @@ -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 diff --git a/.github/workflows/testing_deploy.yml b/.github/workflows/testing_deploy.yml index 4da4b82..e1c6020 100644 --- a/.github/workflows/testing_deploy.yml +++ b/.github/workflows/testing_deploy.yml @@ -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: @@ -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 diff --git a/api/api.yaml b/api/api.yaml index 824f7cf..71ca835 100644 --- a/api/api.yaml +++ b/api/api.yaml @@ -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 @@ -486,6 +480,7 @@ components: type: object required: - userDID + - verifiablePresentations properties: userDID: type: string @@ -495,6 +490,8 @@ components: x-omitempty: false items: $ref: '#/components/schemas/JWZProofs' + verifiablePresentations: + $ref: '#/components/schemas/VerifiablePresentations' @@ -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 diff --git a/api/spec.html b/api/spec.html index 2d7e25d..0cc85e4 100644 --- a/api/spec.html +++ b/api/spec.html @@ -8,6 +8,7 @@