openwhisk-apigateway
openwhisk-apigateway copied to clipboard
Security block has to be repeated on api and tenant scope
the existing api object looks like this when you have security scoped to a tenant
{
"name":"test",
"tenantId":"something-something-something",
"basePath":"/v1"
"resources": {
"/test": {
"operations":{
"GET": {
"upstreamUrl":"http://test.com/entity",
"upstreamMethod":"GET",
"security":{
"type":"oauth",
"provider":"google",
"scope":"api"
}
},
"POST": {
"upstreamUrl":"http://test.com/entity",
"upstreamMethod":"GET",
"security":{
"type":"oauth",
"provider":"google",
"scope":"api"
}
}
}
}
}
}
it should look like this:
{
"name":"test",
"tenantId":"something-something-something",
"basePath":"/v1",
"resources":{
"/test": {
"operations":{
"GET": {
"upstreamUrl":"http://test.com/entity",
"upstreamMethod":"GET",
},
"POST": {
"upstreamUrl":"http://test.com/entity",
"upstreamMethod":"GET",
}
}
}
},
"security":{
"type":"oauth",
"provider":"google"
}
}
Additionally,
{
"managedUrl": "http://0.0.0.0:8080/api/8e7315c3-bf66-4ec3-9157-c725f1c572d8/v2",
"tenantId": "8e7315c3-bf66-4ec3-9157-c725f1c572d8",
"id": "8ecf6f30-709f-49a7-8901-46eed0cfeb45",
"basePath": "/v2",
"name": "test",
"resources": {
"/die": {
"operations": {
"GET": {
"backendUrl": "https://apim-banka.mybluemix.net/banka/v1/branches",
"security": {
"type": "apikey",
"secret": "true",
"scope": "resource"
},
"backendMethod": "GET"
}
}
}
}
}
should probably be
{
"managedUrl": "http://0.0.0.0:8080/api/8e7315c3-bf66-4ec3-9157-c725f1c572d8/v2",
"tenantId": "8e7315c3-bf66-4ec3-9157-c725f1c572d8",
"id": "8ecf6f30-709f-49a7-8901-46eed0cfeb45",
"basePath": "/v2",
"name": "test",
"resources": {
"/die": {
"operations": {
"GET": {
"backendUrl": "https://apim-banka.mybluemix.net/banka/v1/branches",
"backendMethod": "GET"
}
},
"security": {
"type": "apikey",
"secret": "true",
}
}
}
}