VerisimilitudeX / DNAnalyzer

Revolutionizing DNA analysis and making it accessible to all through innovative AI-powered analysis and interpretive tools.
Other
130 stars 56 forks source link

Intro spring boot #427

Closed MartinGallauner closed 10 months ago

MartinGallauner commented 11 months ago

Hi!

Regarding this issue. In this pull request, I introduced many changes, and I'm sure there will be a lot of feedback.

My primary goal was to don't break any existing functionality. The secondary goal was to introduce Spring Boot and a first simple controller class offering two endpoints concerned with getting/setting the openai api-key. Maybe we want to stick to the current solution for security reasons, though.

This is what I did:

What's missing? A lot.

  1. The whole analysis functionality needs to be available by REST. To do that, we must first separate the big DNAAnalysis record by domain and presentation logic. If we stick to clean architecture, I would implement something like a SystemOutAdapter and keep the domain logic within a service class.
  2. Documentation. I didn't document any work in progress since users shouldn't use that yet.
gitguardian[bot] commented 11 months ago

⚠️ GitGuardian has uncovered 1 secret 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 secret in your pull request
| GitGuardian id | Secret | Commit | Filename | | | -------------- | ------------------------- | ---------------- | --------------- | -------------------- | | [-](https://dashboard.gitguardian.com/incidents/secrets) | Generic High Entropy Secret | 597cf00c6a3fb3f8c6a995a71b7560995cba04e0 | src/test/java/DNAnalyzer/core/ApiKeyServiceTest.java | [View secret](https://github.com/VerisimilitudeX/DNAnalyzer/commit/597cf00c6a3fb3f8c6a995a71b7560995cba04e0#diff-2bb18595c224d799cbdbda2f86b3d4f6L17) |
🛠 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 secret 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 this secret](https://docs.gitguardian.com/secrets-detection/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!

VerisimilitudeX commented 10 months ago

Everything works perfectly! This gives me a good starting point to work off of. Could you please fix the merge conflicts real quick so that I can merge it? Thanks!

MartinGallauner commented 10 months ago

@VerisimilitudeX I resolved the merge conflict and all findings in the build pipeline by now. There is only one false positive left because I wrote a test using a mock key. Can you tell me how to skip that and merge?

VerisimilitudeX commented 10 months ago

Well, most secret scanning workflow support a "suppress warning" feature, although GitGuardian doesn't unfortunately. For example: @SuppressWarnings("squid:S1234") // this is to ignore SonarQube's rule, replace "S1234" public class MyClass { ... }

I think I can go ahead and merge this and add this test file to the list of GitGuardian's exclusion list later. Thanks for the PR btw!

@MartinGallauner one last thing - could you please add some documentation under docs/* that tells devs how to run the features that you just added in this PR? I would really appreciate that. Thanks!

MartinGallauner commented 10 months ago

@VerisimilitudeX Sure thing! I will add the docs to the next iteration when there is some actual functionality.