mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-24 05:52:49 +08:00
151 lines
6.1 KiB
JSON
151 lines
6.1 KiB
JSON
{
|
|
"ReRoutes": [
|
|
{
|
|
"DownstreamTemplate": "http://localhost:52876/",
|
|
"UpstreamTemplate": "/identityserverexample",
|
|
"UpstreamHttpMethod": "Get",
|
|
"AuthenticationOptions": {
|
|
"Provider": "IdentityServer",
|
|
"ProviderRootUrl": "http://localhost:52888",
|
|
"ScopeName": "api",
|
|
"AdditionalScopes": [
|
|
"openid",
|
|
"offline_access"
|
|
],
|
|
"ScopeSecret": "secret"
|
|
},
|
|
"AddHeadersToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddClaimsToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddQueriesToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"RouteClaimsRequirement": {
|
|
"UserType": "registered"
|
|
},
|
|
"RequestIdKey": "OcRequestId"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts",
|
|
"UpstreamTemplate": "/posts",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts/{postId}",
|
|
"UpstreamTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": "Get"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts/{postId}/comments",
|
|
"UpstreamTemplate": "/posts/{postId}/comments",
|
|
"UpstreamHttpMethod": "Get"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/comments",
|
|
"UpstreamTemplate": "/comments",
|
|
"UpstreamHttpMethod": "Get"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts",
|
|
"UpstreamTemplate": "/posts",
|
|
"UpstreamHttpMethod": "Post"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts/{postId}",
|
|
"UpstreamTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": "Put"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts/{postId}",
|
|
"UpstreamTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": "Patch"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts/{postId}",
|
|
"UpstreamTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": "Delete"
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://products20161126090340.azurewebsites.net/api/products",
|
|
"UpstreamTemplate": "/products",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://products20161126090340.azurewebsites.net/api/products/{productId}",
|
|
"UpstreamTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://products20161126090340.azurewebsites.net/api/products",
|
|
"UpstreamTemplate": "/products",
|
|
"UpstreamHttpMethod": "Post",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://products20161126090340.azurewebsites.net/api/products/{productId}",
|
|
"UpstreamTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": "Put",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://products20161126090340.azurewebsites.net/api/products/{productId}",
|
|
"UpstreamTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": "Delete",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://customers20161126090811.azurewebsites.net/api/customers",
|
|
"UpstreamTemplate": "/customers",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://customers20161126090811.azurewebsites.net/api/customers/{customerId}",
|
|
"UpstreamTemplate": "/customers/{customerId}",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://customers20161126090811.azurewebsites.net/api/customers",
|
|
"UpstreamTemplate": "/customers",
|
|
"UpstreamHttpMethod": "Post",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://customers20161126090811.azurewebsites.net/api/customers/{customerId}",
|
|
"UpstreamTemplate": "/customers/{customerId}",
|
|
"UpstreamHttpMethod": "Put",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://customers20161126090811.azurewebsites.net/api/customers/{customerId}",
|
|
"UpstreamTemplate": "/customers/{customerId}",
|
|
"UpstreamHttpMethod": "Delete",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamTemplate": "http://jsonplaceholder.typicode.com/posts",
|
|
"UpstreamTemplate": "/posts/",
|
|
"UpstreamHttpMethod": "Get",
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
}
|
|
],
|
|
"GlobalConfiguration": {
|
|
"RequestIdKey": "OcRequestId"
|
|
}
|
|
} |