Skip to content

fix: graphql exposure auth gaps - #34

Merged
Theauxm merged 3 commits into
mainfrom
fix/graphql-exposure-auth-gaps
Sep 16, 2026
Merged

Theauxm merged 3 commits into
mainfrom
fix/graphql-exposure-auth-gaps

Conversation

@Theauxm

@Theauxm Theauxm commented Sep 16, 2026

Copy link
Copy Markdown
Member

No description provided.

…concepts

VocabularyGuards.TraxVocabularyIsUsed scans a repo for uses of a third-party
attribute where Trax has a vocabulary of its own, and names the replacement in
the offender line. The banned list is an argument rather than a constant,
because only the repo knows which concepts are its own: a library primitive
Trax has no notion of is not listed, and listing everything would end at
reimplementing the library.

Matching requires the file to mention the library, since short attribute names
collide: ASP.NET Core's [Authorize] governs endpoints, a surface Trax does not
own, and must not trip a guard aimed at HotChocolate's. Comments and string
literals are stripped first, because the messages that tell a consumer to stop
using these attributes have to name them.

The translation layer is allowlisted by path with a reason. Code constructing
the library's type to speak to the library is the allowed direction.

Enforces Trax.Docs/adr/0013.
This repo has no cross-repo Trax pins to flatten, but it gets the same ignore
rule as the others: a Trax major is a deliberate migration rather than a bot
PR, and it keeps Dependabot away from the unlisted 2.0.0 packages still sitting
on nuget.org for trax.core and trax.scheduler. Unlisted versions stay
resolvable, so they would otherwise look like a legitimate upgrade target.
Dependabot edits Directory.Packages.props but does not reliably regenerate the
packages.lock.json files beside it. The pull-request build restores with
--locked-mode, so a lockfile that disagrees with the manifest fails the PR with
NU1004 and the bump stalls until somebody regenerates by hand. Reproduced
deliberately: bumping one pin without touching the lockfiles gives exactly that
error, and restore --use-lock-file --force-evaluate clears it. This matters more
now that the Trax pins are readable, because those bumps will start arriving.

Two jobs, per GITHUB_ACTIONS_SECURITY.md triage item 2. `dotnet restore`
resolves and downloads third-party packages, and that must not share a job with
a write token, so the resolve job holds contents: read and hands the result to
the commit job as a patch. The commit job holds the only elevated token in the
workflow and runs nothing but git.

The patch comes from a job that ran dependency code, so it is treated as
untrusted on arrival: git apply is restricted with --include to lockfile paths,
and the working tree is re-checked afterwards in case that restriction ever
slips. Both were verified to hold, including that --include refuses a patch
touching Directory.Packages.props.

The guard is the pull request author rather than github.actor, which is what
GitHub documents: a human re-running the workflow changes the actor but not the
author. persist-credentials is true in the commit job alone, against the
convention everywhere else here, because that is the job that pushes.
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Trax.Core.Testing/Guards/VocabularyGuards.cs 95.65% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@Theauxm
Theauxm merged commit 54c9a5b into main Sep 16, 2026
4 checks passed
@Theauxm
Theauxm deleted the fix/graphql-exposure-auth-gaps branch September 16, 2026 15:45
@github-actions

Copy link
Copy Markdown

This PR is included in version 1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant