public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
        {
            var required = validateConfigurationOptions?.Environment == Environments.Live;

            ConfigurationException.AssertThumbprint(Thumbprint, $"{nameof(AuthorizationRegistryClientOptions)}.{nameof(Thumbprint)}", required: required);
            ConfigurationException.AssertUri(BaseUri, $"{nameof(AuthorizationRegistryClientOptions)}.{nameof(BaseUri)}");
            ConfigurationException.AssertNotNull(ClientId, $"{nameof(AuthorizationRegistryClientOptions)}.{nameof(ClientId)}");
        }
コード例 #2
0
 public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
 {
     if (Enable)
     {
         ConfigurationException.AssertUri(AuthorityUrl, $"{nameof(SchemeOwnerIdentityProviderOptions)}.{nameof(AuthorityUrl)}");
         ConfigurationException.AssertNotNull(Scope, $"{nameof(SchemeOwnerIdentityProviderOptions)}.{nameof(Scope)}");
     }
 }
コード例 #3
0
 public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
 {
     ConfigurationException.AssertUri(BaseUri, $"{nameof(SpaOptions)}.{nameof(BaseUri)}");
     ConfigurationException.AssertNotNull(ApplicationName, $"{nameof(SpaOptions)}.{nameof(ApplicationName)}");
     ConfigurationException.AssertNotNull(TwoFactorEnabled, $"{nameof(SpaOptions)}.{nameof(TwoFactorEnabled)}");
     ConfigurationException.AssertNotNull(SpaClientId, $"{nameof(SpaOptions)}.{nameof(SpaClientId)}");
     ConfigurationException.AssertNotNull(SpaClientSecret, $"{nameof(SpaOptions)}.{nameof(SpaClientSecret)}");
     ConfigurationException.AssertNotNull(ApiName, $"{nameof(SpaOptions)}.{nameof(ApiName)}");
     ConfigurationException.AssertNotNull(ApiSecret, $"{nameof(SpaOptions)}.{nameof(ApiSecret)}");
 }
コード例 #4
0
        public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
        {
            ConfigurationException.AssertNotNull(SendGridKey, $"{nameof(EmailOptions)}.{nameof(SendGridKey)}");

            if (From == null)
            {
                throw new ConfigurationException($"Either the `{nameof(EmailOptions)}.{nameof(From)}` key was not found in the configuration or its value was not set.");
            }

            ConfigurationException.AssertNotNull(From.Address, $"{nameof(EmailOptions)}.{nameof(From)}{nameof(From.Address)}");
            ConfigurationException.AssertNotNull(From.DisplayName, $"{nameof(EmailOptions)}.{nameof(From)}{nameof(From.DisplayName)}");

            try
            {
                var address = new MailAddress(From.Address);
            }
            catch (FormatException)
            {
                throw new ConfigurationException($"The value of `{nameof(EmailOptions)}.{nameof(From)}.{nameof(From.Address)}` key must be a valid email address.");
            }
        }
コード例 #5
0
 public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
 {
     ConfigurationException.AssertNotNull(ClientId, $"{nameof(PartyDetailsOptions)}.{nameof(ClientId)}");
     ConfigurationException.AssertNotNull(Name, $"{nameof(PartyDetailsOptions)}.{nameof(Name)}");
     ConfigurationException.AssertUri(BaseUri, $"{nameof(PartyDetailsOptions)}.{nameof(BaseUri)}");
 }
コード例 #6
0
 public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
 {
     ConfigurationException.AssertNotNull(RawPublicKey, $"{nameof(DigitalSignerOptions)}.{nameof(RawPublicKey)}");
     ConfigurationException.AssertNotNull(PrivateKey, $"{nameof(DigitalSignerOptions)}.{nameof(PrivateKey)}");
 }
コード例 #7
0
 public void Validate(ConfigurationOptionsValidator validateConfigurationOptions)
 {
     ConfigurationException.AssertUri(KeyVaultUri, $"{nameof(KeyVaultOptions)}.{nameof(KeyVaultUri)}");
     ConfigurationException.AssertNotNull(PublicKeySecretName, $"{nameof(KeyVaultOptions)}.{nameof(PublicKeySecretName)}");
     ConfigurationException.AssertNotNull(PrivateKeyName, $"{nameof(KeyVaultOptions)}.{nameof(PrivateKeyName)}");
 }