fix(licenses): locate license members by extension, not by filename - #644
Merged
github-actions[bot] merged 1 commit intoSep 15, 2026
Merged
Conversation
traviswu-bigstack
force-pushed
the
fix/license-verify-locate-members-by-extension
branch
from
September 1, 2026 10:55
c600b64 to
0458966
Compare
traviswu-bigstack
marked this pull request as ready for review
September 1, 2026 11:02
raven-pan
approved these changes
Sep 10, 2026
Eandalf-Bigstack
approved these changes
Sep 15, 2026
Verify opened <uploaded filename>.dat inside the extracted archive, but the .dat/.sig carry their own stem and need not match the file's name. Any rename -- by an operator, a mail client, or a browser saving a duplicate as "x (1).license" -- made a valid, correctly signed license fail with the UI's generic "Invalid files." before the dialog appeared. Locate the pair by extension instead, matching license_import_extract in sdk_license.sh (cubecos 3ae09672). hex was fixed there, but verify runs first, so the UI failed regardless. Extract into a per-request temp dir and remove it afterwards. /tmp/license_verify is shared between uploads and was never cleaned -- a lab cluster held members from three different licenses at once -- so an extension lookup in that shared dir could verify a stale license. checkImportLicense now takes the member stem, which is what hex_config license_check appends .dat/.sig to. Fixes #643 Signed-off-by: Travis Wu <travis.wu@bigstack.co>
Eandalf-Bigstack
force-pushed
the
fix/license-verify-locate-members-by-extension
branch
from
September 15, 2026 07:04
0458966 to
6a47b60
Compare
github-actions
Bot
deleted the
fix/license-verify-locate-members-by-extension
branch
September 15, 2026 07:05
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.
What type of PR is this?
/kind bug
Which issue(s) this PR fixes?
Fixes #643
What this PR does?
Verify opened
<uploaded filename>.datinside the extracted archive. The.dat/.sigmembers carry their own stem and need not match the file's name, so any rename — by an operator, a mail client, or a browser saving a duplicate asx (1).license— made a valid, correctly signed license fail with the UI's generic "Invalid files." before the dialog ever appeared. Hit by NYCU on 2026-08-27.license_import_extractinsdk_license.sh(cubecos3ae09672).hexwas fixed there, but the API's verify runs first, so the UI failed regardless of the SDK./tmp/license_verifyis shared between uploads and was never cleaned — a lab cluster was holding members from three different licenses at once — so an extension lookup in that shared directory could have verified a stale license. That hazard is pinned by a test.checkImportLicensenow takes the member stem, which is whathex_config license_checkappends.dat/.sigto.ErrLicenseMalformedArchiveso an archive with no pair reads as malformed rather than as a missing file.No API surface change, so
api/docs.jsonis untouched.Test results (optional)
1). make sure the api docs have been updated
No API surface change;
api/docs.jsonunchanged.2). make sure the api works properly
internal/cubecos/license_verify_test.go— 4 tests. Verified they catch the bug: with the fix reverted,TestParseLicenseDatIgnoresUploadedFilenameandTestParseLicenseDatCleansUpMembersfail; all 4 pass with it.go vet ./...clean;./internal/apis/...and./internal/cubecos/green.Reproduced end-to-end before the fix on a release-build cluster (cube42, 3.1.10) with the real customer license — same bytes, only the filename differing:
nycu-adfp3-0 (1).licenseopen …/nycu-adfp3-0 (1).dat: no such file or directorynycu-adfp3-0.licenseNot yet re-verified on a live cluster with this fix deployed — worth a hot-swap check before merge.