apibase

package
v0.207.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func Check(base string, allow []string) error

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

func IsLoopback(base string) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL