Local directory image file analysis integration#5
Conversation
…ges stored in a local directory file path.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 5571975 | Triggered | SendGrid Key | 2e7aba5 | appsettings.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- 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
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit 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.
|
|
||
| namespace AnalyzeImageAPI.Helpers | ||
| { | ||
| public class Helpers |
There was a problem hiding this comment.
Please make Helpers a static class or provide an interface for it, preferrably a static class since we don't really need to inject it in DI. We can as well do away with the DI instantiation in the Startup.cs.
There was a problem hiding this comment.
Good addition from this PR,
Just one major request, given the extension of the current codebase and to make it more better for contribution, can you also include in this PR the following:
- Refactor the codebase so that it is cleaner by removing business rules to a service layer. (Api layer, Core layer, Repository layer and Tests layer). Here's a sample structure you can consider to keep it super simple: https://github.com/Ezeji/StraddleService
- Write unit tests for the service methods. Consider using Nsubstitute library for mocking and Xunit as the test framework.
- Upgrade to .NET 9.0 if possible and preferrably.
Brief Implementation Explanation
This implementation extends your original image analysis API to handle both URL-based and local file system images:
Core Modifications
Flexible Path Detection:
Local File Analysis: