Documentation
¶
Overview ¶
Package ghait provides a simple interface for obtaining GitHub App Installation Tokens.
The file provider is registered by default when importing this package. To disable it, build with -tags ghait.no_file.
Other providers can be enabled in two ways:
1. Explicit underscore imports in consuming code:
import _ "github.com/isometry/ghait/provider/aws" import _ "github.com/isometry/ghait/provider/gcp" import _ "github.com/isometry/ghait/provider/vault"
2. Build tags, allowing enablement without modifying source code:
go build -tags ghait.aws go build -tags ghait.gcp go build -tags ghait.vault go build -tags ghait.aws,ghait.gcp,ghait.vault
Individual providers can be disabled at build time using opt-out tags, even if they are underscore-imported by the source code:
go build -tags ghait.no_aws go build -tags ghait.no_gcp go build -tags ghait.no_vault go build -tags ghait.no_file
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config interface {
GetAppID() int64
GetInstallationID() int64
GetProvider() string
GetKey() string
GetValidateKey() bool
}
Config represents the configuration for the provider.
type FatalError ¶ added in v0.2.0
type FatalError struct{}
FatalError is returned when an error is considered fatal.
func (FatalError) Error ¶ added in v0.2.0
func (e FatalError) Error() string
type GHAIT ¶ added in v0.1.1
type GHAIT interface {
GetAppID() int64
GetInstallationID() int64
NewInstallationToken(ctx context.Context, installationID int64, options *github.InstallationTokenOptions) (*github.InstallationToken, error)
NewToken(ctx context.Context) (*github.InstallationToken, error)
NewTokenWithOptions(ctx context.Context, options *github.InstallationTokenOptions) (*github.InstallationToken, error)
}
GHAIT is the GitHub App Installation Token interface.
type TransientError ¶ added in v0.2.0
type TransientError struct{}
TransientError is returned when an error is considered transient.
func (TransientError) Error ¶ added in v0.2.0
func (e TransientError) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ghait
command
Package main is the entrypoint of the application
|
Package main is the entrypoint of the application |
|
Package provider offers functionality for token providers.
|
Package provider offers functionality for token providers. |
|
aws
Package aws provides an AWS KMS signer implementation.
|
Package aws provides an AWS KMS signer implementation. |
|
azure
Package azure provides an Azure Key Vault signer implementation.
|
Package azure provides an Azure Key Vault signer implementation. |
|
file
Package file provides a file-based implementation of the ghait.Provider interface.
|
Package file provides a file-based implementation of the ghait.Provider interface. |
|
gcp
Package gcp provides a Google Cloud Platform (GCP) KMS signer implementation.
|
Package gcp provides a Google Cloud Platform (GCP) KMS signer implementation. |
|
vault
Package vault provides a ghinstallation.Signer implementation using HashiCorp Vault.
|
Package vault provides a ghinstallation.Signer implementation using HashiCorp Vault. |