github

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 10 Imported by: 0

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 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