Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 94 additions & 89 deletions README.md

Large diffs are not rendered by default.

32 changes: 24 additions & 8 deletions docs/collections/_diagrams/c4code-file-scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ architecture-beta
service itemDequeued(aws:res-amazon-eventbridge-event)[ItemDequeued Event]
service scannerQueue(logos:aws-sqs)[Scanner Queue] in fileScanner
service scannerLambda(logos:aws-lambda)[File Scanner] in fileScanner
service moveQueue(logos:aws-sqs)[MoveFiles Queue] in fileScanner
service moveLambda(logos:aws-lambda)[Move Scanned Files] in fileScanner
service docRefBucket(logos:aws-s3)[DocumentReference] in fileScanner
service unscannedBucket(logos:aws-s3)[UnscannedFiles] in fileScanner
Expand All @@ -22,20 +23,35 @@ architecture-beta
junction j1 in fileScanner
junction j2 in fileScanner
junction j3 in fileScanner
junction j4 in fileScanner
junction j5 in fileScanner
junction j6 in fileScanner
junction j7 in fileScanner
junction j8 in fileScanner
junction j9 in fileScanner

itemDequeued:R --> L:scannerQueue
docRefBucket:B --> T:scannerLambda
scannerQueue:R --> L:scannerLambda
scannerLambda:B --> T:unscannedBucket
unscannedBucket:R --> L:guardDuty
j1:T -- B:unscannedBucket
guardDuty:R --> L:scanComplete
scanComplete:R --> L:moveLambda
moveLambda:R -- L:j1
j1:T -- B:j2
j1:B -- T:j3
j2:R --> L:quarantineBucket
j3:R --> L:safeBucket
quarantineBucket:R --> L:quarantinedFile
safeBucket:R --> L:safeFile
scanComplete:R --> L:moveQueue
moveQueue:R --> L:moveLambda
j2:T --> B:moveLambda
j1:R -- R:j2

moveLambda:R -- L:j3
j3:T -- B:j4
j4:R -- L:j5
j5:R --> L:quarantineBucket
j5:T -- L:j6
j6:R --> L:quarantinedFile

j3:B -- T:j7
j7:R -- L:j8
j8:R --> L:safeBucket
j8:B -- L:j9
j9:R --> L:safeFile
```
2 changes: 1 addition & 1 deletion docs/collections/_diagrams/c4code-printer-analyser.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ architecture-beta
service fileSafe(aws:res-amazon-eventbridge-event)[FileSafe Event]
service analyseQueue(logos:aws-sqs)[Analyse Queue] in printAnalyser
service analyseLambda(logos:aws-lambda)[PrintAnalyser] in printAnalyser
service safeBucket(logos:aws-s3)[SafeLetters] in printAnalyser
service safeBucket(logos:aws-s3)[SafeFiles] in printAnalyser
service pdfAnalysed(aws:res-amazon-eventbridge-event)[PDFAnalysed Event]
group printAnalyser(cloud)[PrintAnalyser]

Expand Down
32 changes: 16 additions & 16 deletions docs/collections/_diagrams/sequence-print-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,49 @@ title: sequence-expire-print-ttl

```mermaid
sequenceDiagram
participant scannerlambda as Lambda<br/>PrintScanner
participant scannerLambda as Lambda<br/>PrintScanner
participant analyserLambda as Lambda<br/>PrintAnalyser
participant senderLambda as Lambda<br/>PrintSender
participant moveLambda as Lambda<br/>MoveLetters
participant unscannedS3 as S3<br/>UnscannedLetters
participant moveLambda as Lambda<br/>MoveFiles
participant unscannedS3 as S3<br/>UnscannedFiles
participant gd as GuardDuty
participant safeS3 as S3<br/>SafeLetters
participant quarantinedS3 as S3<br/>QuarantinedLetters
participant safeS3 as S3<br/>SafeFiles
participant quarantinedS3 as S3<br/>QuarantinedFiles
participant eventBus as Event Bus
participant printApi as Print API

eventBus ->> scannerlambda: ItemDequeued event
activate scannerlambda
scannerlambda ->> scannerlambda: Extract & Decode PDF
scannerlambda -) unscannedS3: Store PDF
deactivate scannerlambda
eventBus ->> scannerLambda: ItemDequeued event
activate scannerLambda
scannerLambda ->> scannerLambda: Extract & Decode PDF
scannerLambda -) unscannedS3: Store PDF
deactivate scannerLambda
unscannedS3 -) gd: S3 new object event
activate gd
gd -) gd: Scan for threats
gd -) eventBus: ScanResult event
deactivate gd
eventBus -) moveLambda: ScanResult event
activate moveLambda
alt Move scanned letter
alt Move scanned file
moveLambda ->> safeS3: Store safe PDF
moveLambda ->> eventBus: PrintLetterSafe event
moveLambda ->> eventBus: FileSfe event
else
moveLambda ->> quarantinedS3: Store quarantined PDF
moveLambda ->> eventBus: PrintLetterQuarantined event
moveLambda ->> eventBus: FileQuarantined event
end
moveLambda ->> unscannedS3: Delete unscanned PDF
deactivate moveLambda
eventBus -) analyserLambda: PrintLetterSafe event
eventBus -) analyserLambda: FileSafe event
activate analyserLambda
analyserLambda ->> safeS3: Get scanned PDF
activate safeS3
safeS3 -->> analyserLambda: PDF
deactivate safeS3
analyserLambda ->> analyserLambda: Count pages
analyserLambda ->> analyserLambda: SHA256
analyserLambda ->> eventBus: PrintLetterAnalysed event
analyserLambda ->> eventBus: PDFAnalysed event
deactivate analyserLambda
eventBus -) senderLambda: PrintLetterAnalysed event
eventBus -) senderLambda: PDFAnalysed event
activate senderLambda
senderLambda -) eventBus: letter.PREPARED event
deactivate senderLambda
Expand Down
2 changes: 1 addition & 1 deletion docs/collections/_events/pdf-analysed.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: pdf-analysed
type: uk.nhs.notify.digital.letters.print.pdf.analysed.v1
nice_name: PrintLetterAnalysed
nice_name: PDFAnalysed
service: Print Supplier Services
schema_envelope: https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/events/uk.nhs.notify.digital.letters.print.pdf.analysed.v1.schema.json
schema_data: https://notify.nhs.uk/cloudevents/schemas/digital-letters/2025-10-draft/data/digital-letters-print-pdf-analysed-data.schema.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Octokit
onboarding
outputDir
Podman
[pP][dD][fF]
[pP][dD][mM]
[pP]re
producedby
Expand Down
Loading
Loading