Пример #1
0
#pragma warning disable CS0618 // Type or member is obsolete

    // IDistributedLockManager is marked as obsolete, because it's not ready for "prime time"
    // however; it is used to managed singleton function execution within the functions fx !!!

    public GitHubAdapter(
        IAuthorizationSessionClient sessionClient,
        IAuthorizationTokenClient tokenClient,
        IDistributedLockManager distributedLockManager,
        ISecretsStoreProvider secretsStoreProvider,
        IHttpClientFactory httpClientFactory,
        IOrganizationRepository organizationRepository,
        IUserRepository userRepository,
        IDeploymentScopeRepository deploymentScopeRepository,
        IProjectRepository projectRepository,
        IComponentRepository componentRepository,
        IComponentTemplateRepository componentTemplateRepository,
        IAzureSessionService azureSessionService,
        IAzureResourceService azureResourceService,
        IGraphService graphService,
        IFunctionsHost functionsHost = null)
        : base(sessionClient, tokenClient, distributedLockManager, secretsStoreProvider, azureSessionService, graphService, organizationRepository, deploymentScopeRepository, projectRepository, userRepository)
    {
        this.httpClientFactory           = httpClientFactory ?? new DefaultHttpClientFactory();
        this.organizationRepository      = organizationRepository ?? throw new ArgumentNullException(nameof(organizationRepository));
        this.userRepository              = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
        this.deploymentScopeRepository   = deploymentScopeRepository ?? throw new ArgumentNullException(nameof(deploymentScopeRepository));
        this.projectRepository           = projectRepository ?? throw new ArgumentNullException(nameof(projectRepository));
        this.componentRepository         = componentRepository ?? throw new ArgumentNullException(nameof(componentRepository));
        this.componentTemplateRepository = componentTemplateRepository ?? throw new ArgumentNullException(nameof(componentTemplateRepository));
        this.azureSessionService         = azureSessionService ?? throw new ArgumentNullException(nameof(azureSessionService));
        this.azureResourceService        = azureResourceService ?? throw new ArgumentNullException(nameof(azureResourceService));
        this.graphService  = graphService ?? throw new ArgumentNullException(nameof(graphService));
        this.functionsHost = functionsHost ?? FunctionsHost.Default;
    }
Пример #2
0
        public AzureSessionService(IAzureSessionOptions azureSessionOptions = null, IHttpClientFactory httpClientFactory = null)
        {
            this.azureSessionOptions = azureSessionOptions ?? AzureSessionOptions.Default;
            this.httpClientFactory   = httpClientFactory ?? new DefaultHttpClientFactory();

            credentials = new Lazy <AzureCredentials>(() => InitCredentials(), LazyThreadSafetyMode.PublicationOnly);
            session     = new Lazy <AZFluent.Azure.IAuthenticated>(() => InitSession(), LazyThreadSafetyMode.PublicationOnly);
        }
Пример #3
0
 public AzureSessionService(IAzureSessionOptions azureSessionOptions = null, IHttpClientFactory httpClientFactory = null)
 {
     this.azureSessionOptions = azureSessionOptions ?? AzureSessionOptions.Default;
     this.httpClientFactory   = httpClientFactory ?? new DefaultHttpClientFactory();
 }
Пример #4
0
 public static Task <string> AcquireTokenAsync(AzureEndpoint azureEndpoint = AzureEndpoint.ResourceManagerEndpoint, IAzureSessionOptions azureSessionOptions = null, IHttpClientFactory httpClientFactory = null)
 => new AzureSessionService(azureSessionOptions, httpClientFactory).AcquireTokenAsync(azureEndpoint);