Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
44 changed files
with
1,020 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/NuGetGallery.Core/Auditing/AuditedAuthenticatedOperationAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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 AuditedAuthenticatedOperationAction | ||
{ | ||
/// <summary> | ||
/// Package push was attempted by a non-owner of the package | ||
/// </summary> | ||
PackagePushAttemptByNonOwner, | ||
|
||
/// <summary> | ||
/// Login failed, no such user | ||
/// </summary> | ||
FailedLoginNoSuchUser, | ||
|
||
/// <summary> | ||
/// Login failed, user exists but password is invalid | ||
/// </summary> | ||
FailedLoginInvalidPassword, | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedPackage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// 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; | ||
|
||
namespace NuGetGallery.Auditing.AuditedEntities | ||
{ | ||
public class AuditedPackage | ||
{ | ||
public int PackageRegistrationKey { get; private set; } | ||
public string Copyright { get; private set; } | ||
public DateTime Created { get; private set; } | ||
public string Description { get; private set; } | ||
public string ReleaseNotes { get; private set; } | ||
public int DownloadCount { get; private set; } | ||
public string ExternalPackageUrl { get; private set; } | ||
public string HashAlgorithm { get; private set; } | ||
public string Hash { get; private set; } | ||
public string IconUrl { get; private set; } | ||
public bool IsLatest { get; private set; } | ||
public bool IsLatestStable { get; private set; } | ||
public DateTime LastUpdated { get; private set; } | ||
public DateTime? LastEdited { get; private set; } | ||
public string LicenseUrl { get; private set; } | ||
public bool HideLicenseReport { get; private set; } | ||
public string Language { get; private set; } | ||
public DateTime Published { get; private set; } | ||
public long PackageFileSize { get; private set; } | ||
public string ProjectUrl { get; private set; } | ||
public bool RequiresLicenseAcceptance { get; private set; } | ||
public string Summary { get; private set; } | ||
public string Tags { get; private set; } | ||
public string Title { get; private set; } | ||
public string Version { get; private set; } | ||
public string NormalizedVersion { get; private set; } | ||
public string LicenseNames { get; private set; } | ||
public string LicenseReportUrl { get; private set; } | ||
public bool Listed { get; private set; } | ||
public bool IsPrerelease { get; private set; } | ||
public string FlattenedAuthors { get; private set; } | ||
public string FlattenedDependencies { get; private set; } | ||
public int Key { get; private set; } | ||
public string MinClientVersion { get; private set; } | ||
public int? UserKey { get; private set; } | ||
public bool Deleted { get; private set; } | ||
|
||
public static AuditedPackage CreateFrom(Package package) | ||
{ | ||
return new AuditedPackage | ||
{ | ||
PackageRegistrationKey = package.PackageRegistrationKey, | ||
Copyright = package.Copyright, | ||
Created = package.Created, | ||
Description = package.Description, | ||
ReleaseNotes = package.ReleaseNotes, | ||
DownloadCount = package.DownloadCount, | ||
#pragma warning disable 612 | ||
#pragma warning restore 612 | ||
HashAlgorithm = package.HashAlgorithm, | ||
Hash = package.Hash, | ||
IconUrl = package.IconUrl, | ||
IsLatest = package.IsLatest, | ||
IsLatestStable = package.IsLatestStable, | ||
LastUpdated = package.LastUpdated, | ||
LastEdited = package.LastEdited, | ||
LicenseUrl = package.LicenseUrl, | ||
HideLicenseReport = package.HideLicenseReport, | ||
Language = package.Language, | ||
Published = package.Published, | ||
PackageFileSize = package.PackageFileSize, | ||
ProjectUrl = package.ProjectUrl, | ||
RequiresLicenseAcceptance = package.RequiresLicenseAcceptance, | ||
Summary = package.Summary, | ||
Tags = package.Tags, | ||
Title = package.Title, | ||
Version = package.Version, | ||
NormalizedVersion = package.NormalizedVersion, | ||
LicenseNames = package.LicenseNames, | ||
LicenseReportUrl = package.LicenseReportUrl, | ||
Listed = package.Listed, | ||
IsPrerelease = package.IsPrerelease, | ||
FlattenedAuthors = package.FlattenedAuthors, | ||
FlattenedDependencies = package.FlattenedDependencies, | ||
Key = package.Key, | ||
MinClientVersion = package.MinClientVersion, | ||
UserKey = package.UserKey, | ||
Deleted = package.Deleted | ||
}; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedPackageIdentifier.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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 | ||
{ | ||
public class AuditedPackageIdentifier | ||
{ | ||
public string Id { get; } | ||
public string Version { get; } | ||
|
||
public AuditedPackageIdentifier(string id, string version) | ||
{ | ||
Id = id; | ||
Version = version; | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedPackageRegistration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
public class AuditedPackageRegistration | ||
{ | ||
public string Id { get; private set; } | ||
public int DownloadCount { get; private set; } | ||
public int Key { get; private set; } | ||
|
||
public static AuditedPackageRegistration CreateFrom(PackageRegistration packageRegistration) | ||
{ | ||
return new AuditedPackageRegistration | ||
{ | ||
Id = packageRegistration.Id, | ||
DownloadCount = packageRegistration.DownloadCount, | ||
Key = packageRegistration.Key | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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 AuditedPackageAction | ||
{ | ||
Delete, | ||
SoftDelete, | ||
Create, | ||
List, | ||
Unlist, | ||
Edit, | ||
UndoEdit, | ||
|
||
|
||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/NuGetGallery.Core/Auditing/AuditedPackageRegistrationAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 AuditedPackageRegistrationAction | ||
{ | ||
AddOwner, | ||
RemoveOwner | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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 AuditedUserAction | ||
{ | ||
Register, | ||
AddCredential, | ||
RemoveCredential, | ||
RequestPasswordReset, | ||
ChangeEmail, | ||
CancelChangeEmail, | ||
ConfirmEmail, | ||
Login | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.