---
id: TST-PFM-MTD-083
title: upload keys
kind: unit
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/files/tests/unit/upload-keys.spec.ts
implements:
  - ATS-PFM-MTD-007-03
  - ATS-PFM-MTD-007-04
  - ATS-PFM-MTD-007-05
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: >-
  Prepared integration database and the suite fixture records; fixture teardown restores or removes its own
  rows.
evidence:
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts'
  - >-
    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#has no public- prefix for a document'
  - >-
    services-platform:modules/files/tests/unit/upload-keys.spec.ts#derives the folder of an object Rhythm 1.0
    had no folder for from its id
  - >-
    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#is a staging upload of the same workspace
    to the pipeline that will save it
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#accepts a picture at exactly 10 MiB'
  - >-
    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#accepts a document at exactly 25 MiB'
  - >-
    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/unit/upload-keys.spec.ts#states the limits as the pipeline does'
  - >-
    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'
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#lower-cases the declared type'
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a size of zero, naming size'
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a fractional size, naming size'
  - >-
    services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a file name that is a path, naming
    file_name
  - >-
    services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a missing file name, naming
    file_name
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses an unknown kind, naming kind'
  - >-
    services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses an object id that is not one,
    naming object
  - >-
    services-platform:modules/files/tests/unit/upload-keys.spec.ts#refuses a field path with a slash, naming
    field
  - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#accepts a custom field value path'
fixture_imports:
  - chai
  - '@rhythmsoftware/macroservice-errors/errors'
  - '@rhythmsoftware/macroservice-assets/asset-configuration'
  - '@rhythmsoftware/macroservice-assets/asset-references'
  - ../../files.settings
  - ../../services/persistence/file-uploads
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-007-03
    provenance: test
    source:
      - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#accepts a picture at exactly 10 MiB'
      - >-
        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/unit/upload-keys.spec.ts#refuses a fractional size, naming size'
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-007-04
    provenance: test
    source:
      - >-
        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
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-007-05
    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
      - 'services-platform:modules/files/tests/unit/upload-keys.spec.ts#has no public- prefix for a document'
      - >-
        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
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Upload keys

## Verification Boundary

This unit suite checks upload issuance within the local test harness. The registered file and pinned revision define its boundary.

## What This Suite Proves

The bindings identify the detailed or feature scenarios whose outcomes have assertions in this suite. Original case references remain attached to the detailed scenarios so a reviewer can inspect the exact assertion. Assertions are evidence of implemented checks; no execution result is claimed.

## What It Does Not Prove

The register does not establish a current passing run or full specification conformance. Behavior outside the suite’s fixtures and assertions remains unverified.

## Real Dependencies and Test Doubles

The imported contract and validation code runs locally. The fixture imports identify the setup seams; this register makes no broader claim that dependencies are undoubled.

## Must Not Be Doubled

The contract or validation function under examination must run directly; expected outputs cannot replace it.
