Documentation
¶
Index ¶
Constants ¶
View Source
const ( FieldRepoURL = "repoURL" FieldRepoURLIsRegex = "repoURLIsRegex" FieldUsername = "username" FieldPassword = "password" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// Username identifies a principal, which combined with the value of the
// Password field, can be used for access to some repository.
Username string
// Password, when combined with the principal identified by the Username
// field, can be used for access to some repository.
Password string
// SSHPrivateKey is a private key that can be used for access to some remote
// repository. This is primarily applicable for Git repositories.
SSHPrivateKey string
}
Credentials generically represents any type of repository credential.
type Database ¶
type Database interface {
Get(
ctx context.Context,
namespace string,
credType Type,
repo string,
) (*Credentials, error)
}
Database is an interface for a Credentials store.
type FakeDB ¶
type FakeDB struct {
GetFn func(
ctx context.Context,
namespace string,
credType Type,
repo string,
) (*Credentials, error)
}
FakeDB is a mock implementation of the Database interface that is used to facilitate unit testing.
type Provider ¶
type Provider interface {
// Supports returns true if the provider can provide credentials for the given
// type, repository URL, data and metadata. Otherwise, it should return false.
Supports(
credType Type,
repoURL string,
data map[string][]byte,
metadata map[string]string,
) bool
// GetCredentials returns the credentials for the given type, repository URL
// data, and metadata. If the provider cannot provide credentials for the
// given type, repository URL and data, it should return nil.
GetCredentials(
ctx context.Context,
project string,
credType Type,
repoURL string,
data map[string][]byte,
metadata map[string]string,
) (*Credentials, error)
}
Provider is an interface for providing credentials for a given type, repository URL and data values.
Click to show internal directories.
Click to hide internal directories.