Repository navigation
pkg: device-flow steps, repository files and manual signing sets for embedding programs - #41
Merged
Merged
Conversation
…embedding programs A program with its own UI could not reuse the GitHub login, read or write builder.json without a checkout, or take a user's own certificate and profiles the way `builder signing setup --certificate --profile` does. - auth: RequestDeviceCode and PollForToken are Login's two halves, exported. Login itself still prints the code and stores the token as before. - github: ListRepositories, ListBranches, GetFile and PutFile (contents API), with ErrFileNotFound for a missing file. - signing: SetupOptions.SaveConfig lets the caller persist builder.json; nil keeps writing it in the working directory. SetupManual, ManualType and MatchExtensionProfiles move the manual half of signing setup out of the CLI; the CLI calls them under its old names, so its prompts, output and tests are unchanged.
Interlap01
force-pushed
the
lib/app-signing-setup
branch
from
October 10, 2026 19:45
064ddf5 to
8991a66
Compare
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.
A program with its own UI (the MobAI desktop app's signing step) could not reuse the GitHub login, read or write
builder.jsonwithout a checkout, or take a user's own certificate and profiles the waybuilder signing setup --certificate --profiledoes. This exposes those three pieces throughpkg/.Library
RequestDeviceCodeandPollForToken, the two halves ofLogin, exported. The token comes back unstored so the caller keeps it in its own secret store.ListRepositories(pushed first, every page),ListBranches,GetFileandPutFilethrough the contents API, withErrFileNotFoundso "no builder.json yet" is distinguishable from a failure.SetupOptions.SaveConfiglets the caller persistbuilder.jsonitself (through the API, say); nil keeps writing it in the working directory.SetupManual,ManualTypeandMatchExtensionProfilesare the manual half ofsigning setup, moved out of the CLI.BuildP12is exported for a caller that holds a key and a certificate.CLI
No behavior change.
signing setupkeeps its prompts and output; the manual path now callsSetupManualfor its upload, profile and save steps, in the same order, andmatchExtensionProfiles/manualSigningTypedelegate under their old names so the existing tests cover the move.Loginstill prints the code and stores the token as before.SetupandEnsureSecretssavebuilder.jsonexactly where they did.Tests
internal/github/contents_test.go(pagination and query of the repo listing, base64 decoding and the 404 sentinel ofGetFile, request body and path escaping ofPutFile) andinternal/signing/manual_test.go(upload andSaveConfigcapture, failed upload still writes the profile, failed save, the nil-SaveConfigdefault, type and extension matching). Full suite passes with-race; gofmt and vet clean.