Skip to content

ATS-PFM-MTD-007Prepare Image and File Uploads: Capability Test Specification

Markdown

ATS-PFM-MTD-007

Prepare Image and File Uploads: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaPlatformModuleMetadata and Organization-defined RecordsRevision2

Read atservices-platform ad3f6a65react-console baf6dae3

Coverage

  • Rule covered
  • Transition gap: FND-PFM-MTD-069
  • Validation covered
  • Permission covered
  • Edge covered
  • Failure gap: FND-PFM-MTD-069
  • Boundary covered
  • Concurrency gap: FND-PFM-MTD-069
  • Invariant covered
  • Interaction covered

Test Scenarios

8 scenarios proving CAP-PFM-MTD-007; 7 bound to an existing test.

01 Only upload-authorized callers receive stagingpermissionapinegativetest
Proves
BR-CAP-PFM-MTD-007-01
Preconditions
Administrator, User and Read Only contexts are available.
Steps
[ { "do": "Request staging as authorized, unauthorized and unsigned callers.", "provenance": "test", "source": "services-platform:modules/files/tests/e2e/files.e2e.spec.js#is refused 403 by the dispatcher, and nothing is issued" } ]
Expected
Authorized tiers receive an issue; unauthorized and unsigned requests fail without issuance. Read Only lacks the upload grant.
Data
Administrator, User and Read Only contexts are available.
Bound to
services-platform:modules/files/tests/e2e/files.e2e.spec.js#is refused 403 by the dispatcher, and nothing is issued
services-platform:modules/files/tests/e2e/files.e2e.spec.js#is refused 401 without a signed context, and nothing is issued
Source
services-platform:modules/files/tests/e2e/files.e2e.spec.js#is refused 403 by the dispatcher, and nothing is issued
02 The route workspace cannot be substitutedpermissionapinegativetest
Proves
BR-CAP-PFM-MTD-007-02
Preconditions
Signed contexts belong to distinct customers.
Steps
[ { "do": "Name a workspace in the body and request another customer’s workspace.", "provenance": "test", "source": "services-platform:modules/files/tests/e2e/files.e2e.spec.js#refuses a body that names a workspace of its own" } ]
Expected
Both attempts fail and no upload issue is created.
Data
Signed contexts belong to distinct customers.
Bound to
services-platform:modules/files/tests/e2e/files.e2e.spec.js#refuses a body that names a workspace of its own
services-platform:modules/files/tests/e2e/files.e2e.spec.js#is refused the tenant, and nothing is issued
Source
services-platform:modules/files/tests/e2e/files.e2e.spec.js#refuses a body that names a workspace of its own
03 Declared sizes are positive and within kind limitsboundaryunitnegativetest
Proves
BR-CAP-PFM-MTD-007-03
Preconditions
The signer and upload ledger are observable.
Steps
[ { "do": "Request pictures at ten MiB and one byte above, documents at twenty-five MiB and one byte above, and zero or fractional sizes.", "provenance": "test", "source": "services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#refuses a picture over 10 MiB, naming size, and signs and records nothing" } ]
Expected
Boundary sizes succeed; over-limit, zero and fractional sizes fail by size without signing or recording.
Data
The signer and upload ledger are observable.
Bound to
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a picture one byte over 10 MiB, naming size
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a document one byte over 25 MiB, naming size
services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#refuses a document over 25 MiB, naming size, and signs and records nothing
Source
services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#refuses a picture over 10 MiB, naming size, and signs and records nothing
04 Media types match the declared kindvalidationunitnegativetest
Proves
BR-CAP-PFM-MTD-007-04
Preconditions
Upload requests can be issued.
Steps
[ { "do": "Request SVG and document images, an executable file and permitted formats.", "provenance": "test", "source": "services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses SVG for a picture by its type, naming content_type" } ]
Expected
Disallowed declarations fail by media type and permitted formats are accepted.
Data
Upload requests can be issued.
Bound to
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses SVG for a picture by its type, naming content_type
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a PDF in a picture field, naming content_type
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses an executable in a document field, naming content_type
services-platform:modules/files/tests/unit/upload-keys.spec.ts#accepts a picture type in a document field
Source
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses SVG for a picture by its type, naming content_type
05 The server chooses a safe staging locationedgeunitnegativetest
Proves
BR-CAP-PFM-MTD-007-05
Preconditions
Workspace and upload declarations are available.
Steps
[ { "do": "Build image and file keys and submit a path-like filename.", "provenance": "test", "source": "services-platform:modules/files/tests/unit/upload-keys.spec.ts#is tmp, the workspace, the object folder, a public- upload directory for a picture, and the file name" } ]
Expected
Keys contain server-selected workspace, folder and upload identity; unsafe filenames fail.
Data
Workspace and upload declarations are available.
Bound to
services-platform:modules/files/tests/unit/upload-keys.spec.ts#is tmp, the workspace, the object folder, a public- upload directory for a picture, and the file name
services-platform:modules/files/tests/unit/upload-keys.spec.ts#sanitises the file name the way the pipeline does, and adds an extension a bare name lacks
services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a file name that is a path, naming file_name
Source
services-platform:modules/files/tests/unit/upload-keys.spec.ts#is tmp, the workspace, the object folder, a public- upload directory for a picture, and the file name
06 Signatures bind headers and expiryinvariantunittest
Proves
BR-CAP-PFM-MTD-007-06
Preconditions
A real local signer has credentials supplied by a test fixture.
Steps
[ { "do": "Sign an upload and inspect its signature and returned headers.", "provenance": "test", "source": "services-platform:modules/files/tests/unit/upload-presign.spec.ts#signs the type, the length and both metadata headers, so S3 refuses a PUT that changes any" } ]
Expected
Type, length and uploader metadata are signed and expiry is fifteen minutes.
Data
A real local signer has credentials supplied by a test fixture.
Bound to
services-platform:modules/files/tests/unit/upload-presign.spec.ts#names the bucket, the staging key and a 15-minute lifetime
services-platform:modules/files/tests/unit/upload-presign.spec.ts#signs the type, the length and both metadata headers, so S3 refuses a PUT that changes any
services-platform:modules/files/tests/e2e/files.e2e.spec.js#signs the uploader named by the verified token, not by anything in the body
Source
services-platform:modules/files/tests/unit/upload-presign.spec.ts#signs the type, the length and both metadata headers, so S3 refuses a PUT that changes any
07 Issuance is recorded and auditedruleapitest
Proves
BR-CAP-PFM-MTD-007-07
Preconditions
An authorized caller requests staging.
Steps
[ { "do": "Issue an upload and inspect the ledger and audit.", "provenance": "test", "source": "services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#appends one file_upload audit event naming who was given the upload and for what" } ]
Expected
One issue and one audit identify the requester and declared destination.
Data
An authorized caller requests staging.
Bound to
services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#records one row for the caller, the object, the field and the key signed
services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#appends one file_upload audit event naming who was given the upload and for what
Source
services-platform:modules/files/tests/integration/services/uploads/issue-upload.integration.spec.js#appends one file_upload audit event naming who was given the upload and for what
08 A staged file is checked by the owning saveinteractionbrowserproposed
Proves
BR-CAP-PFM-MTD-007-08 BR-CAP-PFM-MTD-012-13
Preconditions
A file property exists and two authorized people can obtain staging.
Steps
[ { "do": "Issue and upload as the first person, save as that person, then attempt a new save using another person’s staging identity.", "provenance": "proposed", "source": [ "services-platform:docs/files.md#The signature", "services-platform:modules/custom-objects/tests/integration/services/persistence/custom-object-records.integration.spec.js#names a create’s missing upload at properties.<key>, without the address sent" ] } ]
Expected
Read the managed attachment after success and inspect the rejected property after the second attempt.
Data
A file property exists and two authorized people can obtain staging.
Source
services-platform:docs/files.md#The signature,services-platform:modules/custom-objects/tests/integration/services/persistence/custom-object-records.integration.spec.js#names a create’s missing upload at properties.<key>, without the address sent

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.