Exemplo n.º 1
0
 public async Task InitSecretManager(CognitoOptions cognitoOptions)
 {
     await SetCognitoOptions(cognitoOptions, CalendarEnvironments.Dev.ToString());
     await SetCognitoOptions(cognitoOptions, CalendarEnvironments.Test.ToString());
     await SetCognitoOptions(cognitoOptions, CalendarEnvironments.Stage.ToString());
     await SetCognitoOptions(cognitoOptions, CalendarEnvironments.Prod.ToString());
 }
Exemplo n.º 2
0
 private async Task SetCognitoOptions(CognitoOptions options, string environmentPrefix)
 {
     await Set($"{environmentPrefix}_{CognitoPrefix}_ClientId", options.ClientId);
     await Set($"{environmentPrefix}_{CognitoPrefix}_UserPoolId", options.UserPoolId);
     await Set($"{environmentPrefix}_{CognitoPrefix}_JwtIssuer", options.JwtIssuer);
     await Set($"{environmentPrefix}_{CognitoPrefix}_RSAModulus", options.RSAModulus);
     await Set($"{environmentPrefix}_{CognitoPrefix}_RSAExponent", options.RSAExponent);
 }
Exemplo n.º 3
0
        public static IServiceCollection AddCognito <T>(
            this IServiceCollection services,
            CognitoOptions <T> configuration
            )
        {
            services.TryAddSingleton(configuration);
            services.TryAddSingleton <CognitoContext <T> >();

            return(services);
        }
Exemplo n.º 4
0
    public void SetUp()
    {
        var credentialsOptions  = new CredentialsOptions();
        var credentialsProvider = new CredentialsProvider(credentialsOptions);
        var options             = new CognitoOptions <CognitoContextTests>(
            ClientId: "",
            RegionEndpoint: "",
            CredentialsProfile: "",
            Role: ""
            );

        _context = new CognitoContext <CognitoContextTests>(credentialsProvider, options);
    }