Skip to content

Commit

Permalink
fix: push -> notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakowskiii committed Jul 30, 2023
1 parent 57bdb28 commit d3d28f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -57,7 +58,7 @@ impl SubscriptionAuth {
return Err(AuthError::NotYetValid)?;
}

if claims.act != "push_subscription" {
if claims.act != "notify_subscription" {
return Err(AuthError::InvalidAct)?;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3d28f3

Please sign in to comment.