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

feat(operation/getSecurityWithTypes): expose required scopes #893

Merged
merged 5 commits into from
Aug 30, 2024

Conversation

kanadgupta
Copy link
Member

🧰 Changes

In our operation.getSecurityWithTypes() method, this adds/documents a new property called _requirements that contains the required scopes for the operation + security scheme1.

I also exported our SecurityType type and added a JSDoc for it.

🧬 QA & Testing

Should be a minor additive change. Do tests/snapshots pass?

Footnotes

  1. read more about the security requirement object here

@kanadgupta kanadgupta added the enhancement New feature or request label Aug 30, 2024
Comment on lines -255 to +256
const exists = prev[security.type].findIndex(sec => sec._key === security.security._key);
if (exists < 0) {
const exists = prev[security.type].some(sec => sec._key === security.security._key);
if (!exists) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just moves us from Array.findIndex to Array.some for readability purposes

@erunion erunion merged commit 8a57af9 into main Aug 30, 2024
7 checks passed
@erunion erunion deleted the kanad-2024-08-30/include-security-requirements branch August 30, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants