-
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.
Merge pull request #5985 from NuGet/dev
[Deployment][2018.05.21]RI dev into master
- Loading branch information
Showing
139 changed files
with
22,433 additions
and
11,765 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
37 changes: 19 additions & 18 deletions
37
src/NuGetGallery/App_Data/Files/Content/Login-Discontinuation-Configuration.json
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
{ | ||
"DiscontinuedForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"DiscontinuedForDomains": [ | ||
"cannotUsePassword.com" | ||
], | ||
"ExceptionsForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"ForceTransformationToOrganizationForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"EnabledOrganizationAadTenants": [ | ||
{ | ||
"EmailDomain": "tenantOnly.com", | ||
"TenantId": "tenantID" | ||
} | ||
] | ||
"IsPasswordDiscontinuedForAll": false, | ||
"DiscontinuedForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"DiscontinuedForDomains": [ | ||
"cannotUsePassword.com" | ||
], | ||
"ExceptionsForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"ForceTransformationToOrganizationForEmailAddresses": [ | ||
"[email protected]" | ||
], | ||
"EnabledOrganizationAadTenants": [ | ||
{ | ||
"EmailDomain": "tenantOnly.com", | ||
"TenantId": "tenantID" | ||
} | ||
] | ||
} |
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,45 @@ | ||
// 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.Configuration; | ||
using System.Reflection; | ||
using System.Web.Configuration; | ||
using NuGetGallery.Configuration; | ||
|
||
namespace NuGetGallery | ||
{ | ||
public static class SessionPersistence | ||
{ | ||
public static void Setup(IGalleryConfigurationService config) | ||
{ | ||
// The machine keys are used for encrypting/decrypting cookies used by ASP.NET, these are usually set by IIS in 'Auto' mode. | ||
// During a deployment to Azure cloud service the same machine key values are set on all the instances of a given cloud service, | ||
// thereby providing session persistence across different instances in the same deployment slot. However, across different slots(staging vs production) | ||
// these session keys are different. Thereby causing the loss of session upon a slot swap. Manually setting these values on role start ensures same | ||
// keys are used by all the instances across all the slots of a Azure cloud service. See more analysis here: https://github.com/NuGet/Engineering/issues/1329 | ||
if (config.Current.EnableMachineKeyConfiguration | ||
&& !string.IsNullOrWhiteSpace(config.Current.MachineKeyDecryption) | ||
&& !string.IsNullOrWhiteSpace(config.Current.MachineKeyDecryptionKey) | ||
&& !string.IsNullOrWhiteSpace(config.Current.MachineKeyValidationAlgorithm) | ||
&& !string.IsNullOrWhiteSpace(config.Current.MachineKeyValidationKey)) | ||
{ | ||
var mksType = typeof(MachineKeySection); | ||
var mksSection = ConfigurationManager.GetSection("system.web/machineKey") as MachineKeySection; | ||
var resetMethod = mksType.GetMethod("Reset", BindingFlags.NonPublic | BindingFlags.Instance); | ||
|
||
var machineKeyConfig = new MachineKeySection(); | ||
machineKeyConfig.ApplicationName = mksSection.ApplicationName; | ||
machineKeyConfig.CompatibilityMode = mksSection.CompatibilityMode; | ||
machineKeyConfig.DataProtectorType = mksSection.DataProtectorType; | ||
machineKeyConfig.Validation = mksSection.Validation; | ||
|
||
machineKeyConfig.DecryptionKey = config.Current.MachineKeyDecryptionKey; | ||
machineKeyConfig.Decryption = config.Current.MachineKeyDecryption; | ||
machineKeyConfig.ValidationKey = config.Current.MachineKeyValidationKey; | ||
machineKeyConfig.ValidationAlgorithm = config.Current.MachineKeyValidationAlgorithm; | ||
|
||
resetMethod.Invoke(mksSection, new object[] { machineKeyConfig }); | ||
} | ||
} | ||
} | ||
} |
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/Areas/Admin/Migrations/201805221605033_DropPagerDutyColumn.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/NuGetGallery/Areas/Admin/Migrations/201805221605033_DropPagerDutyColumn.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,20 @@ | ||
namespace NuGetGallery.Areas.Admin | ||
{ | ||
using System; | ||
using System.Data.Entity.Migrations; | ||
|
||
public partial class DropPagerDutyColumn : DbMigration | ||
{ | ||
public override void Up() | ||
{ | ||
DropIndex("dbo.Admins", new[] { "PagerDutyUsername" }); | ||
DropColumn("dbo.Admins", "PagerDutyUsername"); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
AddColumn("dbo.Admins", "PagerDutyUsername", c => c.String(nullable: false, maxLength: 255, unicode: false)); | ||
CreateIndex("dbo.Admins", "PagerDutyUsername"); | ||
} | ||
} | ||
} |
Oops, something went wrong.