Skip to content

Adding ResourceNotFound Error when user does not have access to resource#368

Merged
Bento007 merged 2 commits intotsmith/auto-provisionfrom
tsmith/not_found
Dec 6, 2019
Merged

Adding ResourceNotFound Error when user does not have access to resource#368
Bento007 merged 2 commits intotsmith/auto-provisionfrom
tsmith/not_found

Conversation

@Bento007
Copy link
Copy Markdown
Collaborator

@Bento007 Bento007 commented Dec 5, 2019

When a user tries to access a controlled access resource they do not have any access privileges to, the object appears as if it does not exist. A user should not know about resources they do not have access to.

  • ResourceNotFound error raised during evaluation if the user does not have access to the specified resource type or id.

@Bento007 Bento007 self-assigned this Dec 5, 2019
@Bento007 Bento007 changed the title Adding ResourceNotFound Error when user does not have any access for Adding ResourceNotFound Error when user does not have access to resource Dec 5, 2019
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #368 into tsmith/auto-provision will decrease coverage by 0.06%.
The diff coverage is 80%.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           tsmith/auto-provision     #368      +/-   ##
=========================================================
- Coverage                  89.53%   89.46%   -0.07%     
=========================================================
  Files                         34       34              
  Lines                       2197     2203       +6     
=========================================================
+ Hits                        1967     1971       +4     
- Misses                       230      232       +2
Impacted Files Coverage Δ
fusillade/directory/authorization.py 100% <100%> (ø) ⬆️
fusillade/errors.py 94.11% <100%> (+0.78%) ⬆️
fusillade/api/evaluate.py 88.57% <50%> (-5.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e5831c...950d62a. Read the comment docs.

@Bento007 Bento007 requested a review from chmreid December 5, 2019 21:30
Copy link
Copy Markdown
Contributor

@chmreid chmreid left a comment

Choose a reason for hiding this comment

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

A few minor things, but overall lookin good

Comment thread fusillade/api/evaluate.py
authz_params = get_resource_authz_parameters(body['principal'], body['resource'])
except AuthorizationException:
response = {'result': False, 'reason': "The user is disabled."}
response = {'result': False, 'reason': "UserDisabled"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would expect this error message to be "User is not authorized" or similar - does "disabled" better describe this outcome?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not authorized is implied by the result false. The reason gives more details to the server side applications as to why they are not authorized.

Comment thread tests/test_evaluate.py Outdated
Co-Authored-By: Charles Reid <53452777+chmreid@users.noreply.github.com>
@Bento007 Bento007 merged commit b1eff34 into tsmith/auto-provision Dec 6, 2019
@Bento007 Bento007 deleted the tsmith/not_found branch December 6, 2019 17:58
Bento007 added a commit that referenced this pull request Dec 6, 2019
…rce (#368)

When a user tries to access a controlled access resource they do not have any access privileges to, the object appears as if it does not exist. A user should not know about resources they do not have access to.

ResourceNotFound error raised during evaluation if the user does not have access to the specified resource type or id.

Co-Authored-By: Charles Reid <53452777+chmreid@users.noreply.github.com>
Bento007 added a commit that referenced this pull request Dec 9, 2019
…rce (#368)

When a user tries to access a controlled access resource they do not have any access privileges to, the object appears as if it does not exist. A user should not know about resources they do not have access to.

ResourceNotFound error raised during evaluation if the user does not have access to the specified resource type or id.

Co-Authored-By: Charles Reid <53452777+chmreid@users.noreply.github.com>
Bento007 added a commit that referenced this pull request Dec 10, 2019
…rce (#368)

When a user tries to access a controlled access resource they do not have any access privileges to, the object appears as if it does not exist. A user should not know about resources they do not have access to.

ResourceNotFound error raised during evaluation if the user does not have access to the specified resource type or id.

Co-Authored-By: Charles Reid <53452777+chmreid@users.noreply.github.com>
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.

3 participants