/// <summary> /// /// </summary> /// <param name="repository">Required.</param> /// <param name="authenticationService">Optional. If this is not supplied Upload/Delete is not available (requests returns 403 Forbidden)</param> protected NuGetODataController( IServerPackageRepository repository, IPackageAuthenticationService authenticationService = null) { _serverRepository = repository ?? throw new ArgumentNullException(nameof(repository)); _authenticationService = authenticationService; }
public PackageService( IServerPackageRepository repository, IPackageAuthenticationService authenticationService, NLog.ILogger logger) { _serverRepository = repository; _authenticationService = authenticationService; _logger = logger; }
public DefaultServiceResolver() { _hashProvider = new CryptoHashProvider(Constants.HashAlgorithm); _packageRepository = new ServerPackageRepository(PackageUtility.PackagePhysicalPath, _hashProvider, new TraceLogger()); _packageAuthenticationService = new PackageAuthenticationService(); _packageService = new PackageService(_packageRepository, _packageAuthenticationService); }
protected override async Task <NuGetAuthenticationResult> IsAuthorized(IPackageAuthenticationService authenticationService) { GetUserCredentials(out var username, out var password); var result = await authenticationService.AuthenticateAsync(username, password, default); if (!result.Succeeded && string.IsNullOrEmpty(result.Realm)) { return(NuGetAuthenticationResult.Fail(result.Message, result.Server, "AvantiPoint Package Feed")); } return(result); }
public PackageService(IServerPackageRepository repository, IPackageAuthenticationService authenticationService) { _serverRepository = repository; _authenticationService = authenticationService; }
public PackageService(IServerPackageRepository repository, IPackageAuthenticationService authenticationService) { _serverRepository = repository; _authenticationService = authenticationService; }
/// <summary> /// Initializes a new instance of the <see cref="AzurePackageService"/> class. /// </summary> /// <param name="repository"> /// Repository of packages /// </param> /// <param name="authenticationService"> /// Authentication service /// </param> public AzurePackageService(AzureServerPackageRepository repository, IPackageAuthenticationService authenticationService) { this.repository = repository; this.packageService = new PackageService(repository, authenticationService); }
public AzurePackageService(AzureServerPackageRepository repository, IPackageAuthenticationService authenticationService) : base(repository, authenticationService) { _azureRepository = repository; }
protected override Task <NuGetAuthenticationResult> IsAuthorized(IPackageAuthenticationService authenticationService) { GetApiToken(out var apiKey); return(authenticationService.AuthenticateAsync(apiKey, default)); }
public AzurePackageService(AzureServerPackageRepository repository, IPackageAuthenticationService authenticationService) : base(repository, authenticationService) { _azureRepository = repository; }
protected abstract Task <NuGetAuthenticationResult> IsAuthorized(IPackageAuthenticationService authenticationService);
public NuGetPublicODataController(IPackageAuthenticationService packageAuthenticationService) : base(ServiceLocator.Current.GetInstance <IServerPackageRepository>("NuGetPublic"), packageAuthenticationService) { }
public SymbolPackageService(IServerPackageRepository repository, IPackageAuthenticationService authenticationService) : base(repository, authenticationService) { }