-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I'm trying to connect to some server-side code generated from SwaggerHub, using swagger v2.0 syntax. While the server code seems to work fine, the client node only receives 403 denied responses, since the client never sends the X-API-Key in the request header. I believe this is a bug in this code that I just commented on (the scheme object has undefined "keyname" and "passAs" properties).
switch(scheme.type) {
case 'apiKey':
node.swaggerClient.clientAuthorizations.add(scheme.name,
new SwaggerClient.ApiKeyAuthorization(scheme.keyname, password, scheme.passAs));
break;
The relevant securityDefinitions section of the swagger.json file looks like this:
"securityDefinitions" : {
"BasicAuth" : {
"type" : "basic"
},
"ApiKeyAuth" : {
"type" : "apiKey",
"name" : "X-API-Key",
"in" : "header"
},
},
Since every endpoint is using the same security key, the global security object is defined as:
"security" : [ {
"ApiKeyAuth" : [ ]
} ],
Please let me know what is missing -- or how I can debug this missing header key!
__
Steve
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels