Documentation
¶
Overview ¶
Package github implements a sidecred.Provider for Github access tokens and deploy keys. It also implements a client for Github Apps, which is used to create the supported credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDeployKeyRotationInterval ¶
WithDeployKeyRotationInterval sets the interval at which deploy keys should be rotated.
func WithReposClientFactory ¶
func WithReposClientFactory(f func(token string) RepositoriesAPI) option
WithReposClientFactory sets the function used to create new installation clients, and can be used to return test fakes.
Types ¶
type AccessTokenRequestConfig ¶
type AccessTokenRequestConfig struct {
Owner string `json:"owner"`
Repositories []string `json:"repositories,omitempty"`
Permissions *githubapp.Permissions `json:"permissions,omitempty"`
TokenName string `json:"token_name,omitempty"`
}
AccessTokenRequestConfig ...
func (*AccessTokenRequestConfig) Validate ¶ added in v0.11.0
func (c *AccessTokenRequestConfig) Validate() error
Validate implements sidecred.Validatable.
type App ¶ added in v0.5.0
type App interface {
CreateInstallationToken(owner string, repositories []string, permissions *githubapp.Permissions) (*githubapp.Token, error)
}
App is the interface that needs to be satisfied by the Github App implementation.
type DeployKeyRequestConfig ¶
type DeployKeyRequestConfig struct {
Owner string `json:"owner"`
Repository string `json:"repository"`
Title string `json:"title"`
ReadOnly bool `json:"read_only"`
}
DeployKeyRequestConfig ...
func (*DeployKeyRequestConfig) Validate ¶ added in v0.11.0
func (c *DeployKeyRequestConfig) Validate() error
Validate implements sidecred.Validatable.
type RepositoriesAPI ¶
type RepositoriesAPI interface {
ListKeys(ctx context.Context, owner string, repo string, opt *github.ListOptions) ([]*github.Key, *github.Response, error)
CreateKey(ctx context.Context, owner string, repo string, key *github.Key) (*github.Key, *github.Response, error)
DeleteKey(ctx context.Context, owner string, repo string, id int64) (*github.Response, error)
}
RepositoriesAPI wraps the Github repositories API.