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)); }
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)); }
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)); }
internal WebAnonymousAuthentication(object url, WebAuthenticationType authenticationType) : base(url, authenticationType) { AuthenticationType = authenticationType; }
internal WebLinkedServiceTypeProperties(object url, WebAuthenticationType authenticationType) { Url = url; AuthenticationType = authenticationType; }
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; }