Skip to content

Allow upload and delete to /tmp #1544

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

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Allow upload and delete to /tmp #1544

merged 2 commits into from
Sep 19, 2024

Conversation

jmthomas
Copy link
Member

closes #1531

@jmthomas jmthomas requested a review from ryanmelt September 16, 2024 15:24
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 77.05%. Comparing base (b3866ee) to head (8e1464f).
Report is 59 commits behind head on main.

Files with missing lines Patch % Lines
...-cmd-tlm-api/app/controllers/storage_controller.rb 0.00% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1544      +/-   ##
==========================================
+ Coverage   75.32%   77.05%   +1.73%     
==========================================
  Files         609      611       +2     
  Lines       45922    45991      +69     
  Branches      799      799              
==========================================
+ Hits        34589    35440     +851     
+ Misses      11245    10463     -782     
  Partials       88       88              
Flag Coverage Δ
python 84.62% <ø> (+0.04%) ⬆️
ruby-api 48.89% <0.00%> (-0.11%) ⬇️
ruby-backend 82.81% <ø> (+3.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

return unless authorization('admin')
# Anywhere other than config/SCOPE/targets_modified or config/SCOPE/tmp requires admin
if !(params[:bucket] == 'OPENC3_CONFIG_BUCKET' && (key_split[1] == 'targets_modified' || key_split[1] == 'tmp'))
return false unless authorization('admin')
Copy link
Member

Choose a reason for hiding this comment

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

If return value matters then it should be explicit at the end of the method.

Copy link
Member Author

Choose a reason for hiding this comment

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

We're short cutting this method because we don't want to delete unless they are admin

@@ -208,7 +208,7 @@ def delete_bucket_item(params)

def delete_volume_item(params)
# Deleting requires admin
return unless authorization('admin')
return false unless authorization('admin')
Copy link
Member

Choose a reason for hiding this comment

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

If return value matters then it should be explicit at the end of the method.

Copy link

@jmthomas jmthomas merged commit 4a23448 into main Sep 19, 2024
26 of 27 checks passed
@jmthomas jmthomas deleted the storage branch September 19, 2024 00:13
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.

open_files_dialog as operator (Enterprise)
2 participants