internal static WebClientCertificateAuthentication DeserializeWebClientCertificateAuthentication(JsonElement element)
        {
            SecretBase            pfx                = default;
            SecretBase            password           = default;
            object                url                = default;
            WebAuthenticationType authenticationType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("pfx"))
                {
                    pfx = SecretBase.DeserializeSecretBase(property.Value);
                    continue;
                }
                if (property.NameEquals("password"))
                {
                    password = SecretBase.DeserializeSecretBase(property.Value);
                    continue;
                }
                if (property.NameEquals("url"))
                {
                    url = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("authenticationType"))
                {
                    authenticationType = new WebAuthenticationType(property.Value.GetString());
                    continue;
                }
            }
            return(new WebClientCertificateAuthentication(url, authenticationType, pfx, password));
        }
Esempio n. 2
0
        internal static WebLinkedServiceTypeProperties DeserializeWebLinkedServiceTypeProperties(JsonElement element)
        {
            if (element.TryGetProperty("authenticationType", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "Anonymous": return(WebAnonymousAuthentication.DeserializeWebAnonymousAuthentication(element));

                case "Basic": return(WebBasicAuthentication.DeserializeWebBasicAuthentication(element));

                case "ClientCertificate": return(WebClientCertificateAuthentication.DeserializeWebClientCertificateAuthentication(element));
                }
            }
            object url = default;
            WebAuthenticationType authenticationType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("url"))
                {
                    url = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("authenticationType"))
                {
                    authenticationType = new WebAuthenticationType(property.Value.GetString());
                    continue;
                }
            }
            return(new WebLinkedServiceTypeProperties(url, authenticationType));
        }
Esempio n. 3
0
        internal static WebAnonymousAuthentication DeserializeWebAnonymousAuthentication(JsonElement element)
        {
            object url = default;
            WebAuthenticationType authenticationType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("url"))
                {
                    url = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("authenticationType"))
                {
                    authenticationType = new WebAuthenticationType(property.Value.GetString());
                    continue;
                }
            }
            return(new WebAnonymousAuthentication(url, authenticationType));
        }
Esempio n. 4
0
 internal WebAnonymousAuthentication(object url, WebAuthenticationType authenticationType) : base(url, authenticationType)
 {
     AuthenticationType = authenticationType;
 }
Esempio n. 5
0
 internal WebLinkedServiceTypeProperties(object url, WebAuthenticationType authenticationType)
 {
     Url = url;
     AuthenticationType = authenticationType;
 }
Esempio n. 6
0
 internal WebBasicAuthentication(object url, WebAuthenticationType authenticationType, object username, SecretBase password) : base(url, authenticationType)
 {
     Username           = username;
     Password           = password;
     AuthenticationType = authenticationType;
 }
 internal WebClientCertificateAuthentication(object url, WebAuthenticationType authenticationType, SecretBase pfx, SecretBase password) : base(url, authenticationType)
 {
     Pfx                = pfx;
     Password           = password;
     AuthenticationType = authenticationType;
 }