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

chore(medusa): Validate required id before retrieving #2738

Merged
merged 18 commits into from
Dec 19, 2022

Conversation

carlos-r-l-rodrigues
Copy link
Contributor

what:

Validate if the required ids are defined before retriving entities from the database.
Currently in case they are undefined the methods .find/findOne are called with an empty object resulting in a "random" entry returned.

@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2022

🦋 Changeset detected

Latest commit: 7c494a4

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

This PR includes changesets to release 1 package
Name Type
@medusajs/medusa Patch

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

@carlos-r-l-rodrigues carlos-r-l-rodrigues deleted the chore/validate_required_id_retrieve branch December 7, 2022 16:43
@carlos-r-l-rodrigues carlos-r-l-rodrigues restored the chore/validate_required_id_retrieve branch December 7, 2022 16:43
@carlos-r-l-rodrigues carlos-r-l-rodrigues changed the base branch from master to develop December 7, 2022 16:46
@carlos-r-l-rodrigues carlos-r-l-rodrigues marked this pull request as ready for review December 7, 2022 19:44
@carlos-r-l-rodrigues carlos-r-l-rodrigues requested a review from a team as a code owner December 7, 2022 19:44
Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments

packages/medusa/src/services/batch-job.ts Outdated Show resolved Hide resolved
packages/medusa/src/services/order.ts Show resolved Hide resolved
Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Copy link
Contributor

@patrick-medusajs patrick-medusajs left a comment

Choose a reason for hiding this comment

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

LGTM

@medusajs medusajs deleted a comment from gitguardian bot Dec 9, 2022
@olivermrbl olivermrbl changed the title Chore(medusa): validate required id before retrieving chore(medusa): Validate required id before retrieving Dec 12, 2022
@gitguardian
Copy link

gitguardian bot commented Dec 12, 2022

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
5165075 Company Email Password 5acb9f7 packages/medusa/src/api/routes/store/customers/tests/reset-password.js View secret
5067995 Company Email Password 5acb9f7 packages/medusa/src/services/tests/customer.js View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM!

@olivermrbl olivermrbl merged commit 8dcc805 into develop Dec 19, 2022
@olivermrbl olivermrbl deleted the chore/validate_required_id_retrieve branch December 19, 2022 08:49
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.

4 participants