Documentation
¶
Index ¶
- type AwsSecretsManagerStorage
- func (s AwsSecretsManagerStorage) Get(keyID string) (Secret, error)
- func (s *AwsSecretsManagerStorage) SetCacheExpiresSeconds(e uint32)
- func (s *AwsSecretsManagerStorage) SetGetSecretID(f GetSecretID)
- func (s *AwsSecretsManagerStorage) SetGetSecretValue(f GetSecretValue)
- func (s *AwsSecretsManagerStorage) SetRequiredPrivateKeys(l map[string]bool)
- type Digest
- type DigestHashAlgorithm
- type DigestHeader
- type ECDSASignature
- type ED25519
- type ED25519PrivateKey
- type ED25519PublicKey
- type EcdsaSha256
- type EcdsaSha512
- type ErrCrypto
- type ErrDigest
- type ErrHS
- type ErrParser
- type ErrSecret
- type GetSecretID
- type GetSecretValue
- type HTTPSignatures
- func (hs *HTTPSignatures) SetDefaultDigestAlgorithm(a string) error
- func (hs *HTTPSignatures) SetDefaultExpiresSeconds(e uint32)
- func (hs *HTTPSignatures) SetDefaultSignatureHeaders(h []string)
- func (hs *HTTPSignatures) SetDefaultTimeGap(t int64)
- func (hs *HTTPSignatures) SetDefaultVerifyDigest(v bool)
- func (hs *HTTPSignatures) SetDigestAlgorithm(a DigestHashAlgorithm)
- func (hs *HTTPSignatures) SetSignatureHashAlgorithm(a SignatureHashAlgorithm)
- func (hs *HTTPSignatures) Sign(secretKeyID string, r *http.Request) error
- func (hs *HTTPSignatures) Verify(r *http.Request) error
- type Headers
- type HmacSha256
- type HmacSha512
- type Md5
- type Parser
- type RsaSha256
- type RsaSha512
- type RsaSsaPssSha256
- type RsaSsaPssSha512
- type Secret
- type Secrets
- type Sha256
- type Sha512
- type SignatureHashAlgorithm
- type SimpleSecretsStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwsSecretsManagerStorage ¶ added in v0.0.13
type AwsSecretsManagerStorage struct {
// contains filtered or unexported fields
}
AwsSecretsManagerStorage AWS Secrets Manager storage
func NewAwsSecretsManagerStorage ¶ added in v0.0.13
func NewAwsSecretsManagerStorage(env string, sm secretsmanageriface.SecretsManagerAPI) *AwsSecretsManagerStorage
NewAwsSecretsManagerStorage create storage
func (AwsSecretsManagerStorage) Get ¶ added in v0.0.13
func (s AwsSecretsManagerStorage) Get(keyID string) (Secret, error)
Get get secret from cache by KeyID or from AWS Secrets Manager for first time
func (*AwsSecretsManagerStorage) SetCacheExpiresSeconds ¶ added in v0.0.13
func (s *AwsSecretsManagerStorage) SetCacheExpiresSeconds(e uint32)
SetCacheExpiresSeconds set default cache expires seconds.
func (*AwsSecretsManagerStorage) SetGetSecretID ¶ added in v0.0.13
func (s *AwsSecretsManagerStorage) SetGetSecretID(f GetSecretID)
SetGetSecretID set custom function to build secret ID in AWS SecretsManager.
func (*AwsSecretsManagerStorage) SetGetSecretValue ¶ added in v0.0.13
func (s *AwsSecretsManagerStorage) SetGetSecretValue(f GetSecretValue)
SetGetSecretValue set custom function to extract value from secret.
func (*AwsSecretsManagerStorage) SetRequiredPrivateKeys ¶ added in v0.0.13
func (s *AwsSecretsManagerStorage) SetRequiredPrivateKeys(l map[string]bool)
SetRequiredPrivateKeys set keys with required PrivateKey secrets.
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest digest internal struct
func (*Digest) SetDefaultDigestHashAlgorithm ¶
SetDefaultDigestHashAlgorithm set digest default algorithm options (default from available)
func (*Digest) SetDigestHashAlgorithm ¶
func (d *Digest) SetDigestHashAlgorithm(a DigestHashAlgorithm)
SetDigestHashAlgorithm set digest options (add new digest hash algorithm)
type DigestHashAlgorithm ¶
type DigestHashAlgorithm interface {
Algorithm() string
Create(data []byte) ([]byte, error)
Verify(data []byte, digest []byte) error
}
DigestHashAlgorithm interface to create/verify digest HMAC hash
type DigestHeader ¶
type DigestHeader struct {
// contains filtered or unexported fields
}
DigestHeader Digest header parsed into params (alg & digest)
type ED25519 ¶ added in v0.0.11
type ED25519 struct{}
ED25519 ED25519 Algorithm
type ED25519PrivateKey ¶ added in v0.0.11
type ED25519PrivateKey struct {
Version int
ObjectIdentifier struct {
ObjectIdentifier asn1.ObjectIdentifier
}
PrivateKey []byte
}
ED25519PrivateKey ED25519 PrivateKey
type ED25519PublicKey ¶ added in v0.0.11
type ED25519PublicKey struct {
ObjectIdentifier struct {
ObjectIdentifier asn1.ObjectIdentifier
}
PublicKey asn1.BitString
}
ED25519PublicKey ED25519 PublicKey
type EcdsaSha256 ¶
type EcdsaSha256 struct{}
EcdsaSha256 ECDSA with SHA256 Algorithm
func (EcdsaSha256) Algorithm ¶
func (a EcdsaSha256) Algorithm() string
Algorithm Return algorithm name
type EcdsaSha512 ¶ added in v0.0.9
type EcdsaSha512 struct{}
EcdsaSha512 ECDSA with SHA512 Algorithm
func (EcdsaSha512) Algorithm ¶ added in v0.0.9
func (a EcdsaSha512) Algorithm() string
Algorithm Return algorithm name
type GetSecretID ¶ added in v0.0.13
type GetSecretID = func(env string, keyType string, keyID string, requiredPrivateKeys map[string]bool) (string, error)
GetSecretValue function construct SecretId in aws secrets manager based on keyType (PrivateKey/PublicKey) & keyID
type GetSecretValue ¶ added in v0.0.13
GetSecretValue function convert value from secrets manager to Secret
type HTTPSignatures ¶
type HTTPSignatures struct {
// contains filtered or unexported fields
}
HTTPSignatures struct
func NewHTTPSignatures ¶
func NewHTTPSignatures(ss Secrets) *HTTPSignatures
NewHTTPSignatures Constructor
func (*HTTPSignatures) SetDefaultDigestAlgorithm ¶
func (hs *HTTPSignatures) SetDefaultDigestAlgorithm(a string) error
SetDefaultDigestAlgorithm set custom digest hash algorithm
func (*HTTPSignatures) SetDefaultExpiresSeconds ¶
func (hs *HTTPSignatures) SetDefaultExpiresSeconds(e uint32)
SetDefaultExpiresSeconds set default expires seconds (while creating signature). If signature never expires just exclude "expires" param from the headers list
func (*HTTPSignatures) SetDefaultSignatureHeaders ¶
func (hs *HTTPSignatures) SetDefaultSignatureHeaders(h []string)
SetDefaultSignatureHeaders set default list of headers to create signature (Sign method)
func (*HTTPSignatures) SetDefaultTimeGap ¶
func (hs *HTTPSignatures) SetDefaultTimeGap(t int64)
SetDefaultTimeGap set default time gap for (created)/(expires) validation
func (*HTTPSignatures) SetDefaultVerifyDigest ¶
func (hs *HTTPSignatures) SetDefaultVerifyDigest(v bool)
SetDefaultVerifyDigest set default verify digest or skip verification
func (*HTTPSignatures) SetDigestAlgorithm ¶
func (hs *HTTPSignatures) SetDigestAlgorithm(a DigestHashAlgorithm)
SetDigestAlgorithm set custom digest hash algorithm
func (*HTTPSignatures) SetSignatureHashAlgorithm ¶ added in v0.0.3
func (hs *HTTPSignatures) SetSignatureHashAlgorithm(a SignatureHashAlgorithm)
SetSignatureHashAlgorithm set custom signature hash algorithm
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers Signature headers & params
type HmacSha256 ¶
type HmacSha256 struct{}
HmacSha256 HMAC-SHA256 Algorithm
func (HmacSha256) Algorithm ¶
func (a HmacSha256) Algorithm() string
Algorithm Return algorithm name
type HmacSha512 ¶
type HmacSha512 struct{}
HmacSha512 HMAC-SHA512 Algorithm
func (HmacSha512) Algorithm ¶
func (a HmacSha512) Algorithm() string
Algorithm Return algorithm name
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parser internal struct
func (*Parser) ParseDigestHeader ¶
func (p *Parser) ParseDigestHeader(header string) (DigestHeader, *ErrParser)
ParseDigestHeader parse Digest header
func (*Parser) ParseSignatureHeader ¶
ParseSignatureHeader parse Signature header
func (*Parser) VerifySignatureFields ¶
VerifySignatureFields verify required fields
type RsaSha256 ¶
type RsaSha256 struct{}
RsaSha256 RSA-SHA265 Algorithm
type RsaSha512 ¶
type RsaSha512 struct{}
RsaSha512 RSA-SHA512 Algorithm
type RsaSsaPssSha256 ¶
type RsaSsaPssSha256 struct{}
RsaSsaPssSha256 RSA-PSS-SHA256 Algorithm
func (RsaSsaPssSha256) Algorithm ¶
func (a RsaSsaPssSha256) Algorithm() string
Algorithm Return algorithm name
type RsaSsaPssSha512 ¶
type RsaSsaPssSha512 struct{}
RsaSsaPssSha512 RSA-PSS-SHA512 Algorithm
func (RsaSsaPssSha512) Algorithm ¶
func (a RsaSsaPssSha512) Algorithm() string
Algorithm Return algorithm name
type Secrets ¶
Secrets interface to retrieve secrets from storage (local, DB, file etc)
func NewSimpleSecretsStorage ¶ added in v0.0.3
NewSimpleSecretsStorage create new storage
type SignatureHashAlgorithm ¶
type SignatureHashAlgorithm interface {
Algorithm() string
Create(secret Secret, data []byte) ([]byte, error)
Verify(secret Secret, data []byte, signature []byte) error
}
SignatureHashAlgorithm interface to create/verify Signature using secret keys Algorithm return algorithm name Create create new signature Verify verify passed signature
type SimpleSecretsStorage ¶ added in v0.0.3
type SimpleSecretsStorage struct {
// contains filtered or unexported fields
}
SimpleSecretsStorage local static secrets storage
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
digestHashAlgorithm
command
|
|
|
fileSecretsStorage
command
|
|
|
sign
command
|
|
|
signatureHashAlgorith
command
|
|
|
verify
command
|
|
|
plugins
|
|