Skip to content

Replace strings with more appropriate types #2

Description

@nitzel
  • Replace string with Uri where possible and sensible
  • Use an enum for the signature method to avoid this magic string, e.g.:
    public enum SignatureMethod
    {
        HMAC_SHA1,
        RSA_SHA1,
        PLAINTEXT
    }

    public static class ExtensionMethods
    {
        public static string MapToString(this SignatureMethod signatureMethod)
        {
            switch (signatureMethod)
            {
                case SignatureMethod.HMAC_SHA1:
                    return "HMAC-SHA1";
                case SignatureMethod.RSA_SHA1:
                    return "RSA-SHA1";
                case SignatureMethod.PLAINTEXT:
                    return "PLAINTEXT";
                default:
                    throw new ArgumentException(nameof(signatureMethod));
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions