Skip to content

Conversation

@alilleybrinker
Copy link
Collaborator

This introduces a new experimental authorization API and begins the process of testing it. It also includes refactors to the integration test suite, and the introduction of a new test:integration-local task to run the integration test suite fully locally.

This is best reviewed commit-by-commit.

This adds a task to more conveniently run local-only integration
tests. The key difference here is that it connects to a local MongoDB
instance instead of trying to connect to a live-test instance in our
cloud environment.

Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
Implements an assortment of refactors to the integration test
helpers, constants, and the tests themselves with a few goals in mind:

- Clarity and consistency of helper APIs
- Separation of request builders from tests
- Simplification of frequently used variable names

Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
This adds a new API for authorization, defined in `src/middleware/authz.js`,
which is centered around two key functions: `authz` and `authzLevel`. Each
returns a middleware function which applies the requested authorization
checks. For `authz`, if the authorization checks fail, then the request
fails. For `authzLevel`, if the authorization checks fail, then the request
continues but without an authorization level being set on the request
context.

In addition to these top-level APIs, this introduces a set of pre-defined
checks, plus two check combinators, which collectively will enable
CVE Services endpoints to define the authorization checks they require,
all in one place.

This is intended to replace the combination of existing authorization
middleware functions and ad-hoc authorization checks performed throughout
a number of endpoints. This commit *does not* include any replacement of
existing authorization checks, only the introduction of the new API.

Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
@alilleybrinker alilleybrinker self-assigned this Jan 23, 2026
@alilleybrinker alilleybrinker added the javascript Pull requests that update javascript code label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants