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

Fix 10221 403 error; Unauthorized studies are displayed as authorized #10241

Closed

Conversation

jagnathan
Copy link
Collaborator

Fix #10221 Unauthorized studies are displayed as authorized due to issue with using RequestParam

Fix 10221  Unauthorized studies are displayed as authorized due to issue with using RequestParam

adding @RequestParam causes error HTTP 400 error as by default required = true, if set to required = false causes unauthorized studies to be shown as authorized

Swagger validation errors fixed via commit a57c489
caused this issue.
@jagnathan jagnathan marked this pull request as draft June 28, 2023 13:11
@BasLee BasLee force-pushed the fix10221-403-authorized-studies branch from d5c78e0 to 7638a27 Compare June 29, 2023 14:09
@BasLee BasLee requested a review from dippindots June 29, 2023 14:54
@RequestParam(required = false) Authentication authentication) {
@RequestParam(defaultValue = "ASC") Direction direction
) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
Copy link

@BasLee BasLee Jul 3, 2023

Choose a reason for hiding this comment

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

Problem:

  • The authentication param without annotations generates faulty/messy Swagger documentation
  • The authentication param with annotations results in all studies being marked with readPermission=true

Maybe better to remove the authentication parameter and instead fetch it from the security context?
@dippindots @JREastonMarks

Copy link
Member

Choose a reason for hiding this comment

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

This looks ok to me, @jagnathan is there any potential issue if we merge this pr as is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dippindots in the file org/mskcc/cbio/portal/util/internal/AccessControlImpl.java, there is some more complex logic for getting the authentication object. Do we need to follow that logic?

pvannierop and others added 12 commits July 5, 2023 14:17
- Rename StructVar* to StructuralVariant*
- Revert JsonInclude Always to NON_NULL
-
…yfilter

RFC68: Impl. structural variant filtering in Study View filter
…control

modify documentation for skin.hide_download_controls
authentication object validity check - only if user authorization is enabled, authentication object is obtained from SecurityContextHolder
Fix 10221  Unauthorized studies are displayed as authorized due to issue with using RequestParam

adding @RequestParam causes error HTTP 400 error as by default required = true, if set to required = false causes unauthorized studies to be shown as authorized

Swagger validation errors fixed via commit a57c489
caused this issue.
authentication object validity check - only if user authorization is enabled, authentication object is obtained from SecurityContextHolder
@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@jagnathan
Copy link
Collaborator Author

opened a new PR #10267 to replace this PR.

@jagnathan jagnathan closed this Jul 11, 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

Successfully merging this pull request may close these issues.

403 on tags/fetch when show_unauthorized_studies=true
7 participants