authcheck

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureAuthenticated

func EnsureAuthenticated(profile, cmdName string) error

EnsureAuthenticated verifies the user has a valid token for the profile. It is a thin shim over EnsureAuthenticatedWithStdout that routes the login subprocess stdout to os.Stdout — the same behaviour as before this variant was introduced, preserving backward compatibility for all existing callers. cmdName is the Databricks CLI binary name or path; pass "" to use the default.

func EnsureAuthenticatedWithStdout added in v0.19.0

func EnsureAuthenticatedWithStdout(profile, cmdName string, w io.Writer) error

EnsureAuthenticatedWithStdout verifies the user has a valid token for the profile. If not authenticated, it runs "<cmdName> auth login --profile <profile>" interactively; the login subprocess's stdout is written to w (e.g. os.Stderr or a bytes.Buffer) rather than the caller's stdout. This lets callers that own their stdout for another protocol (e.g. the credential helper emitting a bare token) capture or suppress the login subprocess's output without leaking it. cmdName is the Databricks CLI binary name or path; pass "" to use the default.

func IsAuthenticated

func IsAuthenticated(profile, cmdName string) bool

IsAuthenticated returns true if a valid token can be fetched for the given Databricks profile without triggering an interactive login. cmdName is the Databricks CLI binary name or path; pass "" to use the default ("databricks").

Types

This section is empty.

Jump to

Keyboard shortcuts

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