Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare web-api and node SDKs #846

Merged
merged 17 commits into from
Aug 7, 2023
Merged

Prepare web-api and node SDKs #846

merged 17 commits into from
Aug 7, 2023

Conversation

edolix
Copy link
Contributor

@edolix edolix commented Jul 31, 2023

Description

This PR includes the required changes to start releasing the web-api and node SDKs.

It also includes the implementation of the validateRequest in the WebAPI namespace.


Before release

  • Remove private from node and web-api package.json files

Type of change

  • New packages
  • Internal refactoring
  • Bug fix (bugfix - non-breaking)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Code snippets

import { WebAPI } from "@signalwire/node"

const validKey = "PSK_foo" // for the API page in the dashboard
const header = request.headers["X-SignalWire-Signature"]
const url = "https://myapp.example.com/webhook" // url configured to handle this request
const rawBody = JSON.stringify(request.body) // JSON request body as string

const valid = WebAPI.validateRequest(validKey, header, url, rawBody);

if (valid) {
  // request is coming from SignalWire
}

@changeset-bot
Copy link

changeset-bot bot commented Jul 31, 2023

🦋 Changeset detected

Latest commit: 93b4959

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@signalwire/web-api Major
@signalwire/node Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@edolix edolix requested a review from iAmmar7 July 31, 2023 15:33
@edolix edolix changed the title WIP: Prepare web-api and node SDKs Prepare web-api and node SDKs Jul 31, 2023
@edolix edolix requested a review from danieleds August 1, 2023 10:32
packages/web-api/package.json Outdated Show resolved Hide resolved
packages/web-api/src/validateRequest.ts Outdated Show resolved Hide resolved
iAmmar7
iAmmar7 previously approved these changes Aug 1, 2023
danieleds
danieleds previously approved these changes Aug 2, 2023
@edolix edolix requested a review from rsowald August 7, 2023 10:58
@edolix edolix requested a review from briankwest August 7, 2023 10:58
@edolix edolix merged commit 48b9341 into main Aug 7, 2023
9 of 11 checks passed
@edolix edolix deleted the eg/prepare-node-sdk branch August 7, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants