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

@mux/mux-node update #185

Closed
wants to merge 0 commits into from
Closed

@mux/mux-node update #185

wants to merge 0 commits into from

Conversation

dylanjha
Copy link
Collaborator

npx @getgrit/launcher apply mux_v8

@vercel
Copy link

vercel bot commented Sep 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stream-new ❌ Failed (Inspect) Jan 3, 2024 9:42pm

@@ -11,7 +11,7 @@ const webhookSignatureSecret = process.env.MUX_WEBHOOK_SIGNATURE_SECRET;
const verifyWebhookSignature = (rawBody: string | Buffer, req: NextApiRequest) => {
if (webhookSignatureSecret) {
// this will raise an error if signature is not valid
Mux.Webhooks.verifyHeader(rawBody, req.headers['mux-signature'] as string, webhookSignatureSecret);
Mux.Webhooks.prototype.verifySignature(Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody, req.headers, webhookSignatureSecret)
Copy link
Collaborator Author

@dylanjha dylanjha Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it didn't add

const mux = new Mux()

and it went with Mux.Webhooks.prototype.verifySignature, which I don't think is right

Copy link
Collaborator Author

@dylanjha dylanjha Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also interesting that it added this ternary, which wasn't there before:

Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody, req.headers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @morgante can you take a look at this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the expected output here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const mux = Mux() // maybe earlier in the file
mux.webhooks.verifyHeader(Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody, req.headers, webhookSignatureSecret)

@dylanjha
Copy link
Collaborator Author

Build error

./pages/api/uploads/index.ts:13:11
Type error: Type '{ playback_policy: "public"[]; }' is missing the following properties from type 'NewAssetSettings': input, master_access, mp4_support, normalize_audio, and 3 more.

  11 |       try {
  12 |         const upload = await mux.video.uploads.create({
> 13 |           new_asset_settings: { playback_policy: ['public'] },
     |           ^
  14 |           cors_origin: '*'
  15 |         });
  16 |         res.json({
error Command failed with exit code 1.

@rattrayalex
Copy link

Ah, that build error is likely because we marked properties as required in NewAssetSettings despite them being request params – @jsanford8 , does that sound right? Could you get that fixed in the OpenAPI Spec?

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.

None yet

3 participants