Documentation
¶
Index ¶
- Constants
- Variables
- func DecryptGoogleMailboxPrivateKey(encryptedValue string, organizationID string, integrationID string, ...) (string, error)
- func DecryptIntegrationSecret(encryptedValue string, organizationID string, integrationID string, ...) (string, error)
- func DecryptString(encryptedValue string, additionalAuthenticatedData string) (string, error)
- func EncryptString(plaintext string, additionalAuthenticatedData string) (string, error)
- func EncryptStringWithNonce(plaintext string, additionalAuthenticatedData string, nonce []byte) (string, error)
- func IntegrationSecretAAD(organizationID string, provider string, externalAccountID string, ...) string
- func LegacyIntegrationSecretAAD(organizationID string, integrationID string, suffix string) string
- func LoadEnvFile(path string, overwrite bool) (bool, error)
- func LoadLocalEnv(overwrite bool) (bool, error)
- func PGXSafeDatabaseURL(raw string) (string, error)
- func RedactDSN(raw string) string
- func RedactError(err error, secrets ...string) string
- func RedactSecret(value string) string
- func RedactText(input string, secrets ...string) string
- func ResolveEncryptionKey(rawKey string, production bool) ([]byte, error)
- func ResolveEncryptionKeyFromEnv() ([]byte, error)
- func SIEMDestinationTokenAAD(organizationID string, destinationID string) string
- type EncryptedEnvelope
Constants ¶
View Source
const ( CredentialAlgorithm = "aes-256-gcm" CredentialKeyBytes = 32 CredentialNonceBytes = 12 )
View Source
const Redacted = "[REDACTED]"
Variables ¶
View Source
var ( ErrMissingEncryptionKey = errors.New("APERIO_ENCRYPTION_KEY is required") ErrInvalidEncryptionKey = errors.New("APERIO_ENCRYPTION_KEY must resolve to exactly 32 bytes") ErrProductionEncoding = errors.New("APERIO_ENCRYPTION_KEY must use base64:, base64url:, or hex: encoding in production") ErrEmptyCredentialPlaintext = errors.New("Cannot encrypt an empty string") ErrMalformedCredential = errors.New("Encrypted value is malformed") ErrUnsupportedCredential = errors.New("Unsupported encrypted value version or algorithm") ErrCredentialAuthentication = errors.New("Encrypted value authentication failed") ErrInvalidCredentialNonceLen = errors.New("invalid encryption nonce length") )
Functions ¶
func DecryptString ¶
func EncryptString ¶
func EncryptStringWithNonce ¶
func IntegrationSecretAAD ¶
func LoadLocalEnv ¶
func PGXSafeDatabaseURL ¶
func RedactError ¶
func RedactSecret ¶
func RedactText ¶
func ResolveEncryptionKey ¶
func SIEMDestinationTokenAAD ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.