Documentation
¶
Overview ¶
Package apibase decides which API base URLs the fleet GitHub token may be sent to. A --base flag that accepts any https URL turns a typo, or a hostile argument, into a token sent to another host; Check refuses it before any request is built.
Index ¶
Constants ¶
const Default = "api.github.com"
Default is the only host the token goes to unless the caller names more.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check refuses, before any request, a base the token may not be sent to: only https://api.github.com, an https host named in allow (a GitHub Enterprise Server), or a loopback http test base. Credentials in the URL and a custom https port are refused. The refusal names the host.
func IsLoopback ¶
IsLoopback reports a loopback http base with a port, which tests use. The base is parsed, not prefix-matched: "http://127.0.0.1:1@evil.example/" starts with the loopback prefix but its host is evil.example.
Types ¶
This section is empty.