danielgolub / danielgolub/openapi-middleware

feat: add cookie support for authentication

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
enhancement parity-gap
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
when securityScheme is the following:
```yaml
securitySchemes:
basicAuth:
type: 'apiKey'
in: 'cookie'
name: 'cookieParam'
```

we throw an exception. need to add cookie support here including tests.

**Describe the solution you'd like**
Follow official spec: https://swagger.io/docs/specification/authentication/

Add it to the enum here:
https://github.com/danielgolub/openapi-middleware/blob/091db91ff484b37fcbf4937fa421c69ace448d78/lib/SecurityValidator.js#L61-L66

And also add respective test case here (another param for cookie):
https://github.com/danielgolub/openapi-middleware/blob/091db91ff484b37fcbf4937fa421c69ace448d78/tests/unit/SecurityValidator.spec.js#L127

**Describe alternatives you've considered**
N/A

**Additional context**
N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.