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()); }
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); }
public static IServiceCollection AddCognito <T>( this IServiceCollection services, CognitoOptions <T> configuration ) { services.TryAddSingleton(configuration); services.TryAddSingleton <CognitoContext <T> >(); return(services); }
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); }