Fix auto user provisioning#367
Conversation
- Provision the user for evaluation requests, if they don't exist. - Also a random typing fix. - adding tests - sharing arn_prefix in test.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
chmreid
left a comment
There was a problem hiding this comment.
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) | |||
There was a problem hiding this comment.
Should this _user = User(user) be included in the try/except below? (wondering because of the User.provision_user call in the except block)
There was a problem hiding this comment.
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.
* 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.
* 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.
Uh oh!
There was an error while loading. Please reload this page.