Skip to content

Fix auto user provisioning#367

Merged
Bento007 merged 2 commits intotsmith/resource-featfrom
tsmith/auto-provision
Dec 5, 2019
Merged

Fix auto user provisioning#367
Bento007 merged 2 commits intotsmith/resource-featfrom
tsmith/auto-provision

Conversation

@Bento007
Copy link
Copy Markdown
Collaborator

@Bento007 Bento007 commented Dec 5, 2019

  • Provision the user for evaluation requests, if they don't exist.
  • Also a random typing fix.
  • adding tests
  • sharing arn_prefix in test.

- Provision the user for evaluation requests, if they don't exist.
- Also a random typing fix.
- adding tests
- sharing arn_prefix in test.
@Bento007 Bento007 self-assigned this Dec 5, 2019
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #367 into tsmith/resource-feat will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@                   Coverage Diff                    @@
##           tsmith/resource-feat     #367      +/-   ##
========================================================
+ Coverage                  89.5%   89.53%   +0.02%     
========================================================
  Files                        34       34              
  Lines                      2191     2197       +6     
========================================================
+ Hits                       1961     1967       +6     
  Misses                      230      230
Impacted Files Coverage Δ
fusillade/directory/authorization.py 100% <100%> (ø) ⬆️
fusillade/directory/resource.py 91.44% <100%> (ø) ⬆️

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 0d85139...0e5831c. Read the comment docs.

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.

One question around the get_resource_authz_params method, otherwise LGTM

@@ -18,12 +19,18 @@ def get_resource_authz_parameters(user: str, resources: Union[List[str], str]):
"""
policies = []
_user = User(user)
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.

Should this _user = User(user) be included in the try/except below? (wondering because of the User.provision_user call in the except block)

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.

No, the user object can be instantiated in python, but the user does not exist in the database until they have been provisioned. User only need to be provisioned into the database once. When a User is created in python, fusillade does not check if the users actual exist until a property required the database is requested. This is to save resource by not making request to the database unless needed.

@Bento007 Bento007 merged commit e6829e1 into tsmith/resource-feat Dec 5, 2019
Bento007 added a commit that referenced this pull request Dec 9, 2019
* Fix auto user provisioning

- Provision the user for evaluation requests, if they don't exist.
- Also a random typing fix.
- adding tests
- sharing arn_prefix in test.
Bento007 added a commit that referenced this pull request Dec 10, 2019
* Fix auto user provisioning

- Provision the user for evaluation requests, if they don't exist.
- Also a random typing fix.
- adding tests
- sharing arn_prefix in test.
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