credentialhelper

package module
v0.0.0-...-273bd4e Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package credentialhelper is a Go library for interacting with `Credential Helpers`.

A `Credential Helper` is a tool for securely storing and retrieving credentials (e.g., for interacting with remote servers over `gRPC` or `HTTP(s)`).

This library provides an easy and convenient way for implementing a credential helper as well as using a credential Helper from within an application to retrieve credentials.

See https://github.com/bazelbuild/proposals/blob/main/designs/2022-06-07-bazel-credential-helpers.md#proposal for additional information about credential helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCredentialHelper

func StartCredentialHelper(helper CredentialHelper)

StartCredentialHelper is a util for turning the current process as credential helper.

This function never returns.

Types

type CredentialHelper

type CredentialHelper interface {

	// GetCredentials fetches credentials from the helper.
	GetCredentials(ctx context.Context, request *GetCredentialsRequest, extraParameters ...string) (*GetCredentialsResponse, error)
	// contains filtered or unexported methods
}

CredentialHelper provides an interface to implement a Credential Helper or communicate with one.

func NewClient

func NewClient(credentialHelperPath string) (CredentialHelper, error)

NewClient returns a new CredentialHelper invoking the provided path following the protocol for Bazel Credential Helpers.

type CredentialHelperBase

type CredentialHelperBase struct{}

CredentialHelperBase is the base for all implementations of [CredentialHelper]s.

func (CredentialHelperBase) GetCredentials

func (CredentialHelperBase) GetCredentials(ctx context.Context, request *GetCredentialsRequest, extraParameters ...string) (*GetCredentialsResponse, error)

type GetCredentialsRequest

type GetCredentialsRequest struct {
	URI string `json:"uri"`
}

GetCredentialsRequest represents the request for the `get` command of the Helper Protocol.

type GetCredentialsResponse

type GetCredentialsResponse struct {
	Headers map[string][]string `json:"headers"`
}

GetCredentialsResponse represents the response for the `get` command of the Helper Protocol.

Directories

Path Synopsis
Package grpc provides integration for credential helpers with `gRPC`.
Package grpc provides integration for credential helpers with `gRPC`.

Jump to

Keyboard shortcuts

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