From d3d28f39bba6f736f3b5f4638c81167df3926864 Mon Sep 17 00:00:00 2001 From: Rakowskiii Date: Sun, 30 Jul 2023 10:40:16 +0200 Subject: [PATCH] fix: push -> notify --- .github/workflows/cd.yml | 35 ++++++++++++++++++----------------- src/auth.rs | 7 ++++--- tests/integration.rs | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ce13aa45..76e7bb4e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -52,24 +52,25 @@ jobs: ############################################################################## # Staging - deploy-infra-staging: - needs: - - get-version - uses: ./.github/workflows/deploy-infra.yml - secrets: inherit - with: - version: ${{ needs.get-version.outputs.version }} - environment: "staging" - environment_url: https://staging.notify.walletconnect.com/health - relay_url: "wss://staging.relay.walletconnect.com" - notify_url: "https://staging.notify.walletconnect.com" + # TODO: Restore staging + # deploy-infra-staging: + # needs: + # - get-version + # uses: ./.github/workflows/deploy-infra.yml + # secrets: inherit + # with: + # version: ${{ needs.get-version.outputs.version }} + # environment: "staging" + # environment_url: https://staging.notify.walletconnect.com/health + # relay_url: "wss://staging.relay.walletconnect.com" + # notify_url: "https://staging.notify.walletconnect.com" - validate-staging-rust: - needs: deploy-infra-staging - secrets: inherit - uses: ./.github/workflows/validate.yml - with: - environment: "STAGING" + # validate-staging-rust: + # needs: deploy-infra-staging + # secrets: inherit + # uses: ./.github/workflows/validate.yml + # with: + # environment: "STAGING" # TODO: Restore once swift is ready for notify # validate-staging-swift: diff --git a/src/auth.rs b/src/auth.rs index bba836c9..b1c77817 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -23,10 +23,11 @@ pub struct SubscriptionAuth { pub ksu: String, /// aud - dapp's url pub aud: String, - /// sub - blockchain account that push subscription has been proposed for + /// sub - blockchain account that notify subscription has been proposed for /// (did:pkh) pub sub: String, - /// act - description of action intent. Must be equal to "push_subscription" + /// act - description of action intent. Must be equal to + /// "notify_subscription" pub act: String, /// scp - scope of notification types authorized by the user pub scp: String, @@ -57,7 +58,7 @@ impl SubscriptionAuth { return Err(AuthError::NotYetValid)?; } - if claims.act != "push_subscription" { + if claims.act != "notify_subscription" { return Err(AuthError::InvalidAct)?; } diff --git a/tests/integration.rs b/tests/integration.rs index 017ab947..d7bab433 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -130,7 +130,7 @@ PROJECT_ID to be set", sub: format!("did:pkh:{TEST_ACCOUNT}"), aud: "https://my-test-app.com".to_owned(), scp: "test test1".to_owned(), - act: "push_subscription".to_owned(), + act: "notify_subscription".to_owned(), }; // Encode the subscription auth