React to DataProtection rename

This commit is contained in:
Levi B 2015-02-25 17:11:21 -08:00
parent a15cb4ffe5
commit d864b72561
20 changed files with 36 additions and 51 deletions

View File

@ -2,11 +2,11 @@ using System.Net.Http;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Security.Claims; using System.Security.Claims;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security; using Microsoft.AspNet.Security;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Google; using Microsoft.AspNet.Security.Google;
using Microsoft.AspNet.Security.MicrosoftAccount; using Microsoft.AspNet.Security.MicrosoftAccount;
using Microsoft.AspNet.Security.OAuth; using Microsoft.AspNet.Security.OAuth;

View File

@ -4,9 +4,9 @@
using System; using System;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.Cookies.Infrastructure; using Microsoft.AspNet.Security.Cookies.Infrastructure;
using Microsoft.AspNet.Security.DataHandler; using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel; using Microsoft.Framework.OptionsModel;
@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Security.Cookies
} }
if (Options.TicketDataFormat == null) if (Options.TicketDataFormat == null)
{ {
IDataProtector dataProtector = dataProtectionProvider.CreateDataProtector( IDataProtector dataProtector = dataProtectionProvider.CreateProtector(
typeof(CookieAuthenticationMiddleware).FullName, Options.AuthenticationType, "v2"); typeof(CookieAuthenticationMiddleware).FullName, Options.AuthenticationType, "v2");
Options.TicketDataFormat = new TicketDataFormat(dataProtector); Options.TicketDataFormat = new TicketDataFormat(dataProtector);
} }

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Security.DataProtection; using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.AspNet.Security.OAuth; using Microsoft.AspNet.Security.OAuth;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;

View File

@ -6,8 +6,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.DataHandler; using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.AspNet.Security.OAuth; using Microsoft.AspNet.Security.OAuth;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Security.DataProtection; using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.AspNet.Security.OAuth; using Microsoft.AspNet.Security.OAuth;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;

View File

