Closed Harman-singh-waraich closed 3 months ago
The recent updates enhance the authentication and middleware integration across various parts of the application. Key changes include the introduction of authMiddleware
for IPFS uploads, wrapping components with EnsureAuth
for authentication, and adding an authentication token to the IPFS upload utility function. These changes aim to streamline authentication processes and improve security.
File Path | Change Summary |
---|---|
web/netlify/functions/uploadToIPFS.ts |
Replaced Handler with middy , added authMiddleware , removed FILEBASE_API_WRAPPER , refactored handler to uploadToIPFS , simplified parameters, and updated function composition using middy . |
web/src/pages/Cases/CaseDetails/Evidence/SubmitEvidenceModal.tsx |
Added EnsureAuth import and wrapped Button component with EnsureAuth . |
web/src/pages/Resolver/index.tsx |
Added EnsureAuth import, introduced StyledEnsureAuth , and wrapped JSX elements with StyledEnsureAuth . |
web/src/utils/uploadFormDataToIPFS.ts |
Introduced authToken to extract the token from session storage and set it as a header in fetch request. |
sequenceDiagram
participant User
participant SubmitEvidenceModal
participant EnsureAuth
participant IPFS
participant AuthMiddleware
User->>SubmitEvidenceModal: Click Submit Button
SubmitEvidenceModal->>EnsureAuth: Wrap Button with EnsureAuth
EnsureAuth->>User: Check Authentication
User-->>EnsureAuth: Provide Credentials
EnsureAuth-->>SubmitEvidenceModal: Authentication Successful
SubmitEvidenceModal->>IPFS: Upload Data
IPFS->>AuthMiddleware: Validate Token
AuthMiddleware-->>IPFS: Token Valid
IPFS-->>SubmitEvidenceModal: Data Uploaded Successfully
SubmitEvidenceModal-->>User: Display Success Message
In the world of code, where logic reigns, A rabbit toils, no effort wanes. Authentication now stands tall, Ensuring safety for one and all. With tokens and middleware, we weave, A secure web, in which we believe. So hop along, with code so spry, Our system's fortified, reaching for the sky! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Name | Link |
---|---|
Latest commit | |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-university/deploys/665600108a0d104e406e5a48 |
Deploy Preview | https://deploy-preview-1593--kleros-v2-university.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-neo/deploys/665600216384e150ba9277ae |
Deploy Preview | https://deploy-preview-1593--kleros-v2-neo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | b2161090871c4e33b80f98a941c88ae814da4047 |
Latest deploy log | https://app.netlify.com/sites/kleros-v2/deploys/6655ff6e4646390008dd7512 |
Deploy Preview | https://deploy-preview-1593--kleros-v2.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Code Climate has analyzed commit b2161090 and detected 1 issue on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 1 |
View more on Code Climate.
@coderabbitai review
PR-Codex overview
The focus of this PR is to implement authentication middleware and refactor upload functions for IPFS.
Detailed summary
Summary by CodeRabbit
New Features
EnsureAuth
for improved security.Refactor
uploadToIPFS
function for better maintainability and performance.SubmitEvidenceModal
to useEnsureAuth
for button authentication.Improvements