Documentation
¶
Index ¶
- type AuthKind
- type RootOptions
- func (o *RootOptions) ActiveProfile() string
- func (o *RootOptions) Client(kt config.KeyType) (*api.ClientWithResponses, error)
- func (o *RootOptions) ClientFor(team *string, kind AuthKind) (*api.ClientWithResponses, error)
- func (o *RootOptions) KeyEditor(kt config.KeyType) (api.RequestEditorFn, error)
- func (o *RootOptions) OutputWriter() *output.Writer
- func (o *RootOptions) OutputWriterList() *output.Writer
- func (o *RootOptions) RequireKey(kt config.KeyType) (string, error)
- func (o *RootOptions) RequireTeam(flag *string) error
- func (o *RootOptions) ResolveAPIUrl() string
- func (o *RootOptions) ResolveConfigPath() string
- func (o *RootOptions) ResolveMCPUrl() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthKind ¶
type AuthKind int
AuthKind names the credential a command authenticates with. It is the single command-level declaration of "this command authenticates this way", replacing the config.KeyType literals that were spread across every call site and the RequireTeam guards duplicated in each management command.
const ( // AuthConfig uses a Configuration API key (X-Honeycomb-Team) for the v1 // Configuration API: boards, columns, SLOs, triggers, queries, etc. AuthConfig AuthKind = iota // AuthIngest uses an Ingest API key (X-Honeycomb-Team) for sending events. AuthIngest // AuthManagement uses a Management v2 key (id:secret bearer) for the // Management API: environments and keys. Management commands operate on a // team, so this kind requires a team slug. AuthManagement // AuthMCPOAuth names the OAuth path the mcp commands use to reach the // OAuth-protected Honeycomb MCP server through the mcp package's OAuth // transport, not ClientFor. It has no keyring API key and cannot build a REST // client, so ClientFor rejects it and AuthKinds excludes it from the // login/status machinery. It exists to make the auth taxonomy complete; no // command passes it to ClientFor. AuthMCPOAuth )
type RootOptions ¶
type RootOptions struct {
IOStreams *iostreams.IOStreams
Config *config.Config
NoInteractive bool
Format string
APIUrl string
MCPUrl string
Profile string
ConfigPath string
}
func (*RootOptions) ActiveProfile ¶
func (o *RootOptions) ActiveProfile() string
func (*RootOptions) Client ¶
func (o *RootOptions) Client(kt config.KeyType) (*api.ClientWithResponses, error)
Client builds an API client with auth for the given key type baked in via a request editor, so call sites issue requests without threading an editor argument through every WithResponse call.
func (*RootOptions) ClientFor ¶
func (o *RootOptions) ClientFor(team *string, kind AuthKind) (*api.ClientWithResponses, error)
ClientFor builds an API client for the declared auth kind. For team-scoped kinds (AuthManagement) it first resolves the team slug into *team, folding the per-command RequireTeam guard into one place, then bakes the matching credential's request editor into the client.
Pass the command's --team flag pointer for team-scoped kinds; pass nil for kinds that do not operate on a team.
func (*RootOptions) KeyEditor ¶
func (o *RootOptions) KeyEditor(kt config.KeyType) (api.RequestEditorFn, error)
func (*RootOptions) OutputWriter ¶
func (o *RootOptions) OutputWriter() *output.Writer
func (*RootOptions) OutputWriterList ¶
func (o *RootOptions) OutputWriterList() *output.Writer
func (*RootOptions) RequireKey ¶
func (o *RootOptions) RequireKey(kt config.KeyType) (string, error)
func (*RootOptions) RequireTeam ¶
func (o *RootOptions) RequireTeam(flag *string) error
RequireTeam resolves the team slug a management command operates on, writing the result back into *flag. Precedence:
- An explicit --team flag is used as-is.
- Otherwise the active profile's stored team is inferred, but only when exactly one team is known. A management key can span multiple teams, so inference is deliberately limited to the single-team case the profile records; with zero (or, in the future, more than one) known teams the required-flag error stands.
func (*RootOptions) ResolveAPIUrl ¶
func (o *RootOptions) ResolveAPIUrl() string
func (*RootOptions) ResolveConfigPath ¶
func (o *RootOptions) ResolveConfigPath() string
func (*RootOptions) ResolveMCPUrl ¶
func (o *RootOptions) ResolveMCPUrl() string