@ -1,16 +1,16 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel;
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel;
namespace Microsoft.AspNet.Security.OAuth namespace Microsoft.AspNet.Security.OAuth
{ {
@ -70,7 +70,7 @@ namespace Microsoft.AspNet.Security.OAuth
if (Options.StateDataFormat == null) if (Options.StateDataFormat == null)
{ {
IDataProtector dataProtector = dataProtectionProvider.CreateDataProtector( IDataProtector dataProtector = dataProtectionProvider.CreateProtector(
this.GetType().FullName, Options.AuthenticationType, "v1"); this.GetType().FullName, Options.AuthenticationType, "v1");
Options.StateDataFormat = new PropertiesDataFormat(dataProtector); Options.StateDataFormat = new PropertiesDataFormat(dataProtector);
} }

View File

@ -2,8 +2,8 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"description": "ASP.NET 5 middleware that enables an application to support any standard OAuth 2.0 authentication workflow.", "description": "ASP.NET 5 middleware that enables an application to support any standard OAuth 2.0 authentication workflow.",
"dependencies": { "dependencies": {
"Microsoft.AspNet.Security": "1.0.0-*", "Microsoft.AspNet.DataProtection": "1.0.0-*",
"Microsoft.AspNet.Security.DataProtection": "1.0.0-*", "Microsoft.AspNet.Security": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"aspnet50": { "aspnet50": {

View File

@ -7,7 +7,6 @@ using System.Diagnostics.CodeAnalysis;
using System.IdentityModel.Tokens; using System.IdentityModel.Tokens;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel; using Microsoft.Framework.OptionsModel;

View File

@ -8,11 +8,11 @@ using System.IdentityModel.Tokens;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Security.DataHandler; using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataHandler.Encoder; using Microsoft.AspNet.Security.DataHandler.Encoder;
using Microsoft.AspNet.Security.DataHandler.Serializer; using Microsoft.AspNet.Security.DataHandler.Serializer;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel; using Microsoft.Framework.OptionsModel;
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
if (Options.StateDataFormat == null) if (Options.StateDataFormat == null)
{ {
var dataProtector = dataProtectionProvider.CreateDataProtector( var dataProtector = dataProtectionProvider.CreateProtector(
typeof(OpenIdConnectAuthenticationMiddleware).FullName, typeof(OpenIdConnectAuthenticationMiddleware).FullName,
typeof(string).FullName, typeof(string).FullName,
Options.AuthenticationType, Options.AuthenticationType,
@ -64,7 +64,7 @@ namespace Microsoft.AspNet.Security.OpenIdConnect
if (Options.StringDataFormat == null) if (Options.StringDataFormat == null)
{ {
var dataProtector = dataProtectionProvider.CreateDataProtector( var dataProtector = dataProtectionProvider.CreateProtector(
typeof(OpenIdConnectAuthenticationMiddleware).FullName, typeof(OpenIdConnectAuthenticationMiddleware).FullName,
typeof(string).FullName, typeof(string).FullName,
Options.AuthenticationType, Options.AuthenticationType,

View File

@ -6,9 +6,9 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Net.Http; using System.Net.Http;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.DataHandler; using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataHandler.Encoder; using Microsoft.AspNet.Security.DataHandler.Encoder;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.Infrastructure; using Microsoft.AspNet.Security.Infrastructure;
using Microsoft.AspNet.Security.Twitter.Messages; using Microsoft.AspNet.Security.Twitter.Messages;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
@ -60,7 +60,7 @@ namespace Microsoft.AspNet.Security.Twitter
} }
if (Options.StateDataFormat == null) if (Options.StateDataFormat == null)
{ {
IDataProtector dataProtector = dataProtectionProvider.CreateDataProtector( IDataProtector dataProtector = dataProtectionProvider.CreateProtector(
typeof(TwitterAuthenticationMiddleware).FullName, Options.AuthenticationType, "v1"); typeof(TwitterAuthenticationMiddleware).FullName, Options.AuthenticationType, "v1");
Options.StateDataFormat = new SecureDataFormat<RequestToken>( Options.StateDataFormat = new SecureDataFormat<RequestToken>(
Serializers.RequestToken, Serializers.RequestToken,

View File

@ -1,10 +1,10 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security.DataHandler.Encoder; using Microsoft.AspNet.Security.DataHandler.Encoder;
using Microsoft.AspNet.Security.DataHandler.Serializer; using Microsoft.AspNet.Security.DataHandler.Serializer;
using Microsoft.AspNet.Security.DataProtection;
namespace Microsoft.AspNet.Security.DataHandler namespace Microsoft.AspNet.Security.DataHandler
{ {

View File

@ -3,9 +3,9 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.DataHandler.Encoder; using Microsoft.AspNet.Security.DataHandler.Encoder;
using Microsoft.AspNet.Security.DataHandler.Serializer; using Microsoft.AspNet.Security.DataHandler.Serializer;
using Microsoft.AspNet.Security.DataProtection;
namespace Microsoft.AspNet.Security.DataHandler namespace Microsoft.AspNet.Security.DataHandler
{ {

View File

@ -2,9 +2,9 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Security.DataHandler.Encoder; using Microsoft.AspNet.Security.DataHandler.Encoder;
using Microsoft.AspNet.Security.DataHandler.Serializer; using Microsoft.AspNet.Security.DataHandler.Serializer;
using Microsoft.AspNet.Security.DataProtection;
namespace Microsoft.AspNet.Security.DataHandler namespace Microsoft.AspNet.Security.DataHandler
{ {

View File

@ -1,13 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNet.Security.DataProtection
{
public static class DataProtectionHelpers
{
public static IDataProtector CreateDataProtector([NotNull] this IDataProtectionProvider dataProtectionProvider, params string[] purposes)
{
return dataProtectionProvider.CreateProtector(string.Join(";", purposes));
}
}
}

View File

@ -2,10 +2,10 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"description": "ASP.NET 5 common types used by the various authentication middleware.", "description": "ASP.NET 5 common types used by the various authentication middleware.",
"dependencies": { "dependencies": {
"Microsoft.AspNet.DataProtection": "1.0.0-*",
"Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.RequestContainer": "1.0.0-*",
"Microsoft.AspNet.Http.Interfaces": "1.0.0-*", "Microsoft.AspNet.Http.Interfaces": "1.0.0-*",
"Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.AspNet.Http.Core": "1.0.0-*",
"Microsoft.AspNet.Security.DataProtection": "1.0.0-*",
"Microsoft.Framework.Logging": "1.0.0-*" "Microsoft.Framework.Logging": "1.0.0-*"
}, },
"frameworks": { "frameworks": {

View File

@ -9,7 +9,6 @@ using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
using Shouldly; using Shouldly;

View File

@ -12,17 +12,17 @@ using System.Threading.Tasks;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.OptionsModel;
using Newtonsoft.Json; using Newtonsoft.Json;
using Shouldly; using Shouldly;
using Xunit; using Xunit;
using Microsoft.Framework.OptionsModel;
using Microsoft.Framework.DependencyInjection;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.DataHandler;
namespace Microsoft.AspNet.Security.Google namespace Microsoft.AspNet.Security.Google
{ {

View File

@ -12,18 +12,18 @@ using System.Threading.Tasks;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.MicrosoftAccount; using Microsoft.AspNet.Security.MicrosoftAccount;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.OptionsModel;
using Newtonsoft.Json; using Newtonsoft.Json;
using Shouldly; using Shouldly;
using Xunit; using Xunit;
using Microsoft.Framework.OptionsModel;
using Microsoft.Framework.DependencyInjection;
using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataProtection;
namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount
{ {

View File

@ -14,11 +14,11 @@ using System.Threading.Tasks;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Security; using Microsoft.AspNet.Http.Security;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.DataHandler; using Microsoft.AspNet.Security.DataHandler;
using Microsoft.AspNet.Security.DataProtection;
using Microsoft.AspNet.Security.OpenIdConnect; using Microsoft.AspNet.Security.OpenIdConnect;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;

View File

@ -8,16 +8,16 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.DataProtection;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Security.Cookies; using Microsoft.AspNet.Security.Cookies;
using Microsoft.AspNet.Security.Twitter; using Microsoft.AspNet.Security.Twitter;
using Microsoft.AspNet.TestHost; using Microsoft.AspNet.TestHost;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.OptionsModel;
using Newtonsoft.Json; using Newtonsoft.Json;
using Shouldly; using Shouldly;
using Xunit; using Xunit;
using Microsoft.Framework.OptionsModel;
using Microsoft.Framework.DependencyInjection;
using Microsoft.AspNet.Security.DataProtection;
namespace Microsoft.AspNet.Security.Twitter namespace Microsoft.AspNet.Security.Twitter
{ {