github

package
v0.15.1-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Github

TODO

Documentation

Overview

Package github implements a sidecred.SecretStore on top of Github secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActionsStore added in v0.14.0

func NewActionsStore(app App, options ...Option) sidecred.SecretStore

func NewDependabotStore added in v0.14.0

func NewDependabotStore(app App, options ...Option) sidecred.SecretStore

func NewStore added in v0.14.0

func NewStore(app App, options ...Option) sidecred.SecretStore

NewStore creates a new sidecred.SecretStore using Github repository secrets.

Types

type ActionsAPI

type ActionsAPI interface {
	GetRepoPublicKey(ctx context.Context, owner, repo string) (*github.PublicKey, *github.Response, error)
	CreateOrUpdateRepoSecret(
		ctx context.Context,
		owner, repo string,
		eSecret *github.EncryptedSecret,
	) (*github.Response, error)
	GetRepoSecret(ctx context.Context, owner, repo, name string) (*github.Secret, *github.Response, error)
	DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*github.Response, error)
}

ActionsAPI wraps the Github actions API.

type App

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 MultiApp

type MultiApp []App

func (MultiApp) CreateInstallationToken

func (apps MultiApp) CreateInstallationToken(owner string, repositories []string, permissions *githubapp.Permissions) (*githubapp.Token, error)

type Option added in v0.14.0

type Option func(*store)

func WithActionsClientFactory

func WithActionsClientFactory(f func(token string) ActionsAPI) Option

WithActionsClientFactory sets the function used to create new installation clients, and can be used to return test fakes.

func WithSecretTemplate

func WithSecretTemplate(t string) Option

WithSecretTemplate sets the secret name template when instantiating a new store.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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