mdwiltfong / secret-santa

https://codecademy-secret-santa-2.fly.dev/
3 stars 6 forks source link

#14 WIP Add emailToken type and getTokens() #39

Open gracekishino opened 10 months ago

gracekishino commented 10 months ago

@mdwiltfong I've had a go at adding in the tokens to server/prisma/index.ts.

I wasn't exactly sure what the file was for so asked ChatGPT and added a comment to the top of the file about what I think it's for, please let me know if it's not right and also if the code is OK!

mdwiltfong commented 10 months ago

Hey @gracekishino ! I'll take a look! So far it looks like our CI/CD has picked up some errors. Do you mind taking a look at them?

gracekishino commented 10 months ago

@mdwiltfong thanks so much! Just noticed that, was using Boolean instead of boolean.

mdwiltfong commented 10 months ago

Noice! Let me give it a review.

mdwiltfong commented 10 months ago

This looks good! Although, I need to see some tests 😬

Do you mind adding some to /server/__tests__?

gracekishino commented 10 months ago

@mdwiltfong will do! Thanks for the guidance for this!

gitguardian[bot] commented 10 months ago

⚠️ 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 | | | -------------- | ------------------------- | ---------------- | --------------- | -------------------- | | [-](https://dashboard.gitguardian.com/incidents/secrets) | Generic High Entropy Secret | 04c863e5704170264b82c09e65aeacca5495ca9d | server/mockData/mockData.ts | [View secret](https://github.com/mdwiltfong/secret-santa/commit/04c863e5704170264b82c09e65aeacca5495ca9d#diff-6cffca52b8dd04fea0ec00d6ce0ee05bb1cf94e667398c42ac93319b8632d592L66) | | [-](https://dashboard.gitguardian.com/incidents/secrets) | Generic High Entropy Secret | 41030c9f33bf9e63ea65b71f230b260cf4f81630 | server/mockData/mockData.ts | [View secret](https://github.com/mdwiltfong/secret-santa/commit/41030c9f33bf9e63ea65b71f230b260cf4f81630#diff-6cffca52b8dd04fea0ec00d6ce0ee05bb1cf94e667398c42ac93319b8632d592R66) |
🛠 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](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 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 - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 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!

gracekishino commented 10 months ago

@mdwiltfong still working on this so no need to check it yet!

gracekishino commented 9 months ago

@mdwiltfong thanks for today! Wondered if you could point me in the direction of how to mock a JWT token? I did a search on the npmjs.com site and got these results but wasn't sure which one (if any) is most appropriate:

https://www.npmjs.com/search?q=mock%20jwt