resolver

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCredentialHelperFound = fmt.Errorf("no credential helper found")

Functions

This section is empty.

Types

type Config

type Config struct {
	// UseHttps will force https on each proto dependencies fetch.
	UseHttps bool

	// UseGitCredentialsHelper will use git credentials helper for authentication.
	UseGitCredentialsHelper bool

	// UseNetrc will use netrc file for authentication.
	UseNetrc bool

	// HomeDir is the home directory, used as root to find ssh identity files.
	HomeDir string

	// TargetDir is the dependencies directory where protodep.toml files are located.
	TargetDir string

	// OutputDir is the directory where proto files will be cloned.
	OutputDir string

	// BasicAuthUsername is used if `https` mode  is enable. Optional, only if dependency repository needs authentication.
	BasicAuthUsername string

	// BasicAuthPassword is used if `https` mode is enable. Optional, only if dependency repository needs authentication.
	BasicAuthPassword string

	// IdentityFile is used if `ssh` mode is enable. Optional, it is computed like {home}/.ssh/
	IdentityFile string

	// IdentityPassword is used if `ssh` mode is enable. Optional, only if identity file needs a passphrase.
	IdentityPassword string
}

func (*Config) GetHttpsAuthProvider

func (c *Config) GetHttpsAuthProvider() (auth.AuthProvider, error)

GetHttpsAuthProvider returns auth provider for https

func (*Config) GetSshAuthProvider

func (c *Config) GetSshAuthProvider() (auth.AuthProvider, error)

GetSshAuthProvider returns auth provider for ssh

type CredentialConfigEntry

type CredentialConfigEntry struct {
	Helper      []string
	Username    string
	UseHttpPath bool
}

func (*CredentialConfigEntry) Evaluate

func (c *CredentialConfigEntry) Evaluate(repoURL string) (*GitCredential, error)

type Credentials

type Credentials map[string]*CredentialConfigEntry

func ParseGitCredentials

func ParseGitCredentials() (Credentials, error)

func (Credentials) Get

func (Credentials) Has

func (c Credentials) Has(section string) bool

type GitCredential

type GitCredential struct {
	Protocol string
	Host     string
	Username string
	Password string
	URL      string
}

func (GitCredential) String

func (c GitCredential) String() string

type Resolver

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

func New

func New(conf *Config, httpsProvider, sshProvider auth.AuthProvider) (*Resolver, error)

func (*Resolver) Resolve

func (s *Resolver) Resolve(cleanupCache bool) error

Jump to

Keyboard shortcuts

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