---
id: TST-PFM-SEC-268
title: Cognito verifier unit checks
kind: unit
product_area: platform
module: security
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/security/tests/unit/authorizer/cognito-verifier.spec.ts
implements: []
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: >-
  Use the file’s run-owned input objects and test doubles; restore changed environment values and
  installed dependencies after each case.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#verifies
      against the pool’s JWKS, found from the registry row and never from the token
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#keeps one
      verifier per pool for the container: the JWKS is fetched once for many tokens
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#bounds the
      verifiers it keeps without ever losing a pool: eviction costs no correctness and no refetch
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses an
      ID token (token_use id)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses a
      client that the pool does not register: audience_mismatch
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses a
      token of another pool verified against this row, and the pool’s global issuer form
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses an
      expired token beyond the 30 s tolerance and accepts one within it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses nbf
      more than 30 s in the future and accepts it within 30 s
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses a
      token without exp
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses alg
      none and HS256 before fetching any key
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses
      RS512 even though the library supports it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses a
      forged signature (signed by another key under the pool’s kid)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refetches
      the JWKS for an unknown kid (rotation) and refuses a kid the pool does not publish
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses when
      the JWKS cannot be fetched
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#refuses an
      undecodable token without reaching the library
  - provenance: test
    source: >-
      services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts#the
      fixtures’ reference instant is the one the authorizer specs stop their clock at
evidence:
  - 'services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts'
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: 'services-platform:modules/security/tests/unit/authorizer/cognito-verifier.spec.ts'
  explicit_no_doubles: false
  identified_double_boundaries: []
dependency_evidence: >-
  The file exercises its imported production code with controlled inputs. Source inspection
  identifies the test entry and assertions; it does not establish a live database, provider or
  deployed workflow.
binding_note: >-
  The file has no scenario binding established by this examination. Its executable checks remain
  registered without assigning them broader acceptance coverage.
---
# Cognito verifier unit checks

## Verification Boundary

The file evaluates production helpers with controlled inputs in-process. The assertion references identify the source checks for cognito verifier.

## What This Suite Proves

The file supplies executable engineering checks for the named subject. No complete acceptance scenario is inferred from the file’s existence.

## What It Does Not Prove

This examination does not run the suite. Passing behavior, deployed conformance and the behavior of substituted dependencies require separate execution evidence.

## Real Dependencies and Test Doubles

The file exercises its imported production code with controlled inputs. Source inspection identifies the test entry and assertions; it does not establish a live database, provider or deployed workflow.

## Must Not Be Doubled

Keep the production helper, schema, matcher or declaration under examination real. Substituting the decision itself would remove the behavior the assertions exercise.
