-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5fd9b0
commit 53e74ae
Showing
29 changed files
with
1,102 additions
and
18 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
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,48 @@ | ||
// 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.ComponentModel.DataAnnotations; | ||
|
||
namespace NuGetGallery | ||
{ | ||
/// <summary> | ||
/// User-subscribed security policy. | ||
/// </summary> | ||
public class UserSecurityPolicy : IEntity | ||
{ | ||
public UserSecurityPolicy() | ||
{ | ||
} | ||
|
||
public UserSecurityPolicy(string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
/// <summary> | ||
/// Policy key. | ||
/// </summary> | ||
public int Key { get; set; } | ||
|
||
/// <summary> | ||
/// User key. | ||
/// </summary> | ||
public int UserKey { get; set; } | ||
|
||
/// <summary> | ||
/// User subscribed to this security policy. | ||
/// </summary> | ||
public User User { get; set; } | ||
|
||
/// <summary> | ||
/// Type name for the policy handler that provides policy behavior. | ||
/// </summary> | ||
[Required] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Support for JSON-serialized properties for specific policies. | ||
/// </summary> | ||
public string Value { get; set; } | ||
} | ||
} |
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
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
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.Filters | ||
{ | ||
public enum SecurityPolicyAction | ||
{ | ||
PackagePush, | ||
PackageVerify | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/NuGetGallery/Migrations/201704211454424_SecurityPolicies.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/NuGetGallery/Migrations/201704211454424_SecurityPolicies.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,28 @@ | ||
// 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.Migrations | ||
{ | ||
using System.Data.Entity.Migrations; | ||
|
||
public partial class SecurityPolicies : DbMigration | ||
{ | ||
public override void Up() | ||
{ | ||
CreateTable("UserSecurityPolicies", c => new | ||
{ | ||
Key = c.Int(nullable: false, identity: true), | ||
Name = c.String(nullable: false, maxLength: 256), | ||
UserKey = c.Int(nullable: false), | ||
Value = c.String(nullable: true, maxLength: 256) | ||
}) | ||
.PrimaryKey(t => t.Key) | ||
.ForeignKey("Users", t => t.UserKey); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
DropTable("UserSecurityPolicies"); | ||
} | ||
} | ||
} |
Oops, something went wrong.