-
Notifications
You must be signed in to change notification settings - Fork 199
[Bug Fix] Adding Check for SP During User Role Assignment. #1497
[Bug Fix] Adding Check for SP During User Role Assignment. #1497
Conversation
src/deployment/deploy.py
Outdated
| ) | ||
|
|
||
| def assign_user_access(self) -> None: | ||
| if self.results["client_id"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this condition
why skipping when the client_id is set ? Shouldn't we update the application backing that client_id instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting we retrieve the underlying application and update it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that done anywhere else? It was my impression that you wouldnt be able to edit any AAD objects with an SP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay @chkeita, I actually just changed it to self.upgrade. The original logic did not work properly because client_id and client_secret are set regardless.
…nharper285/onefuzz into user/noharper/sp-deploy-bug-fix
Co-authored-by: Cheick Keita <kcheick@gmail.com>

Summary of the Pull Request
What is this about?
I introduced a bug when I implemented the new function for assigning user access. If a user tried upgrading an instance with an SP, then deployment would fail when this function was called due to lack of permissions.
PR Checklist
Info on Pull Request
What does this include?
Changes to deploy.py assign_user_access()
Validation Steps Performed
check-pr run.
How does someone test & validate?
Deploy with a service principal.