github

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 9 Imported by: 0

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 New

func New(app App, owner, repository string, options ...option) sidecred.SecretStore

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

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 instanciating a new store.

Types

type ActionsAPI

type ActionsAPI interface {
	GetPublicKey(ctx context.Context, owner, repo string) (*github.PublicKey, *github.Response, error)
	CreateOrUpdateSecret(ctx context.Context, owner, repo string, eSecret *github.EncryptedSecret) (*github.Response, error)
	GetSecret(ctx context.Context, owner, repo, name string) (*github.Secret, *github.Response, error)
	DeleteSecret(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.

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