mirror of
https://github.com/rehan-remade/universal-modder.git
synced 2026-11-05 01:37:40 +00:00
[PR #64] [MERGED] fix(publish): catch OpenAI project keys and GitHub fine-grained tokens #94
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rehan-remade/universal-modder#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/rehan-remade/universal-modder/pull/64
Author: @kevin9327
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @rehan-remade
Base:
main← Head:fix/secret-key-formats📝 Commits (1)
dcd1c6dfix(publish): catch OpenAI project keys and GitHub fine-grained tokens📊 Changes
2 files changed (+22 additions, -2 deletions)
View changed files
📝
tests/test_um.py(+18 -0)📝
um/publish.py(+4 -2)📄 Description
um publish checkandum kb checkshareSECRET_PATTERNS, and two of the patterns only match older key formats:sk-(?:proj-)?[A-Za-z0-9]{32,}wants 32 plain alphanumerics right after the prefix. Project keys (sk-proj-…) have-and_in their body, so a key is missed whenever one of those shows up in its first 32 characters, which happens for most keys. Service-account (sk-svcacct-…) and admin (sk-admin-…) keys never match.ghp_,gho_,ghu_,ghs_,ghr_) are recognized. Fine-grained personal access tokens (github_pat_…), which GitHub now suggests by default, pass the check.So a mod folder or a field note with one of these keys in it gets
PASS.Change:
proj,svcacct,admin) accept[A-Za-z0-9_-]in the body. Legacysk-keys keep the old alphanumeric-only rule, so kebab-case text likesk-learn-…still doesn't match.github_pat_followed by 60+ token characters.Tests: added
test_secret_patterns_catch_current_key_formats(fixtures assembled at runtime like the existing publish test, so the repo's own publish check stays clean) and a negative case. Three of the new cases fail onmainand pass with this change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.