chore: add e2e tests for security propagation during join#2827
chore: add e2e tests for security propagation during join#2827Daryna-del wants to merge 16 commits into
Conversation
🦋 Changeset detectedLatest commit: 4b8bca5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Coverage Report
File CoverageNo changed files found. |
|
@cursor review |
|
@cursor review |
|
@cursor review |
5bc9605 to
ecc35f1
Compare
tatomyr
left a comment
There was a problem hiding this comment.
Please also address the bugbot comments.
| } from '../../utils/miscellaneous.js'; | ||
| import type { CommandArgs } from '../../wrapper.js'; | ||
| import { COMPONENTS } from '../split/constants.js'; | ||
| // import { COMPONENTS } from '../split/constants.js'; |
| }, | ||
| }); | ||
| } | ||
| if (!security && openapi.hasOwnProperty('security')) { |
There was a problem hiding this comment.
Why the previous solution was not working? I see it refers to the root security already.
There was a problem hiding this comment.
Yeah, good point. Previous solution was working for each case, except when we have paths: {} and security on root level. Simplified the solution to cover this case, please, review one more time.
11a4935 to
09e577e
Compare
| 200: | ||
| description: OK | ||
| 400: | ||
| description: Bad request No newline at end of file |
There was a problem hiding this comment.
| description: Bad request | |
| description: Bad request | |
Let's add a newline on file endings.
There was a problem hiding this comment.
Added to each file
| info: | ||
| title: "spec1" | ||
| version: 1.0.0 | ||
| servers: |
There was a problem hiding this comment.
Let's add only essential fields and remove others.
| servers: | ||
| - url: https://api.example.com | ||
| paths: | ||
| /post: |
There was a problem hiding this comment.
It's bad practice to use verbs in paths (especially mixing post and get), so I'm against using it in our examples.
| description: Bad request | ||
| tags: | ||
| - bar_other | ||
| security: |
There was a problem hiding this comment.
If I'm getting it correctly, this path comes from an API description that doesn't have security defined on it; so how it got the security requirement from another description?
There was a problem hiding this comment.
Yes, you are right, updated tests
| authorizationUrl: https://example.com/oauth/authorize | ||
| tokenUrl: https://example.com/oauth/token | ||
| scopes: {} | ||
| oauth1: |
There was a problem hiding this comment.
These names are hard to follow. Please use something more meaningful.
b887c33 to
1ecab94
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ab620eb. Configure here.
bb740f3 to
046d4d0
Compare
c4ad9b7 to
4b8bca5
Compare

What/Why/How?
Added e2e tests for security propagation during join
Reference
#1409
Testing
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Join output affects how merged OpenAPI describes authentication; wrong propagation could misstate required security, though this PR is primarily tests and a changeset note.
Overview
Documents a patch for
@redocly/cliwherejoincopies each source API’s rootsecurityonto operations that omit their ownsecurity, instead of dropping that inheritance when merging specs.Adds two e2e scenarios under
tests/e2e/join/:root-security-in-both-specs(Foooauth2and BarbearerAuthat the root; joined output expects per-operationsecurityongetProductsandgetPets) androot-security-without-paths(one input has rootsecuritybut emptypaths; snapshot locks join behavior for the other file’s operations). Both are wired into the existing snapshot-basedjointest matrix.Reviewed by Cursor Bugbot for commit 4b8bca5. Bugbot is set up for automated code reviews on this repo. Configure here.