chanced / navajo

A cryptographic toolkit for Rust
Apache License 2.0
1 stars 0 forks source link

navajo-*: Make a common error type for `Envelope` operations #72

Open chanced opened 1 year ago

chanced commented 1 year ago
The current or planned envelopes are: Envelope Crate
GCP gcloud-sdk
AWS aws-sdk-kms
Azure azure_security_keyvault
Hashicorp Vault vaultrs
InMemory N/A
JsonPlaintext N/A
chanced commented 1 year ago

I'm not sure how viable this is though. AWS's KMS Error is:

pub enum Error {
    AlreadyExistsException(AlreadyExistsException),
    CloudHsmClusterInUseException(CloudHsmClusterInUseException),
    CloudHsmClusterInvalidConfigurationException(CloudHsmClusterInvalidConfigurationException),
    CloudHsmClusterNotActiveException(CloudHsmClusterNotActiveException),
    CloudHsmClusterNotFoundException(CloudHsmClusterNotFoundException),
    CloudHsmClusterNotRelatedException(CloudHsmClusterNotRelatedException),
    CustomKeyStoreHasCmKsException(CustomKeyStoreHasCmKsException),
    CustomKeyStoreInvalidStateException(CustomKeyStoreInvalidStateException),
    CustomKeyStoreNameInUseException(CustomKeyStoreNameInUseException),
    CustomKeyStoreNotFoundException(CustomKeyStoreNotFoundException),
    DependencyTimeoutException(DependencyTimeoutException),
    DisabledException(DisabledException),
    ExpiredImportTokenException(ExpiredImportTokenException),
    IncorrectKeyException(IncorrectKeyException),
    IncorrectKeyMaterialException(IncorrectKeyMaterialException),
    IncorrectTrustAnchorException(IncorrectTrustAnchorException),
    InvalidAliasNameException(InvalidAliasNameException),
    InvalidArnException(InvalidArnException),
    InvalidCiphertextException(InvalidCiphertextException),
    InvalidGrantIdException(InvalidGrantIdException),
    InvalidGrantTokenException(InvalidGrantTokenException),
    InvalidImportTokenException(InvalidImportTokenException),
    InvalidKeyUsageException(InvalidKeyUsageException),
    InvalidMarkerException(InvalidMarkerException),
    KmsInternalException(KmsInternalException),
    KmsInvalidMacException(KmsInvalidMacException),
    KmsInvalidSignatureException(KmsInvalidSignatureException),
    KmsInvalidStateException(KmsInvalidStateException),
    KeyUnavailableException(KeyUnavailableException),
    LimitExceededException(LimitExceededException),
    MalformedPolicyDocumentException(MalformedPolicyDocumentException),
    NotFoundException(NotFoundException),
    TagException(TagException),
    UnsupportedOperationException(UnsupportedOperationException),
    XksKeyAlreadyInUseException(XksKeyAlreadyInUseException),
    XksKeyInvalidConfigurationException(XksKeyInvalidConfigurationException),
    XksKeyNotFoundException(XksKeyNotFoundException),
    XksProxyIncorrectAuthenticationCredentialException(XksProxyIncorrectAuthenticationCredentialException),
    XksProxyInvalidConfigurationException(XksProxyInvalidConfigurationException),
    XksProxyInvalidResponseException(XksProxyInvalidResponseException),
    XksProxyUriEndpointInUseException(XksProxyUriEndpointInUseException),
    XksProxyUriInUseException(XksProxyUriInUseException),
    XksProxyUriUnreachableException(XksProxyUriUnreachableException),
    XksProxyVpcEndpointServiceInUseException(XksProxyVpcEndpointServiceInUseException),
    XksProxyVpcEndpointServiceInvalidConfigurationException(XksProxyVpcEndpointServiceInvalidConfigurationException),
    XksProxyVpcEndpointServiceNotFoundException(XksProxyVpcEndpointServiceNotFoundException),
    Unhandled(Unhandled),
}