TRITON-2545 - Add CloudAPI Client for Go#24
Merged
travispaul merged 18 commits intomainfrom Apr 29, 2026
Merged
Conversation
nshalman
reviewed
Apr 28, 2026
Rename VMAPI Brand to VmBrand and CreateAccessKeyResponse to AccessKeyCredentials to resolve oapi-codegen schema name collisions. Replace Services and Datacenters type aliases with newtype wrappers so schemars preserves named schemas through to generated clients. Change Timestamp from String to chrono::DateTime<Utc>, propagating typed datetimes through the full pipeline and eliminating manual RFC3339 parsing in the CLI. Add Go CloudAPI client generated with oapi-codegen v2.6.0 (required for correct omitempty on nullable optional fields). Add missing address fields to user create/update requests. Fix CreateImageRequest.version to be required. Add action-dispatch design doc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit adds support for keys in the form SHA256:fingerprint in addition to MD5:fingerprint and fingerprints with no additional information regarding their contents. This is useful since the Triton documentation suggests using `ssh-keygen -l -f ~/.ssh/id_rsa` which by default returns a SHA256 formatted fingerprint in newer versions of OpenSSH.
* Introduce some unit testing around client.New * Remove commented out Endpoint attribute from Client * Document test signer
* Add support to triton-go for RBAC This will allow users to pass a username to the SSH Agent signers so that accounts other than the main triton account can be used * Updating the examples to take into account SDC_USER If there is no SDC_USER set, then we will pass an empty string to the SSH Signers and everything will continue as it used to do so! This is no change of functionality other than passing an extra variable to the func * Updating the README with the addition for SDC_USER support * Updating Create_instance example to cleanup machine after use * Change SSHAgent funcs to accept an Input struct to future-proof additions * Rename SDC_ env vars to TRITON_ env vars
* Rename `KeyFringerPrint` to `KeyID`. Internally we differentiate between IDs and Fingerprints, but in the public API, we should be good with just an ID for now. Shorter is better. * Fix two formatting issues from `goimport(1)`. * Whitespace nit * Comment nit: TRITON_KEY_ID is preferred over SDC_KEY_ID. * Add a comment for GetTritonEnv(). * Rename `UserName` to `Username` in the input structs for signers. Fixes: #84 * Rename SDC variables to be Triton variables. * Move examples into their own directory. Having `gorename(1)` just work is a "good thing(tm)."
* pkg/compute: Replacing errwrap in the compute package * pkg/client: Removal of errwrap from the client package * pkg/errors: Exposing all of the Errors in 1 specific package This consolidates the work of the errors in client/errors.go and compute/errors.go We have a specific type of errors we can check for now * Changing auth pkg to use an errors alias to allow expansion going forward * Final cleanup of errwrap from the packages * Removing the errwrap vendoring from the solution * WIP * pkg/client: Introduce the concept of a APIError for all Joyent API interations We wrap every response from Triton and Manta with a DecodeError *If* the state code is not in the 2xx range This introduces a standward way of respresenting errors from the Joyent API to our consumers This also standardises the User-Agent that we pass to the Joyent APIs * Followup on the review
The RBAC HTTP Signatures between manta and triton are slightly different Therefore, we need to generate the signature based on whether the request is for RBAC AND for Manta or not We therefore, moved the logic to a central generate func rather than being handled different;y between private key and ssh agent signers Paired on this with @cheapRoc
This was missed from the #135 PR
Co-authored-by: Bruce Smith <b.smith@us.imshealth.com>
Replace hand-written Go types with oapi-codegen generated client from the patched OpenAPI spec. Add HTTP Signature authentication (RSA, ECDSA, Ed25519), typed wrappers for action-dispatch endpoints, and integration tests covering all CloudAPI endpoints against a live instance. Introduce newtype wrappers (Tags, RoleTags, NetworkIds, etc.) to replace type aliases that schemars erased, giving downstream code generators named schemas instead of anonymous inline types. Fix HEAD endpoints to return Response<Body> instead of HttpResponseOk<T> so generated clients don't try to parse empty bodies as JSON. Fix wire format mismatches discovered via live testing (Role.members/policies as objects, ProvisioningLimits as array, get_datacenter as 302 redirect). Disable redirect following in the HTTP client because Signature auth headers are path-bound and cannot survive redirects. Add polling for async VMAPI operations (tags, metadata, snapshots). Add illumos build support with prebuilt Go toolchain and CGO_ENABLED=0. Co-Authored-By: Nahum Shalman <nshalman@edgecast.io> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2dbc8e5 to
a0c9430
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.
Testing notes in ticket