token

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package token contains functions for getting an authenticated token from a user's machine for a given VCS provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(_ context.Context, vcsp vcs.Provider, allowUnauthenticated bool) (*shared.Token, error)

Fetch returns a valid token from one of the configured credential providers. If no token is found, ErrNoToken is returned.

If allowUnauthenticated is true, then an empty token is returned if no token is found.

Types

type ErrNoToken

type ErrNoToken []error

ErrNoToken is returned when no token is found in the configured credential providers.

func (ErrNoToken) Error

func (errs ErrNoToken) Error() string

Error returns the error message for ErrNoToken.

func (ErrNoToken) Unwrap

func (errs ErrNoToken) Unwrap() []error

Unwrap returns the errors that caused the ErrNoToken error.

type Token

type Token = shared.Token

Token is a VCS token that can be used for API access. Defined here to allow for easy access to the type.

Directories

Path Synopsis
internal
github
Package github implements [shared.Provider] for Github.
Package github implements [shared.Provider] for Github.
gitlab
Package gitlab contains Gitlab specific [token.Provider]s.
Package gitlab contains Gitlab specific [token.Provider]s.
shared
Package shared contains shared provider implementations.
Package shared contains shared provider implementations.

Jump to

Keyboard shortcuts

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