示例#1
0
 public SharedRenewalParameters(
     AzureEnvironmentParams webAppEnvironment,
     string email,
     string servicePlanResourceGroup,
     AzureEnvironmentParams azureDnsEnvironment,
     string azureDnsZoneName,
     string azureDnsRelativeRecordSetName,
     bool?useIpBasedSsl,
     int?rsaKeyLength,
     Uri acmeBaseUri,
     string webRootPath,
     int?renewXNumberOfDaysBeforeExpiration,
     Uri authenticationUri,
     Uri azureTokenAudience,
     Uri azureManagementEndpoint,
     string azureDefaultWebsiteDomainName)
 {
     WebAppEnvironment                  = webAppEnvironment;
     Email                              = email;
     ServicePlanResourceGroup           = servicePlanResourceGroup;
     AzureDnsEnvironment                = azureDnsEnvironment;
     AzureDnsZoneName                   = azureDnsZoneName;
     AzureDnsRelativeRecordSetName      = azureDnsRelativeRecordSetName;
     UseIpBasedSsl                      = useIpBasedSsl;
     RsaKeyLength                       = rsaKeyLength;
     AcmeBaseUri                        = acmeBaseUri;
     WebRootPath                        = webRootPath;
     RenewXNumberOfDaysBeforeExpiration = renewXNumberOfDaysBeforeExpiration;
     AuthenticationUri                  = authenticationUri;
     AzureTokenAudience                 = azureTokenAudience;
     AzureManagementEndpoint            = azureManagementEndpoint;
     AzureDefaultWebsiteDomainName      = azureDefaultWebsiteDomainName;
 }
        public RenewalParameters(
            AzureEnvironmentParams webAppEnvironmentParams,
            string webApp,
            IReadOnlyList <string> hosts,
            string toEmail,
            string fromEmail,
            string servicePlanResourceGroup = null,
            string groupName    = null,
            string siteSlotName = null,
            AzureEnvironmentParams azureDnsEnvironmentParams = null,
            string azureDnsZoneName = null,
            string azureDnsRelativeRecordSetName = null,
            GoDaddyEnvironmentParams goDaddyDnsEnvironmentParams = null,
            bool useIpBasedSsl = false,
            int rsaKeyLength   = 2048,
            Uri acmeBaseUri    = null,
            string webRootPath = null,
            int renewXNumberOfDaysBeforeExpiration = -1,
            Uri authenticationUri                = null,
            Uri azureTokenAudience               = null,
            Uri azureManagementEndpoint          = null,
            string azureDefaultWebsiteDomainName = null)
        {
            bool dnsChallenge = azureDnsZoneName != null && azureDnsRelativeRecordSetName != null;

            WebAppEnvironmentParams = ParamValidator.VerifyNonNull(webAppEnvironmentParams, nameof(webAppEnvironmentParams));
            WebApp    = ParamValidator.VerifyString(webApp, nameof(webApp));
            Hosts     = VerifyHosts(hosts, dnsChallenge, nameof(hosts));
            ToEmail   = VerifyEmail(toEmail, nameof(toEmail));
            FromEmail = VerifyEmail(fromEmail, nameof(fromEmail));
            ServicePlanResourceGroup = ParamValidator.VerifyOptionalString(servicePlanResourceGroup, nameof(servicePlanResourceGroup));
            GroupName    = ParamValidator.VerifyOptionalString(groupName, nameof(groupName));
            SiteSlotName = ParamValidator.VerifyOptionalString(siteSlotName, nameof(siteSlotName));
            AzureDnsEnvironmentParams     = azureDnsEnvironmentParams ?? WebAppEnvironmentParams;
            AzureDnsZoneName              = ParamValidator.VerifyOptionalString(azureDnsZoneName, nameof(azureDnsZoneName));
            AzureDnsRelativeRecordSetName = ParamValidator.VerifyOptionalString(azureDnsRelativeRecordSetName, nameof(azureDnsRelativeRecordSetName));
            GoDaddyDnsEnvironmentParams   = goDaddyDnsEnvironmentParams;
            UseIpBasedSsl = useIpBasedSsl;
            RsaKeyLength  = ParamValidator.VerifyPositiveInteger(rsaKeyLength, nameof(rsaKeyLength));
            AcmeBaseUri   = ParamValidator.VerifyOptionalUri(acmeBaseUri, nameof(acmeBaseUri));
            WebRootPath   = ParamValidator.VerifyOptionalString(webRootPath, nameof(webRootPath));
            RenewXNumberOfDaysBeforeExpiration =
                VerifyRenewXNumberOfDaysBeforeExpiration(renewXNumberOfDaysBeforeExpiration, !dnsChallenge, nameof(renewXNumberOfDaysBeforeExpiration));
            AuthenticationUri             = ParamValidator.VerifyOptionalUri(authenticationUri, nameof(authenticationUri));
            AzureTokenAudience            = ParamValidator.VerifyOptionalUri(azureTokenAudience, nameof(azureTokenAudience));
            AzureManagementEndpoint       = ParamValidator.VerifyOptionalUri(azureManagementEndpoint, nameof(azureManagementEndpoint));
            AzureDefaultWebsiteDomainName = ParamValidator.VerifyOptionalHostName(azureDefaultWebsiteDomainName, nameof(azureDefaultWebsiteDomainName));
        }