-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[ACS] Update the handling of service principals. #1469
Conversation
@brendandburns, thanks for your PR! By analyzing the history of the files in this pull request, we identified @sanar-microsoft and @colemickens to be potential reviewers. |
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.
one small question out of curiosity.
# Nothing to load, make one. | ||
if not client_secret: | ||
client_secret = binascii.b2a_hex(os.urandom(10)).decode('utf-8') | ||
store_acs_service_principal(client_secret, None) |
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.
What's the purpose of calling store_acs_service_principal
twice (lines 274, 280)?
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.
removed, I think originally I didn't salt the URL, so if I didn't save it it prevented subsequent creates, but that was removed, so it's no longer necessary...
Comment addressed, please re-check. Thanks! |
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.
On it's own, this change LGTM but command modules should not have dependencies on each other as they version independently and can change.
from azure.cli.command_modules.role.custom import ( | ||
_graph_client_factory, | ||
show_service_principal, | ||
) |
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.
Command modules should not have dependencies on each other...
Since command modules are/will be versioned independently, this could fail in the future if there's a change to the 'role' module that changes these methods (especially as the _graph_client_factory()
is private).
Any logic needed should be included here.
You can choose to leave it as is but there are no guarantees.
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.
Related to this from a prev. PR - #1258 (comment)
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.
cc: @yugangw-msft
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.
Approving this change.
Fix a bug where command line flags would be ignored
Validate that the service principal still exists
@colemickens for sanity checking
Fixes #1442