-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(api): add slug parser in the api requests #6705
feat(api): add slug parser in the api requests #6705
Conversation
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@novu/client
@novu/framework
@novu/headless
@novu/js
@novu/nextjs
@novu/nest
@novu/node
@novu/notification-center
novu
@novu/providers
@novu/react
@novu/react-native
@novu/shared
@novu/stateless
commit: |
try { | ||
decodedValue = decodeBase62(encodedValue); | ||
} catch (error) { | ||
return value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not base 62
apps/api/package.json
Outdated
@@ -57,6 +57,7 @@ | |||
"@types/newrelic": "^9.14.0", | |||
"@upstash/ratelimit": "^0.4.4", | |||
"axios": "^1.6.8", | |||
"base-x": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠ issue: Can we write our own base62 encoder from scratch? The pipe logic is effectively using unvalidated data. I'm concerned that any vulnerabilities (intentionally or maliciously) added to the base-x
package could expose us to an attack vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think if will have fixed version 5.0.0? Will it solve the concern for us? Then, we could upgrade the version if needed and only to a stable and secure version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a know security issue with the package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The truth is that a custom implementation with two functions, encodeBase62, decodeBase62 would be much much simpler, no need for pipes, no need to worry about potential issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠ issue: Can we write our own base62 encoder from scratch? The pipe logic is effectively using unvalidated data. I'm concerned that any vulnerabilities (intentionally or maliciously) added to the base-x package could expose us to an attack vector
i had a hard time implementing the code from scratch, i added up comping the code from base-x so we won't get any vulnerabilities by mistake.
Is there a know security issue with the package?
not at the moment.
The truth is that a custom implementation with two functions, encodeBase62, decodeBase62 would be much much simpler, no need for pipes, no need to worry about potential issues.
i implemented encodeBase62, decodeBase62 based on base-x, pipes are actually a nice touch of nest js making the boundaries of controller and use case responsibility cleaner
…er-in-the-api-requests # Conflicts: # .source # apps/api/src/app/workflows-v2/usecases/delete-workflow/delete-workflow.command.ts # apps/api/src/app/workflows-v2/usecases/delete-workflow/delete-workflow.usecase.ts # apps/api/src/app/workflows-v2/usecases/get-workflow-by-ids/get-workflow-by-ids.command.ts # apps/api/src/app/workflows-v2/usecases/get-workflow-by-ids/get-workflow-by-ids.usecase.ts # apps/api/src/app/workflows-v2/usecases/get-workflow/get-workflow.command.ts # apps/api/src/app/workflows-v2/usecases/get-workflow/get-workflow.usecase.ts # apps/api/src/app/workflows-v2/usecases/upsert-workflow/upsert-workflow.command.ts # apps/api/src/app/workflows-v2/usecases/upsert-workflow/upsert-workflow.usecase.ts # apps/api/src/app/workflows-v2/workflow.controller.e2e.ts # apps/api/src/app/workflows-v2/workflow.controller.ts
…er-in-the-api-requests # Conflicts: # apps/api/package.json # apps/api/src/app/step-schemas/e2e/get-step-schema.e2e.ts # apps/api/src/app/workflows-v2/mappers/notification-template-mapper.ts # apps/api/src/app/workflows-v2/workflow.controller.e2e.ts # apps/api/src/app/workflows-v2/workflow.controller.ts # packages/shared/src/dto/workflows/workflow-response-dto.ts
…er-in-the-api-requests # Conflicts: # apps/api/src/app/workflows-v2/mappers/notification-template-mapper.ts # apps/api/src/app/workflows-v2/workflow.controller.e2e.ts # packages/shared/src/dto/workflows/workflow-commons-fields.ts # packages/shared/src/dto/workflows/workflow-response-dto.ts
…pi-requests' into nv-4494-add-slug-parser-in-the-api-requests
What changed? Why was the change needed?
The PR is not ready please do not review
Screenshots
Expand for optional sections
Related enterprise PR
EE-PR
Special notes for your reviewer