Skip to content

Updates - #85

Merged
aaronparker merged 15 commits into
mainfrom
updates
Sep 24, 2026
Merged

aaronparker merged 15 commits into
mainfrom
updates

Conversation

@aaronparker

Copy link
Copy Markdown
Collaborator

This pull request introduces a new required validation for the User-Agent header on all public API endpoints, updates documentation and schema to reflect longer cache durations, and bumps several dependencies and the package version. The most significant changes are grouped below.

API Security & Validation Improvements:

  • Added a validateUserAgent function and middleware to require a valid, descriptive User-Agent header (e.g., "company/location") for all major endpoints. Requests without a valid header now receive a 400 response with a helpful message. (src/index.js) [1] [2] [3] [4] [5] [6] [7] [8] [9]

Caching Policy Updates:

  • Increased API response cache duration from 5 minutes to 12 hours in both documentation and OpenAPI schema, and updated all relevant examples to match. (schema/API_SCHEMA.md, schema/openapi.yml) [1] [2] [3] [4] [5]

Schema and Validation Enhancements:

  • Expanded the allowed pattern for appId in the OpenAPI schema to permit periods (.) and underscores (_) in addition to previous characters. (schema/openapi.yml)

Dependency and Version Updates:

  • Bumped the project version to 1.6.0 and upgraded several dependencies, including Cloudflare Worker packages, Miniflare, and Wrangler, to their latest releases. (src/package.json, src/package-lock.json) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Minor API Response Changes:

  • Simplified error responses by removing the error field from some internal server error responses. (src/index.js) [1] [2] [3]

These changes improve API security, clarify caching behavior, and keep dependencies up-to-date.

dependabot Bot and others added 12 commits September 24, 2026 00:29
Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) to 7.1.2 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `serialize-javascript` from 6.0.2 to 7.1.2
- [Release notes](https://github.com/yahoo/serialize-javascript/releases)
- [Commits](yahoo/serialize-javascript@v6.0.2...v7.1.2)

Updates `mocha` from 11.8.0 to 12.0.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](mochajs/mocha@v11.8.0...v12.0.2)

---
updated-dependencies:
- dependency-name: serialize-javascript
  dependency-version: 7.1.2
  dependency-type: indirect
- dependency-name: mocha
  dependency-version: 12.0.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Add User-Agent validation helpers and reject requests without a descriptive custom header across the public API endpoints. This helps block generic clients and browsers while guiding callers toward the expected `company/location`-style format.
Make the test suite configurable via `API_BASE_URL` and add coverage for requests missing a `User-Agent` header on `/apps` and `/app/MicrosoftEdge`. This also updates the health endpoint expectation to allow the stricter validation responses now returned by the API.
This change updates the API schema documentation to reflect the current application cache lifetime. The documented `max-age` value was corrected from 5 minutes to 12 hours so the public contract matches the implementation.
Remove exception messages from public error and health-check responses, while updating the OpenAPI spec to allow dots in the appId pattern and reflect the longer cache max-age examples.
Change the `/` route to return a 404 JSON response with documentation and guidance to valid API paths instead of API metadata. Update the root endpoint test to expect the 404 status and verify the guidance message.
Update the Cloudflare developer toolchain from Wrangler 4.131.0 to 4.137.0, including Miniflare, workerd, and related packages. Also bump the app version from 1.5.5 to 1.6.0 to align the release with the upgraded runtime dependencies.
Load `chai` asynchronously in a `before` hook and assign `assert` there so the test suite can work with environments where `chai` must be imported as an ES module.
Co-authored-by: aaronparker <8227455+aaronparker@users.noreply.github.com>
…tests

Update API tests for current endpoint behavior and ESM-compatible Chai loading
Update the lockfile package metadata to match the Evergreen package version bump from 1.5.5 to 1.6.0.
@aaronparker aaronparker added the enhancement New feature or request label Sep 24, 2026
Refresh the GitHub Actions test workflow to run the main matrix on Node.js 24.x and 26.x, and align the other workflow jobs that were pinned to 20.x so CI consistently targets the newer runtime versions.
…ulti-74780f5fa2

Bump serialize-javascript and mocha in /tests
Co-authored-by: aaronparker <8227455+aaronparker@users.noreply.github.com>
@aaronparker
aaronparker merged commit 771dff9 into main Sep 24, 2026
16 of 18 checks passed
@aaronparker
aaronparker deleted the updates branch September 29, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants