Documentation ¶
Overview ¶
Package config contains a canonical configuration for signer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllSignerTypes []SignerType
AllSignerTypes is a list of all contract types. Since we use stringer and this is a testing library, instead of manually copying all these out we pull the names out of stringer. In order to make sure stringer is updated, we panic on any method called where the index is higher than the stringer array length.
var ErrUnsupportedSignerType = errors.New("unsupported signer type")
ErrUnsupportedSignerType indicates the signer type being used is unsupported.
Functions ¶
func SignerFromConfig ¶
SignerFromConfig creates a new signer from a signer config. TODO: this needs to be moved to some kind of common package. in the old code configs were split into responsible packages. Maybe something like that works here?
Types ¶
type AWSConfig ¶
type AWSConfig struct { // Region is the region the signer is in. Region string `yaml:"region"` // AccessKey is the access key for the signer. AccessKey string `yaml:"access_key"` // AccessSecret is the access secret for the signer. AccessSecret string `yaml:"access_secret"` // KeyID is the key id for the signer. KeyID string `yaml:"key_id"` }
AWSConfig is the config for an AWS signer. this should match the schema of the file passed in.
func DecodeAWSConfig ¶
DecodeAWSConfig decodes the config from a file.
type GCPConfig ¶
type GCPConfig struct { // KeyName is the name of the key to use. KeyName string `yaml:"key_name"` // CredentialFile is the path to the credentials file. // note: this is not recommended for production use. // workload identity federation is recommended. CredentialFile string `yaml:"credential_file"` // Endpoint is the endpoint to use. This is useful for testing. Endpoint string `yaml:"endpoint"` }
GCPConfig is the config for a GCP signer.
func DecodeGCPConfig ¶
DecodeGCPConfig decodes the config from a file.
type SignerConfig ¶
type SignerConfig struct { // Type is the driver used for the signer Type string // File is the file used for the key. File string }
SignerConfig contains a signer config. Currently this config only supports local based signers due to a lack of isomorphic types when we parse yaml.
type SignerType ¶
type SignerType int
SignerType is the signer type
const ( // FileType is a file-based signer. FileType SignerType = iota + 1 // File // AWSType is an aws kms based signer. AWSType // AWS // GCPType is a gcp cloud based signer. GCPType // GCP )
func (SignerType) String ¶
func (i SignerType) String() string