Repository navigation
Provider files: headers and an ssh port from the reply, as format 3 - #248
Merged
Merged
Conversation
A provider file could send only the key, so an API that needs more on a
request could not be described. instabox refuses every create, start,
stop and delete without an Idempotency-Key (400), and a delete without
X-Confirm-Delete naming the machine (409), so its file failed on the
first create.
Format 3 adds headers: a top-level table sent with every call, and one
under any call, laid over it by name ("" leaves one out). A value may
use {uuid}, new for each request, {id} and {name}; a header whose
placeholder has nothing to fill it is left out rather than sent as its
own letters. The key stays in auth_header alone: a header may not carry
{key} or reuse that name, nor set one conch sets (Host, Content-Type,
Accept, ...), nor hold a line break. A format-2 conch calls headers an
unknown key and refuses the file, rather than sending requests the
provider would refuse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A gateway that hands out a credential per connection can name its port
the same way it names its host. instabox's ssh-tokens reply carries a
port, and its gateway does not listen on 22: with port = 22 the file
made a sandbox and then timed out reaching it.
[ssh] port may now be "{reply.PATH}" (format 3), read from the
[ssh.access] reply as host and user are. A reply with no port, or one
that is not a port, is said as an error rather than left to ssh's
default, which is the port such a gateway does not listen on. A number
reads as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A provider file could send only the API key. Some APIs need more on a request: instabox refuses every create, start, stop and delete without an
Idempotency-Keyheader (400 bad_request), and a delete withoutX-Confirm-Deletenaming the machine (409 delete_confirmation_required). Its provider file passedcheck, then failed on the first create.What
Format 3 adds
headers:{uuid}(new for each request),{id}and{name}(known on create and[ssh.access]). A header whose placeholder has nothing to fill it is left out, not sent as its own letters;""under a call leaves out a top-level one.checkrefuses: headers withoutformat = 3, invalid names,{key}orauth_header's own name (the key stays in one place), headers conch sets (Host,Content-Type,Content-Length,Accept,Transfer-Encoding,Connection), line breaks, unknown placeholders.Describe) shows each call's headers.headersan unknown key and refuses the file, rather than sending requests the provider refuses.providerfile.md(what the adapting agent is told) gains a Format 3 section; AGENTS.md mentions it.Tests
format3_test.go: a fake instabox-shaped API that refuses a change without a freshIdempotency-Keyand a delete withoutX-Confirm-Delete, through create, stop, start, ssh access and delete; each header is checked on every request (a new v4 UUID each time, a call's header replacing the file's whatever its case, an empty one removing it, an unfilled one left out). With the headers not sent, it fails with the same 400 instabox gave.checkshould report, and format 3 asked for from each place a header can go.ProviderFormat.make gatepassed. On the first run oneinternal/servershard failed; the rerun passed whole. That package does not touch provider files, but the flake is there.Also: the ssh port from the access reply
A live create with the headers worked, then timed out on ssh: instabox's gateway is not on port 22, and its ssh-tokens reply says which port it is on.
[ssh] portmay now be"{reply.PATH}"(format 3), read from[ssh.access]'s reply ashostanduserare. A reply without a valid port is an error, not port 22. A number reads as before. Tested through the same fake (2222 from the reply, a port written as a string, and a missing, zero, out-of-range or non-numeric one), andcheckrefuses a reply port with no[ssh.access].make gatepassed whole on this commit.🤖 Generated with Claude Code