feat(go)!: align envd user selection and prepare v0.2.0 - #23
Merged
Merged
Conversation
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.
Go callers could not select the sandbox user for command launch, PTYs, directory watches, or filesystem RPCs, although TypeScript and Python support it. Add per-operation
Userselection and unify filesystem methods around a final options argument. This PR also prepares the shared SDK version 0.2.0 in a separate release commit.For example,
Commands.Run(ctx, "id", &CommandOptions{User: "root", Args: []string{"-un"}})runs as root, andFiles.Stat(ctx, "~", &FileOptions{User: "root"})resolves root's home directory. Empty users follow template defaults on envd >= 0.4.0 and selectuseron older envd. Existing-process operations keep the original process identity.API changes
User string; filesystem requests use per-request headers without changing shared client state.*FileOptions;Listtakes*ListFilesOptions, batch writes take*WriteFileOptions, and signed URLs take*FileURLOptions.nilto formerly optionless filesystem RPCs, and move listing depth and signed URL expiration into options.ReadTonow takes(ctx, path, writer, options).Validation
make go-check, including race, GoDoc, consumer installation, and 91.9% handwritten statement coverage.TestEnvdUsersKVMpassed on the local KVM runtime forrootanduser: actual process/PTY identity, file ownership, selected-user home paths, watch events, CRUD, and unknown-user errors. Test sandbox cleanup passed.See the Go user-selection guide for the API mapping and migration notes. Version preparation does not tag or publish the packages.