Ejemplo n.º 1
0
 public ConfigController(
     IOptions <AuthenticationOptions> authenticationOptions,
     IOptions <LeafVersionOptions> versionOptions,
     IOptions <CohortOptions> cohortOptions,
     IOptions <ClientOptions> clientOptions,
     IOptions <AttestationOptions> attestationOptions)
 {
     this.authenticationOptions = authenticationOptions.Value;
     this.versionOptions        = versionOptions.Value;
     this.cohortOptions         = cohortOptions.Value;
     this.clientOptions         = clientOptions.Value;
     this.attestationOptions    = attestationOptions.Value;
 }
Ejemplo n.º 2
0
 public ConfigController(
     IOptions <AuthenticationOptions> authenticationOptions,
     IOptions <LeafVersionOptions> versionOptions,
     IOptions <CohortOptions> cohortOptions,
     IOptions <ClientOptions> clientOptions,
     IOptions <AttestationOptions> attestationOptions,
     IOptions <DeidentificationOptions> deidentOptions,
     IServerStateCache serverStateCache)
 {
     this.authenticationOptions = authenticationOptions.Value;
     this.versionOptions        = versionOptions.Value;
     this.cohortOptions         = cohortOptions.Value;
     this.clientOptions         = clientOptions.Value;
     this.attestationOptions    = attestationOptions.Value;
     this.deidentOptions        = deidentOptions.Value;
     this.serverStateCache      = serverStateCache;
 }
Ejemplo n.º 3
0
        static IServiceCollection ConfigureAttestationOptions(this IServiceCollection services, IConfiguration config)
        {
            var attest = new AttestationOptions {
                Enabled = config.GetValue <bool>(Config.Attestation.Enabled)
            };

            if (attest.Enabled)
            {
                attest.WithAttestationType(config.GetValue <string>(Config.Attestation.Type));
                if (attest.Type != CustomAttestationType.None)
                {
                    attest.Text = config.GetSection(Config.Attestation.Text).Get <string[]>();
                }
            }
            services.Configure <AttestationOptions>(opts =>
            {
                opts.Enabled = attest.Enabled;
                opts.Text    = attest.Text;
                opts.Type    = attest.Type;
            });

            return(services);
        }