Permalink
Please sign in to comment.
Browse files
Merge pull request #3997 from NuGet/dev
[ReleasePrep][2017.05.19]RI of dev into master
- Loading branch information...
Showing
with
3,750 additions
and 1,081 deletions.
- +1 −1 README.md
- +22 −0 src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedUserSecurityPolicy.cs
- +1 −2 src/NuGetGallery.Core/Auditing/AuditedPackageAction.cs
- +11 −0 src/NuGetGallery.Core/Auditing/AuditedSecurityPolicyAction.cs
- +3 −1 src/NuGetGallery.Core/Auditing/AuditedUserAction.cs
- +0 −16 src/NuGetGallery.Core/Auditing/UserAuditAction.cs
- +18 −1 src/NuGetGallery.Core/Auditing/UserAuditRecord.cs
- +50 −0 src/NuGetGallery.Core/Auditing/UserSecurityPolicyAuditRecord.cs
- +1 −0 src/NuGetGallery.Core/Entities/EntitiesContext.cs
- +2 −1 src/NuGetGallery.Core/Entities/IEntitiesContext.cs
- +40 −3 src/NuGetGallery.Core/Entities/UserSecurityPolicy.cs
- +3 −1 src/NuGetGallery.Core/NuGetGallery.Core.csproj
- +3 −0 src/NuGetGallery/App_Start/DefaultDependenciesModule.cs
- +10 −0 src/NuGetGallery/App_Start/Routes.cs
- +122 −0 src/NuGetGallery/Areas/Admin/Controllers/SecurityPolicyController.cs
- +28 −0 src/NuGetGallery/Areas/Admin/ViewModels/SecurityPolicyViewModel.cs
- +23 −0 src/NuGetGallery/Areas/Admin/ViewModels/UserSecurityPolicySearchResult.cs
- +22 −0 src/NuGetGallery/Areas/Admin/ViewModels/UserSecurityPolicySubscriptions.cs
- +11 −0 src/NuGetGallery/Areas/Admin/Views/Home/Index.cshtml
- +168 −0 src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml
- +0 −1 src/NuGetGallery/Authentication/Providers/ApiKey/ApiKeyAuthenticationHandler.cs
- +2 −2 src/NuGetGallery/Constants.cs
- +336 −307 src/NuGetGallery/Content/Site.css
- +33 −19 src/NuGetGallery/Controllers/ApiController.cs
- +8 −2 src/NuGetGallery/Controllers/PackagesController.cs
- +68 −21 src/NuGetGallery/Controllers/StatisticsController.cs
- +11 −0 src/NuGetGallery/ExtensionMethods.cs
- +3 −55 src/NuGetGallery/Filters/ApiAuthorizeAttribute.cs
- +8 −6 src/NuGetGallery/Helpers/AccordeonHelper.cs
- +1 −1 src/NuGetGallery/Infrastructure/ApplicationVersionHelper.cs
- +29 −0 src/NuGetGallery/Migrations/201705031714183_AddIndexSemVerLevelKey.Designer.cs
- +18 −0 src/NuGetGallery/Migrations/201705031714183_AddIndexSemVerLevelKey.cs
- +126 −0 src/NuGetGallery/Migrations/201705031714183_AddIndexSemVerLevelKey.resx
- +29 −0 src/NuGetGallery/Migrations/201705032101231_SecurityPoliciesFix.Designer.cs
- +45 −0 src/NuGetGallery/Migrations/201705032101231_SecurityPoliciesFix.cs
- +126 −0 src/NuGetGallery/Migrations/201705032101231_SecurityPoliciesFix.resx
- +29 −0 src/NuGetGallery/Migrations/201705041614287_UserSecurityPolicies_SubscriptionColumn.Designer.cs
- +18 −0 src/NuGetGallery/Migrations/201705041614287_UserSecurityPolicies_SubscriptionColumn.cs
- +126 −0 src/NuGetGallery/Migrations/201705041614287_UserSecurityPolicies_SubscriptionColumn.resx
- +31 −2 src/NuGetGallery/NuGetGallery.csproj
- +2 −0 src/NuGetGallery/RouteNames.cs
- +7 −5 src/NuGetGallery/Scripts/nugetgallery.js
- +47 −3 src/NuGetGallery/Scripts/statsdimensions.js
- +28 −4 src/NuGetGallery/Security/ISecurityPolicyService.cs
- +35 −0 src/NuGetGallery/Security/IUserSecurityPolicySubscription.cs
- +18 −3 src/NuGetGallery/Security/RequireMinClientVersionForPushPolicy.cs
- +1 −1 src/NuGetGallery/Security/RequirePackageVerifyScopePolicy.cs
- +100 −0 src/NuGetGallery/Security/SecurePushSubscription.cs
- +1 −1 src/NuGetGallery/{Filters → Security}/SecurityPolicyAction.cs
- +178 −11 src/NuGetGallery/Security/SecurityPolicyService.cs
- +5 −15 src/NuGetGallery/Security/{UserSecurityPolicyContext.cs → UserSecurityPolicyEvaluationContext.cs}
- +1 −1 src/NuGetGallery/Security/UserSecurityPolicyHandler.cs
- +23 −0 src/NuGetGallery/Security/UserSecurityPolicySubscriptionContext.cs
- +10 −0 src/NuGetGallery/Services/TelemetryService.cs
- +0 −1 src/NuGetGallery/ViewModels/ReportAbuseViewModel.cs
- +1 −1 src/NuGetGallery/ViewModels/ReportPackageReason.cs
- +3 −9 src/NuGetGallery/ViewModels/StatisticsPackagesViewModel.cs
- +9 −9 src/NuGetGallery/Views/Authentication/_Register.cshtml
- +17 −1 src/NuGetGallery/Views/Packages/ReportAbuse.cshtml
- +2 −2 src/NuGetGallery/Views/Packages/UploadPackage.cshtml
- +12 −2 src/NuGetGallery/Views/Packages/VerifyPackage.cshtml
- +4 −29 src/NuGetGallery/Views/Statistics/PackageDownloadsByVersion.cshtml
- +5 −31 src/NuGetGallery/Views/Statistics/PackageDownloadsDetail.cshtml
- +75 −87 src/NuGetGallery/Views/Statistics/_PivotTable.cshtml
- +6 −6 src/NuGetGallery/Views/Users/Account.cshtml
- +52 −31 src/NuGetGallery/Views/Users/ApiKeys.cshtml
- +2 −2 src/NuGetGallery/Views/Users/Packages.cshtml
- +2 −1 tests/NuGetGallery.Core.Facts/Auditing/AuditRecordTests.cs
- +2 −1 tests/NuGetGallery.Core.Facts/Auditing/AuditedPackageActionTests.cs
- +3 −1 tests/NuGetGallery.Core.Facts/Auditing/AuditedUserActionTests.cs
- +52 −0 tests/NuGetGallery.Core.Facts/Auditing/UserAuditRecordTests.cs
- +97 −0 tests/NuGetGallery.Core.Facts/Auditing/UserSecurityPolicyAuditRecordFacts.cs
- +76 −0 tests/NuGetGallery.Core.Facts/Entities/UserSecurityPolicyFacts.cs
- +2 −0 tests/NuGetGallery.Core.Facts/NuGetGallery.Core.Facts.csproj
- +205 −0 tests/NuGetGallery.Facts/Areas/Admin/Controllers/SecurityPolicyControllerFacts.cs
- +58 −29 tests/NuGetGallery.Facts/Controllers/ApiControllerFacts.cs
- +166 −167 tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs
- +62 −27 tests/NuGetGallery.Facts/Controllers/StatisticsControllerFacts.cs
- +41 −0 tests/NuGetGallery.Facts/ExtensionMethodsFacts.cs
- +3 −44 tests/NuGetGallery.Facts/Filters/ApiAuthorizeAttributeFacts.cs
- +4 −0 tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj
- +6 −35 tests/NuGetGallery.Facts/Security/RequireMinClientVersionForPushPolicyFacts.cs
- +5 −6 tests/NuGetGallery.Facts/Security/RequirePackageVerifyScopePolicyFacts.cs
- +156 −0 tests/NuGetGallery.Facts/Security/SecurePushSubscriptionFacts.cs
- +373 −56 tests/NuGetGallery.Facts/Security/SecurityPolicyServiceFacts.cs
- +69 −0 tests/NuGetGallery.Facts/Security/TestSecurityPolicyService.cs
- +90 −0 tests/NuGetGallery.Facts/Security/TestUserSecurityPolicyData.cs
- +12 −0 tests/NuGetGallery.Facts/TestUtils/FakeEntitiesContext.cs
- +16 −1 tests/NuGetGallery.Facts/TestUtils/MockExtensions.cs
- +15 −15 tests/NuGetGallery.FunctionalTests/PackageCreation/SecurityPolicyTests.cs
- +5 −1 tools/Setup-DevEnvironment.ps1
| @@ -0,0 +1,22 @@ | ||
| +// Copyright (c) .NET Foundation. All rights reserved. | ||
| +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
| + | ||
| +namespace NuGetGallery.Auditing.AuditedEntities | ||
| +{ | ||
| + /// <summary> | ||
| + /// Auditing details for UserSecurityPolicy entity. | ||
| + /// </summary> | ||
| + public class AuditedUserSecurityPolicy | ||
| + { | ||
| + public string Name { get; } | ||
| + public string Subscription { get; } | ||
| + public string Value { get; } | ||
| + | ||
| + public AuditedUserSecurityPolicy(UserSecurityPolicy policy) | ||
| + { | ||
| + Name = policy.Name; | ||
| + Subscription = policy.Subscription; | ||
| + Value = policy.Value; | ||
| + } | ||
| + } | ||
| +} |
| @@ -0,0 +1,11 @@ | ||
| +// Copyright (c) .NET Foundation. All rights reserved. | ||
| +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
| + | ||
| +namespace NuGetGallery.Auditing | ||
| +{ | ||
| + public enum AuditedSecurityPolicyAction | ||
| + { | ||
| + Create, | ||
| + Verify | ||
| + } | ||
| +} |
| @@ -1,16 +0,0 @@ | ||
| -// Copyright (c) .NET Foundation. All rights reserved. | ||
| -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
| - | ||
| -namespace NuGetGallery.Auditing | ||
| -{ | ||
| - public enum UserAuditAction | ||
| - { | ||
| - Registered, | ||
| - AddedCredential, | ||
| - RemovedCredential, | ||
| - RequestedPasswordReset, | ||
| - ChangeEmail, | ||
| - CancelChangeEmail, | ||
| - ConfirmEmail, | ||
| - } | ||
| -} |
| @@ -0,0 +1,50 @@ | ||
| +// Copyright (c) .NET Foundation. All rights reserved. | ||
| +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
| + | ||
| +using System; | ||
| +using System.Collections.Generic; | ||
| +using System.Linq; | ||
| +using NuGetGallery.Auditing.AuditedEntities; | ||
| + | ||
| +namespace NuGetGallery.Auditing | ||
| +{ | ||
| + /// <summary> | ||
| + /// Audit record for user security policy evaluations. | ||
| + /// </summary> | ||
| + public class UserSecurityPolicyAuditRecord : AuditRecord<AuditedSecurityPolicyAction> | ||
| + { | ||
| + public string Username { get; } | ||
| + | ||
| + public AuditedUserSecurityPolicy[] AffectedPolicies { get; } | ||
| + | ||
| + public bool Success { get; set; } | ||
| + | ||
| + public string ErrorMessage { get; } | ||
| + | ||
| + public UserSecurityPolicyAuditRecord(string username, | ||
| + AuditedSecurityPolicyAction action, | ||
| + IEnumerable<UserSecurityPolicy> affectedPolicies, | ||
| + bool success, string errorMessage = null) | ||
| + :base(action) | ||
| + { | ||
| + if (string.IsNullOrEmpty(username)) | ||
| + { | ||
| + throw new ArgumentNullException(nameof(username)); | ||
| + } | ||
| + if (affectedPolicies == null || affectedPolicies.Count() == 0) | ||
| + { | ||
| + throw new ArgumentException(nameof(affectedPolicies)); | ||
| + } | ||
| + | ||
| + Username = username; | ||
| + AffectedPolicies = affectedPolicies.Select(p => new AuditedUserSecurityPolicy(p)).ToArray(); | ||
| + Success = success; | ||
| + ErrorMessage = errorMessage; | ||
| + } | ||
| + | ||
| + public override string GetPath() | ||
| + { | ||
| + return Username.ToLowerInvariant(); | ||
| + } | ||
| + } | ||
| +} |
Oops, something went wrong.
0 comments on commit
f8c9246