inst

package
v0.0.0-...-da9c117 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Overview

Package inst implements GitHub App Installation authentication.

See: https://docs.github.com/en/free-pro-team@latest/developers/apps/authenticating-with-github-apps#authenticating-as-a-github-app

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config defines an GitHub app installation config.

func NewConfig

func NewConfig(appID, instID string, key *rsa.PrivateKey) (*Config, error)

NewConfig returns a new GitHub App instance.

func NewEnterpriseConfig

func NewEnterpriseConfig(url, appID, instID string, key *rsa.PrivateKey) (*Config, error)

NewEnterpriseConfig returns a new GitHub App instance.

func (*Config) Client

func (c *Config) Client(ctx context.Context) *http.Client

Client returns an HTTP client wrapping the context's HTTP transport and adding Authorization headers with tokens obtained using JWT.

The returned client and its Transport should not be modified.

func (*Config) Permissions

func (c *Config) Permissions() (map[string]string, error)

Permissions returns a map of the GitHub app client's permissions.

func (*Config) RepositorySelection

func (c *Config) RepositorySelection() (string, error)

RepositorySelection returns the GitHub app client's repository selection (all or selected).

func (*Config) SetRepositories

func (c *Config) SetRepositories(names []string)

SetRepositories returns an updated installation with the provided repositories. Access will be limited to the list of provided repositories

func (*Config) SetRepositoryIDs

func (c *Config) SetRepositoryIDs(ids []string)

SetRepositoryIDs returns an updated installation with the provided repository ids. Access will be limited to the list of provided repository IDs.

Jump to

Keyboard shortcuts

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