Conversation
Contributor
Reviewer's GuideThis PR adjusts the sidebar ordering for ADR 18 and introduces ADR 19 “Existing Azure Upload,” capturing the decision rationale and detailed implementation plan for direct client uploads to Azure Blob Storage using SAS tokens with malware scanning and versioning. Sequence diagram for direct client upload to Azure Blob Storage with SAS tokens and malware scanningsequenceDiagram
actor User
participant Frontend
participant Backend
participant Blob
User->>Frontend: Select image & click Save/Continue
Frontend->>Frontend: Sanitize & validate (type, size, dimensions)
Frontend->>Backend: Request SAS token (name, type, size)
Backend->>Backend: Build blob path + tags + metadata, validate upload rules
Backend-->>Frontend: AuthResult (blob URL + SAS token + x-ms-date + tags + metadata)
Frontend->>Blob: PUT file bytes (headers + auth + tags + metadata)
Blob-->>Frontend: 201 Created (x-ms-version-id)
Frontend->>Backend: Persist blob reference/version ID
Backend->>Backend: Process blob (versionId and blobURL)
alt Scan: No threats found
Backend->>Frontend: Acknowledge success, retain blob
else Scan: Malicious
Backend->>Blob: Delete current malicious version, promote previous version
Backend->>Frontend: Acknowledge file replacement or deletion
end
Frontend-->>User: Show success / preview / error if malicious
Class diagram for AzureUpload React component and backend SAS token serviceclassDiagram
class AzureUpload {
+beforeUpload(file)
+customizeUpload(file, sasToken)
-FileValidator
-Axios
}
class FileValidator {
+validateType(file)
+validateSize(file)
+validateDimensions(file)
}
class BackendSASTokenService {
+identityVerificationCaseV1CreateAuthHeader(params)
+getHeader(params)
}
class BlobStorageClient {
+generateSASToken(blobPath, permissions, expiry)
+deleteBlobVersion(blobVersionId)
+copyBlob(sourceVersionId, targetVersionId)
}
AzureUpload --> FileValidator
AzureUpload --> BackendSASTokenService : requests SAS token
BackendSASTokenService --> BlobStorageClient : generates SAS token, manages blob versions
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `apps/docs/docs/decisions/0019-existing-azure-upload.md:45` </location>
<code_context>
+
+**Frontend Components:**
+- `AzureUpload` The AzureUpload React component is designed to enable direct client-side uploads to Azure Blob Storage with built-in file validation,authentication, and post-upload malware scanning.
+- It have two handler `beforeUpload` and `customizeUpload`
+ - `beforeUpload` Handler:
+ - Sanitizes and normalizes the file name.
</code_context>
<issue_to_address>
**issue (typo):** Incorrect verb agreement and pluralization: 'It have two handler' should be 'It has two handlers'.
The correct phrasing is: 'It has two handlers: `beforeUpload` and `customizeUpload`'.
```suggestion
- It has two handlers: `beforeUpload` and `customizeUpload`
```
</issue_to_address>
### Comment 2
<location> `apps/docs/docs/decisions/0019-existing-azure-upload.md:60` </location>
<code_context>
+
+**Backend Services:**
+- SAS Token Generation:
+ - The backend handles SAS token generation and validation for Azure Blob Storage uploads, ensuring secure and controlled access for file uploads. There are different- different mutation (pdf & image files). The backend service encapsulates all business logic enforcing file upload restrictions and security requirements before enabling clients to upload files directly to Azure Blob Storage with short-lived and carefully permissioned SAS tokens. For exmple
+ - `identityVerificationCaseV1CreateAuthHeader` method:
+ - Accepts upload parameters such as case ID, file name, content type, content length, and file specifications (max size, permitted content types).
</code_context>
<issue_to_address>
**issue (typo):** Awkward phrasing and typo: 'different- different mutation' and 'For exmple'.
Please update to: 'There are different mutations for PDF and image files.' Also, correct 'For exmple' to 'For example'.
```suggestion
- The backend handles SAS token generation and validation for Azure Blob Storage uploads, ensuring secure and controlled access for file uploads. There are different mutations for PDF and image files. The backend service encapsulates all business logic enforcing file upload restrictions and security requirements before enabling clients to upload files directly to Azure Blob Storage with short-lived and carefully permissioned SAS tokens. For example
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
jasonmorais
reviewed
Oct 21, 2025
…frontend and backend processes, including file validation, SAS token handling, and malware scanning integration.
…se mermaid format
… benefits and drawbacks of direct client uploads
jasonmorais
approved these changes
Oct 22, 2025
arif-u-ahmed
pushed a commit
that referenced
this pull request
Nov 4, 2025
ADR - Existing Azure Upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add a new architectural decision record (ADR 0019) for direct client Azure Blob uploads using SAS tokens and update the sidebar ordering for the existing ADR 0018.
Documentation: