Documentation ¶
Index ¶
- Constants
- Variables
- func GenericError(err error) int
- func HandleErrorResponse(err error, w http.ResponseWriter)
- func Sha256Checksum(r io.Reader) ([]byte, error)
- type GPGPublicKey
- type Module
- type Platform
- type Provider
- type ProviderError
- type ProviderOption
- type ProviderVersion
- type ProviderVersions
- type Sha256Sums
- type SigningKeys
Constants ¶
const ( ProviderPrefix = "terraform-provider-" ProviderExtension = ".zip" )
Variables ¶
var ( // Transport errors ErrVarMissing = errors.New("variable missing") // Auth errors ErrInvalidToken = errors.New("failed to verify token") // Provider error // Storage errors ErrObjectNotFound = errors.New("failed to locate object") ErrObjectAlreadyExists = errors.New("object already exists") )
Functions ¶
func GenericError ¶
GenericError returns the HTTP status code for module-agnostic boring-registry errors
func HandleErrorResponse ¶
func HandleErrorResponse(err error, w http.ResponseWriter)
HandleErrorResponse handles the HTTP response for errors
Types ¶
type GPGPublicKey ¶
type Module ¶
type Module struct { Namespace string `json:"namespace"` Name string `json:"name"` Provider string `json:"provider"` Version string `json:"version"` DownloadURL string `json:"download_url"` }
Module represents Terraform module metadata.
type Provider ¶
type Provider struct { Hostname string `json:"hostname,omitempty"` Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` Filename string `json:"filename,omitempty"` DownloadURL string `json:"download_url,omitempty"` Shasum string `json:"shasum,omitempty"` SHASumsURL string `json:"shasums_url,omitempty"` SHASumsSignatureURL string `json:"shasums_signature_url,omitempty"` SigningKeys SigningKeys `json:"signing_keys,omitempty"` Platforms []Platform `json:"platforms,omitempty"` }
Provider copied from provider.Provider Provider represents Terraform provider metadata.
func NewProviderFromArchive ¶
func (*Provider) ArchiveFileName ¶
func (*Provider) ShasumFileName ¶
func (*Provider) ShasumSignatureFileName ¶
type ProviderError ¶
func (ProviderError) Error ¶
func (p ProviderError) Error() string
type ProviderOption ¶
type ProviderOption func(option *providerOption)
type ProviderVersion ¶
type ProviderVersion struct { Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Protocols []string `json:"protocols,omitempty"` Platforms []Platform `json:"platforms,omitempty"` }
The ProviderVersion is a copy from provider.ProviderVersion
type ProviderVersions ¶
type ProviderVersions struct {
Versions []ProviderVersion `json:"versions,omitempty"`
}
type Sha256Sums ¶
func NewSha256Sums ¶
func NewSha256Sums(filename string, r io.Reader) (*Sha256Sums, error)
func (*Sha256Sums) Checksum ¶
func (s *Sha256Sums) Checksum(fileName string) (string, error)
Checksum returns the corresponding stringified checksum for the archive file name parameter
func (*Sha256Sums) Name ¶
func (s *Sha256Sums) Name() (string, error)
Name returns the name of the provider of the SHA256SUMS file
type SigningKeys ¶
type SigningKeys struct {
GPGPublicKeys []GPGPublicKey `json:"gpg_public_keys,omitempty"`
}
SigningKeys represents the signing-keys.json that we expect in the storage backend https://github.com/boring-registry/boring-registry#gpg-public-key-format
func (*SigningKeys) IsValidSha256Sums ¶
func (s *SigningKeys) IsValidSha256Sums(sha256Sums, sha256SumsSig []byte) error
IsValidSha256Sums verifies whether the GPG signature of to the SHA256SUMS file was created with a private key corresponding to one of the public keys in SigningKeys