cred

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

Package cred provides gRPC / API credentials to authenticate to network services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCredentialHelper

func DefaultCredentialHelper() string

DefaultCredentialHelper returns default credential helper's path.

Types

type Cred

type Cred struct {
	// Type is credential type. e.g. "luci-auth", "gcloud", etc.
	Type string

	// Email is authenticated email.
	Email string
	// contains filtered or unexported fields
}

Cred holds credentials and derived values.

func New

func New(ctx context.Context, opts Options) (Cred, error)

New creates a Cred using LUCI auth's default options. It ensures that the user is logged in and returns an error otherwise.

func (Cred) ClientOptions

func (c Cred) ClientOptions() []option.ClientOption

ClientOptions returns googleapi's client options to use the credential.

func (Cred) GRPCDialOptions

func (c Cred) GRPCDialOptions() []grpc.DialOption

GRPCDialOptions returns grpc's dial options to use the credential.

type Options

type Options struct {
	LUCIAuth         auth.Options
	FallbackLUCIAuth auth.Options
	TokenSource      oauth2.TokenSource
}

func AuthOpts

func AuthOpts(credHelper string) Options

AuthOpts returns the LUCI auth options that Siso uses.

Jump to

Keyboard shortcuts

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