on my swagger file I'm using securityDefinitions and security in paths using type basic.
I'm not quite sure how to configure security js files to be able to communicate with requests which are looking this security
ie.
in my swagger file
securityDefinitions:
test:
type: basic
[...]
paths:
/ping:
get:
x-method-name: ping
description:
Return an OK status if it is available.t
security:
- test: []
produces:
- application/json
responses:
'200':
description:
The response was succesfully processed
'401':
description: The user is not authorized to make this request
'500':
description: An internal error has occurred
how should security/test.js file looks like
module.exports = function authorize(req, res, next) {
//The context('this') for authorize will be bound to the 'securityDefinition'
//Perform auth here
next();
};
when I'm hitting /sample-path which has security 'basic' on get I'm receiving unauthorize. How I should configure authorize function in security js file to be able to retrieve correct response. Thanks for help
on my swagger file I'm using securityDefinitions and security in paths using type
basic
. I'm not quite sure how to configure security js files to be able to communicate with requests which are looking this securityie. in my swagger file
how should
security/test.js
file looks likewhen I'm hitting /sample-path which has security 'basic' on
get
I'm receivingunauthorize
. How I should configureauthorize
function in security js file to be able to retrieve correct response. Thanks for help