Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there syntax for an AND between multiple API keys? #1692

Closed
bsamek opened this issue Oct 27, 2023 · 2 comments
Closed

Is there syntax for an AND between multiple API keys? #1692

bsamek opened this issue Oct 27, 2023 · 2 comments

Comments

@bsamek
Copy link

bsamek commented Oct 27, 2023

https://swagger.io/docs/specification/2-0/authentication/api-keys/ describes a situation for a "Pair of API Keys". Assuming I have a definition like this

//	@securitydefinitions.apikey	apiuser
//	@in				header
//	@name				Api-User
//
//	@securitydefinitions.apikey	apikey
//	@in				header
//	@name				Api-Key

I haven't been able to figure out how to require both.

This syntax yields an OR, not an AND, as I would expect from the docs.

// @Securiy	apiuser
// @Security	apikey

Is there a way to require the pair?

@kkkiio
Copy link
Contributor

kkkiio commented Oct 31, 2023

Use

// @Securiy	apiuser || apikey

Or vote for #1659

@bsamek
Copy link
Author

bsamek commented Nov 1, 2023

Thanks! I used that syntax successfully. Is it possible to vote for a PR? I don't see how to do that.

@bsamek bsamek closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants