Repository navigation
chore: fix sonar findings and restrict the publish workflow to pushes of this repo - #194
Merged
Merged
Conversation
…drop dead branches Sorting keys without a comparator is flagged because the default order is implicit. Use an explicit UTF-16 code unit comparator that gives the same order (never localeCompare), so audit hash chains and SigV4 headers are unchanged. Also collapse same-value conditionals, avoid passing a callback straight to map, and await the rejects assertion in the rate limit test.
…ish to main pushes Replace read-all with contents: read, pin ossf/scorecard-action to a commit SHA, move the release-python write permission to the release job, install python tooling binary-only, force https on the mcp-publisher download, and only publish from CI runs of a push to main in this repository.
Contributor
|
Thanks for your first pull request. CI will run shortly. If the change touches package source, please add a changeset with |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Clears the SonarCloud findings that were real and verifies the rest.
Publish workflow guard
publish.ymlruns onworkflow_runof CI with secrets andid-token: write, and checks outworkflow_run.head_sha. Thebranches: [main]filter matches the head branch name, so a fork PR from a branch namedmainthat passes CI could have started Publish on fork code. The job now also requiresworkflow_run.event == 'push'andhead_repository.full_name == github.repository. Legitimate publishes (push to main, manual dispatch) are unchanged. All recent Publish runs came from this repository, so there is no sign this was used. Also worth checking in repo settings: require approval for all outside contributors' workflow runs.Code
compareCodeUnits, which is exactly the default code unit order written out. It is deliberately notlocaleCompare, because the audit hash chain, SigV4 canonical headers and permission fingerprints depend on a stable, locale independent order.compare.test.tsproves equality with the baresort()over mixed case, accents, CJK and astral keys and pinscanonicalJsonoutput to the old implementation.federated-logout.ts: the ternary only selected between twojwtVerifyoverloads. A static key is wrapped as a resolver and there is one call. That file had no tests, sofederated-logout.test.tscovers a static key, a resolver key and a wrong key being rejected.oauth-proxy.tsandpassword-reset.ts:cond ? 400 : 400collapsed to400. Behavior is unchanged. Whether some of those errors should be 403 or 5xx was never implemented and is not decided here.simulate.ts: explicit index argument, same behavior.rate-limit.test.ts: the async assertion is now awaited and passes.Workflows
codeql.yml,scorecard.yml: top levelpermissions: contents: read, jobs keep their least privilege blocks.scorecard-actionpinned to a commit SHA.release-python.yml: write permission moved to the job that needs it,pip install --only-binary :all:.publish-mcp-registry.yml:curl --proto '=https' --tlsv1.2.Not changed
Findings that are test data, UI strings, dev scripts or sampling randomness are not suppressed in code. They are listed for a decision in the SonarCloud UI.
Verified
Targeted core tests (9 files, 170 tests), lint and core typecheck pass. The workflow changes run on the next push to main.