credshelper

package
v0.0.0-...-47bbbf3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package credshelper implements functionality to authenticate using an external credentials helper.

Index

Constants

View Source
const (
	// CredentialsHelper is using an externally provided binary to get credentials.
	CredentialsHelper = "CredentialsHelper"
	// CredshelperPathFlag is the path to the credentials helper binary.
	CredshelperPathFlag = "credentials_helper"
	// CredshelperArgsFlag is the flag used to pass in the arguments to the credentials helper binary.
	CredshelperArgsFlag = "credentials_helper_args"
	// CredsFileFlag is the flag used to pass in the path of the file where credentials should be cached.
	CredsFileFlag = "creds_file"
)

Variables

This section is empty.

Functions

func TimeFromProto

func TimeFromProto(tPb *tspb.Timestamp) time.Time

TimeFromProto converts a valid Timestamp proto into a time.Time.

func TimeToProto

func TimeToProto(t time.Time) *tspb.Timestamp

TimeToProto converts a valid time.Time into a proto Timestamp.

Types

type Credentials

type Credentials struct {
	// contains filtered or unexported fields
}

Credentials provides auth functionalities using an external credentials helper

func NewExternalCredentials

func NewExternalCredentials(credshelper string, credshelperArgs []string, credsFile string) (*Credentials, error)

NewExternalCredentials creates credentials obtained from a credshelper.

func (*Credentials) RemoveFromDisk

func (c *Credentials) RemoveFromDisk()

RemoveFromDisk deletes the credentials cache on disk.

func (*Credentials) SaveToDisk

func (c *Credentials) SaveToDisk()

SaveToDisk saves credentials to disk.

type Error

type Error struct {

	// ExitCode is the exit code for the error.
	ExitCode int
	// contains filtered or unexported fields
}

Error is an error occured during authenticating or initializing credentials.

type JSONOut

type JSONOut struct {
	Token         string            `json:"token"`
	Headers       map[string]string `json:"headers"`
	Expiry        string            `json:"expiry"`
	RefreshExpiry string            `json:"refresh_expiry"`
}

JSONOut is the struct to record the json output from the credshelper.

Jump to

Keyboard shortcuts

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