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 authorization check bug #5504

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Conversation

ndmlny-qs
Copy link
Contributor

This commit adds some extra logic, and error messages around user authentication with a user supplied authorize_callback method.

  • Adds more messaging around the RuntimeError when an error occurs during authorization checks.
  • Adds messaging to a user attempting access a path they do not have access to.
  • Adds logic to ensure if an authorize_callback has only 1 parameter, it does not cause a RuntimeError.

Resolves #5503

This commit adds some extra logic, and error messages around user
authentication with a user supplied `authorize_callback` method.

- Adds more messaging around the `RuntimeError` when an error occurs
  during authorization checks.
- Adds messaging to a user attempting access a path they do not have
  access to.
- Adds logic to ensure if an `authorize_callback` has only 1 parameter,
  it does not cause a `RuntimeError`.

Resolves holoviz#5503
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #5504 (d9a7f0d) into main (ff43d36) will decrease coverage by 0.86%.
The diff coverage is 10.00%.

@@            Coverage Diff             @@
##             main    #5504      +/-   ##
==========================================
- Coverage   83.55%   82.69%   -0.86%     
==========================================
  Files         276      276              
  Lines       40147    40152       +5     
==========================================
- Hits        33543    33205     -338     
- Misses       6604     6947     +343     
Flag Coverage Δ
ui-tests 39.47% <0.00%> (-1.89%) ⬇️
unitexamples-tests 72.56% <10.00%> (+0.07%) ⬆️

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

Files Changed Coverage Δ
panel/io/server.py 70.83% <10.00%> (-5.01%) ⬇️

... and 23 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

panel/io/server.py Outdated Show resolved Hide resolved
Copy link

@el-abcd el-abcd left a comment

Choose a reason for hiding this comment

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

FWIW I reviewed the change and it looked good to me.
I had an optional suggestion for the error message.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@philippjfr philippjfr merged commit 65d0a5b into holoviz:main Sep 13, 2023
11 of 14 checks passed
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.

auth checks
3 participants