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

Mrc-5365 - Enable auth for packet read lists #89

Merged
merged 13 commits into from
Jun 18, 2024

Conversation

absternator
Copy link
Contributor

@absternator absternator commented Jun 12, 2024

This ticket is focused on enabling auth for packet lists + some other updates. Below is the work done

  • update packet permission scope to add name and for update permission for packet scope filter by name & id
  • Filter out lists to ensure users only see what they are allowed. These rules are in AuthorizationLogic.kt and the filtering annotation is in PacketRepository.kt and PacketGroupRepository.kt
  • As per Mrc 5373- update permissions #87 comment.. have moved /packetGroup endpoint in PacketController to its own PacketGroupController and Service

Testing Urls:

  1. http://localhost:3000/
  2. http://localhost:3000/parameters/
  3. http://localhost:3000/parameters/20231205-073715-6635e044/

Test cases :

  1. First URL, only be able to see packet groups user has permission to see... (if has packetGroup name or packet with that name) or see all if packet.read
  2. Second Url try give packetGroup:parameters permission.. Should see all parameters... Then try just parameters:20231205-073715-6635e044, then will only be able to see that packet in the list
  3. When editing permissions ensure same rules apply as above when adding scoped permission (lists for packet and packet group)

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.97%. Comparing base (fb037cc) to head (ed58897).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           mrc-5373-update-permissions      #89      +/-   ##
===============================================================
+ Coverage                        95.95%   95.97%   +0.01%     
===============================================================
  Files                              105      106       +1     
  Lines                              964      968       +4     
  Branches                           248      248              
===============================================================
+ Hits                               925      929       +4     
  Misses                              38       38              
  Partials                             1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@absternator absternator changed the title feat: get list work working Mrc-5365 - Enable auth for packet read lists Jun 13, 2024
@EmmaLRussell EmmaLRussell self-requested a review June 14, 2024 08:57
Base automatically changed from mrc-5364-global-single-auth to mrc-5373-update-permissions June 17, 2024 06:56
Copy link
Contributor

@M-Kusumgar M-Kusumgar left a comment

Choose a reason for hiding this comment

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

LGTM, just noting a discussion had in person, used can call their packet groups whatever they want and this can mess up the urls (e.g. if they include a ; in their packet group names) so we should use unicode like google does for search results to avoid this problem

@absternator absternator merged commit ac8d381 into mrc-5373-update-permissions Jun 18, 2024
5 checks passed
@absternator absternator deleted the mrc-5365-auth-lists-enable branch June 18, 2024 06:27
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.

2 participants