mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:22:49 +08:00
seperate startups for tests...updated configuration.json for manual tests and tidied a few more things up
This commit is contained in:
parent
f4e8dcbdab
commit
163150a1d7
@ -19,7 +19,6 @@ using Newtonsoft.Json;
|
|||||||
using Ocelot.Configuration.File;
|
using Ocelot.Configuration.File;
|
||||||
using Ocelot.Configuration.Repository;
|
using Ocelot.Configuration.Repository;
|
||||||
using Ocelot.DependencyInjection;
|
using Ocelot.DependencyInjection;
|
||||||
using Ocelot.ManualTest;
|
|
||||||
using Ocelot.Middleware;
|
using Ocelot.Middleware;
|
||||||
using Ocelot.ServiceDiscovery;
|
using Ocelot.ServiceDiscovery;
|
||||||
using Shouldly;
|
using Shouldly;
|
||||||
@ -382,4 +381,42 @@ namespace Ocelot.AcceptanceTests
|
|||||||
_response.Headers.GetValues(RequestIdKey).First().ShouldBe(expected);
|
_response.Headers.GetValues(RequestIdKey).First().ShouldBe(expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public Startup(IHostingEnvironment env)
|
||||||
|
{
|
||||||
|
var builder = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(env.ContentRootPath)
|
||||||
|
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||||
|
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
|
||||||
|
.AddJsonFile("configuration.json")
|
||||||
|
.AddEnvironmentVariables();
|
||||||
|
|
||||||
|
Configuration = builder.Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IConfigurationRoot Configuration { get; }
|
||||||
|
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
Action<ConfigurationBuilderCachePart> settings = (x) =>
|
||||||
|
{
|
||||||
|
x.WithMicrosoftLogging(log =>
|
||||||
|
{
|
||||||
|
log.AddConsole(LogLevel.Debug);
|
||||||
|
})
|
||||||
|
.WithDictionaryHandle();
|
||||||
|
};
|
||||||
|
|
||||||
|
services.AddOcelot(Configuration, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||||
|
{
|
||||||
|
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||||
|
|
||||||
|
app.UseOcelot().Wait();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Ocelot.Cache;
|
using Ocelot.Cache;
|
||||||
using Ocelot.Configuration.File;
|
using Ocelot.Configuration.File;
|
||||||
using Ocelot.ManualTest;
|
|
||||||
using Shouldly;
|
using Shouldly;
|
||||||
using TestStack.BDDfy;
|
using TestStack.BDDfy;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
51
test/Ocelot.IntegrationTests/Startup.cs
Normal file
51
test/Ocelot.IntegrationTests/Startup.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
using System;
|
||||||
|
using CacheManager.Core;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Ocelot.DependencyInjection;
|
||||||
|
using Ocelot.Middleware;
|
||||||
|
using ConfigurationBuilder = Microsoft.Extensions.Configuration.ConfigurationBuilder;
|
||||||
|
|
||||||
|
namespace Ocelot.IntegrationTests
|
||||||
|
{
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public Startup(IHostingEnvironment env)
|
||||||
|
{
|
||||||
|
var builder = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(env.ContentRootPath)
|
||||||
|
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
||||||
|
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
|
||||||
|
.AddJsonFile("configuration.json")
|
||||||
|
.AddEnvironmentVariables();
|
||||||
|
|
||||||
|
Configuration = builder.Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IConfigurationRoot Configuration { get; }
|
||||||
|
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
Action<ConfigurationBuilderCachePart> settings = (x) =>
|
||||||
|
{
|
||||||
|
x.WithMicrosoftLogging(log =>
|
||||||
|
{
|
||||||
|
log.AddConsole(LogLevel.Debug);
|
||||||
|
})
|
||||||
|
.WithDictionaryHandle();
|
||||||
|
};
|
||||||
|
|
||||||
|
services.AddOcelot(Configuration, settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||||
|
{
|
||||||
|
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||||
|
|
||||||
|
app.UseOcelot().Wait();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Ocelot.Configuration.File;
|
using Ocelot.Configuration.File;
|
||||||
using Ocelot.ManualTest;
|
|
||||||
using Shouldly;
|
using Shouldly;
|
||||||
using TestStack.BDDfy;
|
using TestStack.BDDfy;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
@ -10,175 +10,362 @@
|
|||||||
"e8825dc3-4137-99a7-0000-ef5786610dc3",
|
"e8825dc3-4137-99a7-0000-ef5786610dc3",
|
||||||
"fddfc4fa-5114-69e3-4744-203ed71a526b",
|
"fddfc4fa-5114-69e3-4744-203ed71a526b",
|
||||||
"c45d30d7-d9c4-fa05-8110-d6e769bb6ff9",
|
"c45d30d7-d9c4-fa05-8110-d6e769bb6ff9",
|
||||||
"4684c2fa-f38c-c193-5f55-bf563a1978c6"
|
"4684c2fa-f38c-c193-5f55-bf563a1978c6",
|
||||||
|
"37bfa9f1-fe29-6a68-e558-66d125d2c96f",
|
||||||
|
"5f308240-79e3-cf74-7a6b-fe462f0d54f1",
|
||||||
|
"178f16da-c61b-c881-1c33-9d64a56851a4"
|
||||||
],
|
],
|
||||||
"folders": [],
|
"folders": [],
|
||||||
"timestamp": 1477767328599,
|
"folders_order": [],
|
||||||
|
"timestamp": 0,
|
||||||
"owner": "212120",
|
"owner": "212120",
|
||||||
"public": false,
|
"public": false,
|
||||||
"requests": [
|
"requests": [
|
||||||
{
|
{
|
||||||
|
"folder": null,
|
||||||
"id": "09af8dda-a9cb-20d2-5ee3-0a3023773a1a",
|
"id": "09af8dda-a9cb-20d2-5ee3-0a3023773a1a",
|
||||||
"headers": "",
|
|
||||||
"url": "http://localhost:5000/comments?postId=1",
|
|
||||||
"pathVariables": {},
|
|
||||||
"preRequestScript": null,
|
|
||||||
"method": "GET",
|
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
|
||||||
"data": null,
|
|
||||||
"dataMode": "params",
|
|
||||||
"name": "GET http://localhost:5000/comments?postId=1",
|
"name": "GET http://localhost:5000/comments?postId=1",
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768105592,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
|
||||||
"currentHelper": "normal",
|
|
||||||
"helperAttributes": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4684c2fa-f38c-c193-5f55-bf563a1978c6",
|
|
||||||
"headers": "",
|
|
||||||
"url": "http://localhost:5000/posts/1",
|
|
||||||
"pathVariables": {},
|
|
||||||
"preRequestScript": null,
|
|
||||||
"method": "DELETE",
|
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
|
||||||
"data": null,
|
|
||||||
"dataMode": "params",
|
"dataMode": "params",
|
||||||
"name": "DELETE http://localhost:5000/posts/1",
|
"data": null,
|
||||||
"description": "",
|
"rawModeData": null,
|
||||||
"descriptionFormat": "html",
|
"descriptionFormat": "html",
|
||||||
"time": 1477768404376,
|
"description": "",
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
|
||||||
"currentHelper": "normal",
|
|
||||||
"helperAttributes": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "a1c95935-ed18-d5dc-bcb8-a3db8ba1934f",
|
|
||||||
"headers": "",
|
"headers": "",
|
||||||
"url": "http://localhost:5000/posts",
|
|
||||||
"pathVariables": {},
|
|
||||||
"preRequestScript": null,
|
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
"pathVariables": {},
|
||||||
"data": null,
|
"url": "http://localhost:5000/comments?postId=1",
|
||||||
"dataMode": "params",
|
"preRequestScript": null,
|
||||||
"name": "GET http://localhost:5000/posts",
|
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768007806,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
"tests": null,
|
||||||
"currentHelper": "normal",
|
"currentHelper": "normal",
|
||||||
"helperAttributes": {}
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "c4494401-3985-a5bf-71fb-6e4171384ac6",
|
"id": "178f16da-c61b-c881-1c33-9d64a56851a4",
|
||||||
"headers": "",
|
"headers": "Authorization: Bearer {{AccessToken}}\n",
|
||||||
"url": "http://localhost:5000/posts/1/comments",
|
"headerData": [
|
||||||
"pathVariables": {},
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "Bearer {{AccessToken}}",
|
||||||
|
"enabled": true,
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": "http://localhost:5000/administration/configuration",
|
||||||
|
"folder": null,
|
||||||
|
"queryParams": [],
|
||||||
"preRequestScript": null,
|
"preRequestScript": null,
|
||||||
|
"pathVariables": {},
|
||||||
|
"pathVariableData": [],
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
|
||||||
"data": null,
|
"data": null,
|
||||||
"dataMode": "params",
|
"dataMode": "params",
|
||||||
"name": "GET http://localhost:5000/posts/1/comments",
|
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768043524,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
"tests": null,
|
||||||
"currentHelper": "normal",
|
"currentHelper": "normal",
|
||||||
"helperAttributes": {}
|
"helperAttributes": "{}",
|
||||||
},
|
"time": 1508849878025,
|
||||||
{
|
"name": "GET http://localhost:5000/admin/configuration",
|
||||||
"id": "c45d30d7-d9c4-fa05-8110-d6e769bb6ff9",
|
"description": "",
|
||||||
"headers": "",
|
|
||||||
"url": "http://localhost:5000/posts/1",
|
|
||||||
"pathVariables": {},
|
|
||||||
"preRequestScript": null,
|
|
||||||
"method": "PATCH",
|
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
||||||
"data": [],
|
|
||||||
"dataMode": "raw",
|
|
||||||
"name": "PATCH http://localhost:5000/posts/1",
|
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768379775,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
"responses": [],
|
||||||
"tests": null,
|
"isFromCollection": true,
|
||||||
"currentHelper": "normal",
|
"collectionRequestId": "178f16da-c61b-c881-1c33-9d64a56851a4",
|
||||||
"helperAttributes": {},
|
"rawModeData": null,
|
||||||
"rawModeData": "{\n \"title\": \"gfdgsgsdgsdfgsdfgdfg\",\n}"
|
"descriptionFormat": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "e8825dc3-4137-99a7-0000-ef5786610dc3",
|
"id": "37bfa9f1-fe29-6a68-e558-66d125d2c96f",
|
||||||
"headers": "",
|
"headers": "",
|
||||||
"url": "http://localhost:5000/posts",
|
"headerData": [],
|
||||||
"pathVariables": {},
|
"url": "http://localhost:5000/administration/connect/token",
|
||||||
|
"folder": null,
|
||||||
|
"queryParams": [],
|
||||||
"preRequestScript": null,
|
"preRequestScript": null,
|
||||||
|
"pathVariables": {},
|
||||||
|
"pathVariableData": [],
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
"data": [
|
||||||
"data": [],
|
{
|
||||||
"dataMode": "raw",
|
"key": "client_id",
|
||||||
"name": "POST http://localhost:5000/posts/1",
|
"value": "admin",
|
||||||
"description": "",
|
"type": "text",
|
||||||
"descriptionFormat": "html",
|
"enabled": true
|
||||||
"time": 1477768186023,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
|
||||||
"currentHelper": "normal",
|
|
||||||
"helperAttributes": {},
|
|
||||||
"rawModeData": "{\n \"userId\": 1,\n \"title\": \"test\",\n \"body\": \"test\"\n}"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ea0ed57a-2cb9-8acc-47dd-006b8db2f1b2",
|
"key": "client_secret",
|
||||||
"headers": "",
|
"value": "secret",
|
||||||
"url": "http://localhost:5000/posts/1",
|
"type": "text",
|
||||||
"pathVariables": {},
|
"enabled": true
|
||||||
"preRequestScript": null,
|
},
|
||||||
"method": "GET",
|
{
|
||||||
|
"key": "scope",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "username",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "password",
|
||||||
|
"value": "secret",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "grant_type",
|
||||||
|
"value": "password",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dataMode": "params",
|
||||||
|
"tests": "var jsonData = JSON.parse(responseBody);\npostman.setGlobalVariable(\"AccessToken\", jsonData.access_token);\npostman.setGlobalVariable(\"RefreshToken\", jsonData.refresh_token);",
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"time": 1506359585080,
|
||||||
|
"name": "POST http://localhost:5000/admin/connect/token copy",
|
||||||
|
"description": "",
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
||||||
|
"responses": [],
|
||||||
|
"isFromCollection": true,
|
||||||
|
"collectionRequestId": "37bfa9f1-fe29-6a68-e558-66d125d2c96f",
|
||||||
|
"rawModeData": null,
|
||||||
|
"descriptionFormat": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "4684c2fa-f38c-c193-5f55-bf563a1978c6",
|
||||||
|
"name": "DELETE http://localhost:5000/posts/1",
|
||||||
|
"dataMode": "params",
|
||||||
|
"data": null,
|
||||||
|
"rawModeData": null,
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "DELETE",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts/1",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5f308240-79e3-cf74-7a6b-fe462f0d54f1",
|
||||||
|
"headers": "Authorization: Bearer {{AccessToken}}\n",
|
||||||
|
"headerData": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "Bearer {{AccessToken}}",
|
||||||
|
"description": "",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": "http://localhost:5000/administration/.well-known/openid-configuration",
|
||||||
|
"folder": null,
|
||||||
|
"queryParams": [],
|
||||||
|
"preRequestScript": null,
|
||||||
|
"pathVariables": {},
|
||||||
|
"pathVariableData": [],
|
||||||
|
"method": "GET",
|
||||||
"data": null,
|
"data": null,
|
||||||
"dataMode": "params",
|
"dataMode": "params",
|
||||||
"name": "GET http://localhost:5000/posts/1",
|
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768023989,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
|
||||||
"currentHelper": "normal",
|
|
||||||
"helperAttributes": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "fddfc4fa-5114-69e3-4744-203ed71a526b",
|
|
||||||
"headers": "",
|
|
||||||
"url": "http://localhost:5000/posts/1",
|
|
||||||
"pathVariables": {},
|
|
||||||
"preRequestScript": null,
|
|
||||||
"method": "PUT",
|
|
||||||
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
|
||||||
"data": [],
|
|
||||||
"dataMode": "raw",
|
|
||||||
"name": "PUT http://localhost:5000/posts/1",
|
|
||||||
"description": "",
|
|
||||||
"descriptionFormat": "html",
|
|
||||||
"time": 1477768307036,
|
|
||||||
"version": 2,
|
|
||||||
"responses": [],
|
|
||||||
"tests": null,
|
"tests": null,
|
||||||
"currentHelper": "normal",
|
"currentHelper": "normal",
|
||||||
"helperAttributes": {},
|
"helperAttributes": {},
|
||||||
"rawModeData": "{\n \"userId\": 1,\n \"title\": \"test\",\n \"body\": \"test\"\n}"
|
"time": 1508849923518,
|
||||||
|
"name": "GET http://localhost:5000/admin/.well-known/openid-configuration",
|
||||||
|
"description": "",
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375",
|
||||||
|
"responses": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "a1c95935-ed18-d5dc-bcb8-a3db8ba1934f",
|
||||||
|
"name": "GET http://localhost:5000/posts",
|
||||||
|
"dataMode": "params",
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"key": "client_id",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "client_secret",
|
||||||
|
"value": "secret",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "scope",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "username",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "password",
|
||||||
|
"value": "admin",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "grant_type",
|
||||||
|
"value": "password",
|
||||||
|
"type": "text",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rawModeData": null,
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "POST",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/admin/configuration",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "c4494401-3985-a5bf-71fb-6e4171384ac6",
|
||||||
|
"name": "GET http://localhost:5000/posts/1/comments",
|
||||||
|
"dataMode": "params",
|
||||||
|
"data": null,
|
||||||
|
"rawModeData": null,
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "GET",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts/1/comments",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "c45d30d7-d9c4-fa05-8110-d6e769bb6ff9",
|
||||||
|
"name": "PATCH http://localhost:5000/posts/1",
|
||||||
|
"dataMode": "raw",
|
||||||
|
"data": [],
|
||||||
|
"rawModeData": "{\n \"title\": \"gfdgsgsdgsdfgsdfgdfg\",\n}",
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "PATCH",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts/1",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "e8825dc3-4137-99a7-0000-ef5786610dc3",
|
||||||
|
"name": "POST http://localhost:5000/posts/1",
|
||||||
|
"dataMode": "raw",
|
||||||
|
"data": [],
|
||||||
|
"rawModeData": "{\n \"userId\": 1,\n \"title\": \"test\",\n \"body\": \"test\"\n}",
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "POST",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "ea0ed57a-2cb9-8acc-47dd-006b8db2f1b2",
|
||||||
|
"name": "GET http://localhost:5000/posts/1",
|
||||||
|
"dataMode": "params",
|
||||||
|
"data": null,
|
||||||
|
"rawModeData": null,
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "GET",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts/1",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folder": null,
|
||||||
|
"id": "fddfc4fa-5114-69e3-4744-203ed71a526b",
|
||||||
|
"name": "PUT http://localhost:5000/posts/1",
|
||||||
|
"dataMode": "raw",
|
||||||
|
"data": [],
|
||||||
|
"rawModeData": "{\n \"userId\": 1,\n \"title\": \"test\",\n \"body\": \"test\"\n}",
|
||||||
|
"descriptionFormat": "html",
|
||||||
|
"description": "",
|
||||||
|
"headers": "",
|
||||||
|
"method": "PUT",
|
||||||
|
"pathVariables": {},
|
||||||
|
"url": "http://localhost:5000/posts/1",
|
||||||
|
"preRequestScript": null,
|
||||||
|
"tests": null,
|
||||||
|
"currentHelper": "normal",
|
||||||
|
"helperAttributes": "{}",
|
||||||
|
"queryParams": [],
|
||||||
|
"headerData": [],
|
||||||
|
"pathVariableData": [],
|
||||||
|
"responses": [],
|
||||||
|
"collectionId": "4dbde9fe-89f5-be35-bb9f-d3b438e16375"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -33,11 +33,18 @@ namespace Ocelot.ManualTest
|
|||||||
{
|
{
|
||||||
x.WithMicrosoftLogging(log =>
|
x.WithMicrosoftLogging(log =>
|
||||||
{
|
{
|
||||||
//log.AddConsole(LogLevel.Debug);
|
log.AddConsole(LogLevel.Debug);
|
||||||
})
|
})
|
||||||
.WithDictionaryHandle();
|
.WithDictionaryHandle();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.AddAuthentication()
|
||||||
|
.AddJwtBearer("TestKey", x =>
|
||||||
|
{
|
||||||
|
x.Authority = "test";
|
||||||
|
x.Audience = "test";
|
||||||
|
});
|
||||||
|
|
||||||
services.AddOcelot(Configuration, settings);
|
services.AddOcelot(Configuration, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,17 +13,11 @@
|
|||||||
"TimeoutValue": 5000
|
"TimeoutValue": 5000
|
||||||
},
|
},
|
||||||
"AuthenticationOptions": {
|
"AuthenticationOptions": {
|
||||||
"Provider": "IdentityServer",
|
"AuthenticationProviderKey": "TestKey",
|
||||||
"AllowedScopes": [
|
"AllowedScopes": [
|
||||||
"openid",
|
"openid",
|
||||||
"offline_access"
|
"offline_access"
|
||||||
],
|
]
|
||||||
"IdentityServerConfig": {
|
|
||||||
"ProviderRootUrl": "http://localhost:52888",
|
|
||||||
"ApiName": "api",
|
|
||||||
"ApiSecret": "secret",
|
|
||||||
"RequireHttps": false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"AddHeadersToRequest": {
|
"AddHeadersToRequest": {
|
||||||
"CustomerId": "Claims[CustomerId] > value",
|
"CustomerId": "Claims[CustomerId] > value",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user