mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
Updated packages and fixed build errors and tests..now need to update nuspec
This commit is contained in:
parent
536db48049
commit
b2d33f0ec5
@ -19,11 +19,11 @@ namespace Ocelot.Authentication.Handler.Creator
|
|||||||
builder.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
|
builder.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
|
||||||
{
|
{
|
||||||
Authority = authOptions.ProviderRootUrl,
|
Authority = authOptions.ProviderRootUrl,
|
||||||
ScopeName = authOptions.ScopeName,
|
ApiName = authOptions.ScopeName,
|
||||||
RequireHttpsMetadata = authOptions.RequireHttps,
|
RequireHttpsMetadata = authOptions.RequireHttps,
|
||||||
AdditionalScopes = authOptions.AdditionalScopes,
|
AllowedScopes = authOptions.AdditionalScopes,
|
||||||
SupportedTokens = SupportedTokens.Both,
|
SupportedTokens = SupportedTokens.Both,
|
||||||
ScopeSecret = authOptions.ScopeSecret
|
ApiSecret = authOptions.ScopeSecret
|
||||||
});
|
});
|
||||||
|
|
||||||
var authenticationNext = builder.Build();
|
var authenticationNext = builder.Build();
|
||||||
|
@ -2,37 +2,36 @@
|
|||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
|
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
"Microsoft.Extensions.Configuration.Json": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0",
|
"Microsoft.Extensions.Logging": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
"Microsoft.Extensions.Logging.Console": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.1.0",
|
||||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Http": "1.0.0",
|
"Microsoft.AspNetCore.Http": "1.1.0",
|
||||||
"System.Text.RegularExpressions": "4.1.0",
|
"System.Text.RegularExpressions": "4.3.0",
|
||||||
"Microsoft.AspNetCore.Authentication.OAuth": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.OAuth": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.Google": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.Google": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.Facebook": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.Facebook": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.Twitter": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.Twitter": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication.MicrosoftAccount": "1.0.0",
|
"Microsoft.AspNetCore.Authentication.MicrosoftAccount": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Authentication": "1.0.0",
|
"Microsoft.AspNetCore.Authentication": "1.1.0",
|
||||||
"IdentityServer4.AccessTokenValidation": "1.0.1-rc2",
|
"IdentityServer4.AccessTokenValidation": "1.0.2",
|
||||||
"Microsoft.AspNetCore.Mvc": "1.0.1",
|
"Microsoft.AspNetCore.Mvc": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": "1.1.0",
|
||||||
"version": "1.0.1",
|
"CacheManager.Core": "0.9.2",
|
||||||
"type": "platform"
|
"CacheManager.Microsoft.Extensions.Configuration": "0.9.2",
|
||||||
|
"CacheManager.Microsoft.Extensions.Logging": "0.9.2"
|
||||||
},
|
},
|
||||||
"CacheManager.Core": "0.9.1",
|
"runtimes": {
|
||||||
"CacheManager.Microsoft.Extensions.Configuration": "0.9.1",
|
"win10-x64": {}
|
||||||
"CacheManager.Microsoft.Extensions.Logging": "0.9.1"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.4": {
|
"netcoreapp1.4": {
|
||||||
"imports": [
|
"imports": [
|
||||||
|
@ -4,7 +4,6 @@ using System.IO;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Services.InMemory;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@ -15,6 +14,9 @@ using Xunit;
|
|||||||
|
|
||||||
namespace Ocelot.AcceptanceTests
|
namespace Ocelot.AcceptanceTests
|
||||||
{
|
{
|
||||||
|
using IdentityServer4;
|
||||||
|
using IdentityServer4.Test;
|
||||||
|
|
||||||
public class AuthenticationTests : IDisposable
|
public class AuthenticationTests : IDisposable
|
||||||
{
|
{
|
||||||
private IWebHost _servicebuilder;
|
private IWebHost _servicebuilder;
|
||||||
@ -241,26 +243,34 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
services.AddLogging();
|
services.AddLogging();
|
||||||
services.AddDeveloperIdentityServer()
|
services.AddIdentityServer()
|
||||||
.AddInMemoryScopes(new List<Scope>
|
.AddTemporarySigningCredential()
|
||||||
|
.AddInMemoryApiResources(new List<ApiResource>
|
||||||
{
|
{
|
||||||
new Scope
|
new ApiResource
|
||||||
{
|
{
|
||||||
Name = scopeName,
|
Name = scopeName,
|
||||||
Description = "My API",
|
Description = "My API",
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
AllowUnrestrictedIntrospection = true,
|
DisplayName = "test",
|
||||||
ScopeSecrets = new List<Secret>()
|
Scopes = new List<Scope>()
|
||||||
|
{
|
||||||
|
new Scope("api"),
|
||||||
|
new Scope("openid"),
|
||||||
|
new Scope("offline_access")
|
||||||
|
},
|
||||||
|
ApiSecrets = new List<Secret>()
|
||||||
{
|
{
|
||||||
new Secret
|
new Secret
|
||||||
{
|
{
|
||||||
Value = "secret".Sha256()
|
Value = "secret".Sha256()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
UserClaims = new List<string>()
|
||||||
|
{
|
||||||
|
"CustomerId", "LocationId"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
StandardScopes.OpenId,
|
|
||||||
StandardScopes.OfflineAccess
|
|
||||||
})
|
})
|
||||||
.AddInMemoryClients(new List<Client>
|
.AddInMemoryClients(new List<Client>
|
||||||
{
|
{
|
||||||
@ -275,14 +285,13 @@ namespace Ocelot.AcceptanceTests
|
|||||||
RequireClientSecret = false
|
RequireClientSecret = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryUsers(new List<InMemoryUser>
|
.AddTestUsers(new List<TestUser>
|
||||||
{
|
{
|
||||||
new InMemoryUser
|
new TestUser
|
||||||
{
|
{
|
||||||
Username = "test",
|
Username = "test",
|
||||||
Password = "test",
|
Password = "test",
|
||||||
Enabled = true,
|
SubjectId = "registered|1231231",
|
||||||
Subject = "registered|1231231",
|
|
||||||
Claims = new List<Claim>
|
Claims = new List<Claim>
|
||||||
{
|
{
|
||||||
new Claim("CustomerId", "123"),
|
new Claim("CustomerId", "123"),
|
||||||
|
@ -4,7 +4,6 @@ using System.IO;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Services.InMemory;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@ -15,6 +14,9 @@ using Xunit;
|
|||||||
|
|
||||||
namespace Ocelot.AcceptanceTests
|
namespace Ocelot.AcceptanceTests
|
||||||
{
|
{
|
||||||
|
using IdentityServer4;
|
||||||
|
using IdentityServer4.Test;
|
||||||
|
|
||||||
public class AuthorisationTests : IDisposable
|
public class AuthorisationTests : IDisposable
|
||||||
{
|
{
|
||||||
private IWebHost _servicebuilder;
|
private IWebHost _servicebuilder;
|
||||||
@ -164,27 +166,35 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
services.AddLogging();
|
services.AddLogging();
|
||||||
services.AddDeveloperIdentityServer()
|
services.AddIdentityServer()
|
||||||
.AddInMemoryScopes(new List<Scope>
|
.AddTemporarySigningCredential()
|
||||||
|
.AddInMemoryApiResources(new List<ApiResource>
|
||||||
{
|
{
|
||||||
new Scope
|
new ApiResource
|
||||||
{
|
{
|
||||||
Name = scopeName,
|
Name = scopeName,
|
||||||
Description = "My API",
|
Description = "My API",
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
AllowUnrestrictedIntrospection = true,
|
DisplayName = "test",
|
||||||
ScopeSecrets = new List<Secret>()
|
Scopes = new List<Scope>()
|
||||||
|
{
|
||||||
|
new Scope("api"),
|
||||||
|
new Scope("openid"),
|
||||||
|
new Scope("offline_access")
|
||||||
|
},
|
||||||
|
ApiSecrets = new List<Secret>()
|
||||||
{
|
{
|
||||||
new Secret
|
new Secret
|
||||||
{
|
{
|
||||||
Value = "secret".Sha256()
|
Value = "secret".Sha256()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
IncludeAllClaimsForUser = true
|
UserClaims = new List<string>()
|
||||||
|
{
|
||||||
|
"CustomerId", "LocationId", "UserType", "UserId"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
StandardScopes.OpenId,
|
|
||||||
StandardScopes.OfflineAccess
|
|
||||||
})
|
})
|
||||||
.AddInMemoryClients(new List<Client>
|
.AddInMemoryClients(new List<Client>
|
||||||
{
|
{
|
||||||
@ -199,14 +209,13 @@ namespace Ocelot.AcceptanceTests
|
|||||||
RequireClientSecret = false
|
RequireClientSecret = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryUsers(new List<InMemoryUser>
|
.AddTestUsers(new List<TestUser>
|
||||||
{
|
{
|
||||||
new InMemoryUser
|
new TestUser
|
||||||
{
|
{
|
||||||
Username = "test",
|
Username = "test",
|
||||||
Password = "test",
|
Password = "test",
|
||||||
Enabled = true,
|
SubjectId = "registered|1231231",
|
||||||
Subject = "registered|1231231",
|
|
||||||
Claims = new List<Claim>
|
Claims = new List<Claim>
|
||||||
{
|
{
|
||||||
new Claim("CustomerId", "123"),
|
new Claim("CustomerId", "123"),
|
||||||
|
@ -5,7 +5,6 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Services.InMemory;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@ -17,6 +16,9 @@ using Xunit;
|
|||||||
[assembly: CollectionBehavior(DisableTestParallelization = true)]
|
[assembly: CollectionBehavior(DisableTestParallelization = true)]
|
||||||
namespace Ocelot.AcceptanceTests
|
namespace Ocelot.AcceptanceTests
|
||||||
{
|
{
|
||||||
|
using IdentityServer4;
|
||||||
|
using IdentityServer4.Test;
|
||||||
|
|
||||||
public class ClaimsToHeadersForwardingTests : IDisposable
|
public class ClaimsToHeadersForwardingTests : IDisposable
|
||||||
{
|
{
|
||||||
private IWebHost _servicebuilder;
|
private IWebHost _servicebuilder;
|
||||||
@ -31,12 +33,11 @@ namespace Ocelot.AcceptanceTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_response_200_and_foward_claim_as_header()
|
public void should_return_response_200_and_foward_claim_as_header()
|
||||||
{
|
{
|
||||||
var user = new InMemoryUser
|
var user = new TestUser()
|
||||||
{
|
{
|
||||||
Username = "test",
|
Username = "test",
|
||||||
Password = "test",
|
Password = "test",
|
||||||
Enabled = true,
|
SubjectId = "registered|1231231",
|
||||||
Subject = "registered|1231231",
|
|
||||||
Claims = new List<Claim>
|
Claims = new List<Claim>
|
||||||
{
|
{
|
||||||
new Claim("CustomerId", "123"),
|
new Claim("CustomerId", "123"),
|
||||||
@ -115,7 +116,7 @@ namespace Ocelot.AcceptanceTests
|
|||||||
_servicebuilder.Start();
|
_servicebuilder.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GivenThereIsAnIdentityServerOn(string url, string scopeName, AccessTokenType tokenType, InMemoryUser user)
|
private void GivenThereIsAnIdentityServerOn(string url, string scopeName, AccessTokenType tokenType, TestUser user)
|
||||||
{
|
{
|
||||||
_identityServerBuilder = new WebHostBuilder()
|
_identityServerBuilder = new WebHostBuilder()
|
||||||
.UseUrls(url)
|
.UseUrls(url)
|
||||||
@ -126,27 +127,34 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
services.AddLogging();
|
services.AddLogging();
|
||||||
services.AddDeveloperIdentityServer()
|
services.AddIdentityServer()
|
||||||
.AddInMemoryScopes(new List<Scope>
|
.AddTemporarySigningCredential()
|
||||||
|
.AddInMemoryApiResources(new List<ApiResource>
|
||||||
{
|
{
|
||||||
new Scope
|
new ApiResource
|
||||||
{
|
{
|
||||||
Name = scopeName,
|
Name = scopeName,
|
||||||
Description = "My API",
|
Description = "My API",
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
AllowUnrestrictedIntrospection = true,
|
DisplayName = "test",
|
||||||
ScopeSecrets = new List<Secret>()
|
Scopes = new List<Scope>()
|
||||||
|
{
|
||||||
|
new Scope("api"),
|
||||||
|
new Scope("openid"),
|
||||||
|
new Scope("offline_access")
|
||||||
|
},
|
||||||
|
ApiSecrets = new List<Secret>()
|
||||||
{
|
{
|
||||||
new Secret
|
new Secret
|
||||||
{
|
{
|
||||||
Value = "secret".Sha256()
|
Value = "secret".Sha256()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
IncludeAllClaimsForUser = true
|
UserClaims = new List<string>()
|
||||||
},
|
{
|
||||||
|
"CustomerId", "LocationId", "UserType", "UserId"
|
||||||
StandardScopes.OpenId,
|
}
|
||||||
StandardScopes.OfflineAccess
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryClients(new List<Client>
|
.AddInMemoryClients(new List<Client>
|
||||||
{
|
{
|
||||||
@ -161,7 +169,7 @@ namespace Ocelot.AcceptanceTests
|
|||||||
RequireClientSecret = false
|
RequireClientSecret = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryUsers(new List<InMemoryUser>
|
.AddTestUsers(new List<TestUser>
|
||||||
{
|
{
|
||||||
user
|
user
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,6 @@ using System.Linq;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using IdentityServer4.Models;
|
using IdentityServer4.Models;
|
||||||
using IdentityServer4.Services.InMemory;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
@ -17,6 +16,9 @@ using Xunit;
|
|||||||
|
|
||||||
namespace Ocelot.AcceptanceTests
|
namespace Ocelot.AcceptanceTests
|
||||||
{
|
{
|
||||||
|
using IdentityServer4;
|
||||||
|
using IdentityServer4.Test;
|
||||||
|
|
||||||
public class ClaimsToQueryStringForwardingTests : IDisposable
|
public class ClaimsToQueryStringForwardingTests : IDisposable
|
||||||
{
|
{
|
||||||
private IWebHost _servicebuilder;
|
private IWebHost _servicebuilder;
|
||||||
@ -31,12 +33,11 @@ namespace Ocelot.AcceptanceTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_response_200_and_foward_claim_as_query_string()
|
public void should_return_response_200_and_foward_claim_as_query_string()
|
||||||
{
|
{
|
||||||
var user = new InMemoryUser
|
var user = new TestUser()
|
||||||
{
|
{
|
||||||
Username = "test",
|
Username = "test",
|
||||||
Password = "test",
|
Password = "test",
|
||||||
Enabled = true,
|
SubjectId = "registered|1231231",
|
||||||
Subject = "registered|1231231",
|
|
||||||
Claims = new List<Claim>
|
Claims = new List<Claim>
|
||||||
{
|
{
|
||||||
new Claim("CustomerId", "123"),
|
new Claim("CustomerId", "123"),
|
||||||
@ -122,7 +123,7 @@ namespace Ocelot.AcceptanceTests
|
|||||||
_servicebuilder.Start();
|
_servicebuilder.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GivenThereIsAnIdentityServerOn(string url, string scopeName, AccessTokenType tokenType, InMemoryUser user)
|
private void GivenThereIsAnIdentityServerOn(string url, string scopeName, AccessTokenType tokenType, TestUser user)
|
||||||
{
|
{
|
||||||
_identityServerBuilder = new WebHostBuilder()
|
_identityServerBuilder = new WebHostBuilder()
|
||||||
.UseUrls(url)
|
.UseUrls(url)
|
||||||
@ -133,27 +134,34 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.ConfigureServices(services =>
|
.ConfigureServices(services =>
|
||||||
{
|
{
|
||||||
services.AddLogging();
|
services.AddLogging();
|
||||||
services.AddDeveloperIdentityServer()
|
services.AddIdentityServer()
|
||||||
.AddInMemoryScopes(new List<Scope>
|
.AddTemporarySigningCredential()
|
||||||
|
.AddInMemoryApiResources(new List<ApiResource>
|
||||||
{
|
{
|
||||||
new Scope
|
new ApiResource
|
||||||
{
|
{
|
||||||
Name = scopeName,
|
Name = scopeName,
|
||||||
Description = "My API",
|
Description = "My API",
|
||||||
Enabled = true,
|
Enabled = true,
|
||||||
AllowUnrestrictedIntrospection = true,
|
DisplayName = "test",
|
||||||
ScopeSecrets = new List<Secret>()
|
Scopes = new List<Scope>()
|
||||||
|
{
|
||||||
|
new Scope("api"),
|
||||||
|
new Scope("openid"),
|
||||||
|
new Scope("offline_access")
|
||||||
|
},
|
||||||
|
ApiSecrets = new List<Secret>()
|
||||||
{
|
{
|
||||||
new Secret
|
new Secret
|
||||||
{
|
{
|
||||||
Value = "secret".Sha256()
|
Value = "secret".Sha256()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
IncludeAllClaimsForUser = true
|
UserClaims = new List<string>()
|
||||||
},
|
{
|
||||||
|
"CustomerId", "LocationId", "UserType", "UserId"
|
||||||
StandardScopes.OpenId,
|
}
|
||||||
StandardScopes.OfflineAccess
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryClients(new List<Client>
|
.AddInMemoryClients(new List<Client>
|
||||||
{
|
{
|
||||||
@ -168,7 +176,7 @@ namespace Ocelot.AcceptanceTests
|
|||||||
RequireClientSecret = false
|
RequireClientSecret = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.AddInMemoryUsers(new List<InMemoryUser>
|
.AddTestUsers(new List<TestUser>
|
||||||
{
|
{
|
||||||
user
|
user
|
||||||
});
|
});
|
||||||
|
@ -132,8 +132,8 @@ namespace Ocelot.AcceptanceTests
|
|||||||
using (var httpClient = new HttpClient())
|
using (var httpClient = new HttpClient())
|
||||||
{
|
{
|
||||||
var response = httpClient.PostAsync(tokenUrl, content).Result;
|
var response = httpClient.PostAsync(tokenUrl, content).Result;
|
||||||
response.EnsureSuccessStatusCode();
|
|
||||||
var responseContent = response.Content.ReadAsStringAsync().Result;
|
var responseContent = response.Content.ReadAsStringAsync().Result;
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
_token = JsonConvert.DeserializeObject<BearerToken>(responseContent);
|
_token = JsonConvert.DeserializeObject<BearerToken>(responseContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
public static class TestConfiguration
|
public static class TestConfiguration
|
||||||
{
|
{
|
||||||
public static double Version => 1.4;
|
public static double Version => 1.4;
|
||||||
public static string ConfigurationPath => $"./bin/Debug/netcoreapp{Version}/configuration.json";
|
public static string ConfigurationPath => $"./bin/Debug/netcoreapp{Version}/win10-x64/configuration.json";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,31 +12,31 @@
|
|||||||
"testRunner": "xunit",
|
"testRunner": "xunit",
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
|
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
"Microsoft.Extensions.Configuration.Json": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0",
|
"Microsoft.Extensions.Logging": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
"Microsoft.Extensions.Logging.Console": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.1.0",
|
||||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Http": "1.0.0",
|
"Microsoft.AspNetCore.Http": "1.1.0",
|
||||||
|
"Microsoft.DotNet.InternalAbstractions": "1.0.0",
|
||||||
"Ocelot": "1.0.0-*",
|
"Ocelot": "1.0.0-*",
|
||||||
"xunit": "2.2.0-beta2-build3300",
|
"xunit": "2.2.0-beta2-build3300",
|
||||||
"dotnet-test-xunit": "2.2.0-preview2-build1029",
|
"dotnet-test-xunit": "2.2.0-preview2-build1029",
|
||||||
"Ocelot.ManualTest": "1.0.0-*",
|
"Ocelot.ManualTest": "1.0.0-*",
|
||||||
"Microsoft.AspNetCore.TestHost": "1.0.0",
|
"Microsoft.AspNetCore.TestHost": "1.1.0",
|
||||||
"IdentityServer4": "1.0.0-rc2",
|
"IdentityServer4": "1.0.1",
|
||||||
"Microsoft.AspNetCore.Mvc": "1.0.1",
|
"Microsoft.AspNetCore.Mvc": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": "1.1.0",
|
||||||
"version": "1.0.1",
|
|
||||||
"type": "platform"
|
|
||||||
},
|
|
||||||
"Shouldly": "2.8.2",
|
"Shouldly": "2.8.2",
|
||||||
"TestStack.BDDfy": "4.3.2"
|
"TestStack.BDDfy": "4.3.2"
|
||||||
},
|
},
|
||||||
|
"runtimes": {
|
||||||
|
"win10-x64": {}
|
||||||
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.4": {
|
"netcoreapp1.4": {
|
||||||
"imports": [
|
"imports": [
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
"emitEntryPoint": true
|
"emitEntryPoint": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NETCore.App": {
|
|
||||||
"type": "platform",
|
|
||||||
"version": "1.0.1"
|
|
||||||
},
|
|
||||||
"Ocelot": "1.0.0-*",
|
"Ocelot": "1.0.0-*",
|
||||||
"BenchmarkDotNet": "0.9.9"
|
"BenchmarkDotNet": "0.10.1"
|
||||||
|
},
|
||||||
|
"runtimes": {
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.4": {
|
"netcoreapp1.4": {
|
||||||
"imports": [
|
"imports": [
|
||||||
|
@ -2,28 +2,25 @@
|
|||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNetCore.Http": "1.0.0",
|
"Microsoft.AspNetCore.Http": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
|
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
|
"Microsoft.Extensions.Configuration.Json": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
"Microsoft.Extensions.Logging": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0",
|
"Microsoft.Extensions.Logging.Console": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
|
||||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
|
|
||||||
"Ocelot": "1.0.0-*",
|
"Ocelot": "1.0.0-*",
|
||||||
"Microsoft.AspNetCore.Mvc": "1.0.1",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
|
"Microsoft.NETCore.App": "1.1.0"
|
||||||
"Microsoft.NETCore.App": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"type": "platform"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"tools": {
|
"tools": {
|
||||||
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
|
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
|
||||||
},
|
},
|
||||||
|
"runtimes": {
|
||||||
|
"win10-x64": {}
|
||||||
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.4": {
|
"netcoreapp1.4": {
|
||||||
"imports": [
|
"imports": [
|
||||||
|
@ -4,30 +4,31 @@
|
|||||||
"testRunner": "xunit",
|
"testRunner": "xunit",
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
|
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
|
||||||
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
"Microsoft.Extensions.Configuration.Json": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging": "1.0.0",
|
"Microsoft.Extensions.Logging": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
"Microsoft.Extensions.Logging.Console": "1.1.0",
|
||||||
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
"Microsoft.Extensions.Logging.Debug": "1.1.0",
|
||||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Http": "1.0.0",
|
"Microsoft.AspNetCore.Http": "1.1.0",
|
||||||
"Ocelot": "1.0.0-*",
|
"Ocelot": "1.0.0-*",
|
||||||
"xunit": "2.2.0-beta2-build3300",
|
"xunit": "2.2.0-beta2-build3300",
|
||||||
"dotnet-test-xunit": "2.2.0-preview2-build1029",
|
"dotnet-test-xunit": "2.2.0-preview2-build1029",
|
||||||
"Moq": "4.6.38-alpha",
|
"Moq": "4.6.38-alpha",
|
||||||
"Microsoft.AspNetCore.TestHost": "1.0.0",
|
"Microsoft.AspNetCore.TestHost": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Mvc": "1.0.1",
|
"Microsoft.AspNetCore.Mvc": "1.1.0",
|
||||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
|
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": "1.1.0",
|
||||||
"version": "1.0.1",
|
|
||||||
"type": "platform"
|
|
||||||
},
|
|
||||||
"Shouldly": "2.8.2",
|
"Shouldly": "2.8.2",
|
||||||
"TestStack.BDDfy": "4.3.2"
|
"TestStack.BDDfy": "4.3.2",
|
||||||
|
"Microsoft.AspNetCore.Authentication.OAuth": "1.1.0",
|
||||||
|
"Microsoft.DotNet.InternalAbstractions": "1.0.0"
|
||||||
|
},
|
||||||
|
"runtimes": {
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.4": {
|
"netcoreapp1.4": {
|
||||||
"imports": [
|
"imports": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user