Skip to content

fix(dashboard): add client side validation for apns key #7982

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

Merged
merged 3 commits into from
May 6, 2025
Merged

Conversation

jainpawan21
Copy link
Member

@jainpawan21 jainpawan21 commented Mar 24, 2025

What changed? Why was the change needed?

  • add client side validation for apns key
  • add type text area for apns key credentials

User key is in single line format and novu is throwing this error:

{
  "jse_shortmsg": "Failed to generate token",
  "jse_cause": {},
  "jse_info": {},
  "message": "Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256"
}

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Mar 24, 2025

@jainpawan21 jainpawan21 changed the title fix(apns): validate and format APNs private key before use fix(providers): validate and format APNs private key before use Mar 24, 2025

const formattedKey = cleanKey.match(/.{1,64}/g)?.join('\n') || '';

return `-----BEGIN PRIVATE KEY-----\n${formattedKey}\n-----END PRIVATE KEY-----`;
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed offline, we will add a validation error during the creation of APN integration so that users are informed proactively about invalid integration properties.

@jainpawan21 jainpawan21 marked this pull request as draft April 28, 2025 04:50
Copy link

netlify bot commented May 4, 2025

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit f95f9d8
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/681752b9d8cd8800081ef748
😎 Deploy Preview https://deploy-preview-7982.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented May 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/novuhq/novu@7982
npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7982
npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7982

commit: f95f9d8

@jainpawan21 jainpawan21 marked this pull request as ready for review May 4, 2025 11:43
@jainpawan21 jainpawan21 changed the title fix(providers): validate and format APNs private key before use fix(dashboard): add client side validation for apns key May 4, 2025
@jainpawan21 jainpawan21 requested a review from SokratisVidros May 4, 2025 11:44
@scopsy scopsy merged commit 6de6e34 into next May 6, 2025
35 checks passed
@scopsy scopsy deleted the NV-5627 branch May 6, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants