Skip to content
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

Merged
merged 1 commit into from
Dec 8, 2016

Conversation

brendandburns
Copy link
Member

@brendandburns brendandburns commented Nov 30, 2016

Fix a bug where command line flags would be ignored
Validate that the service principal still exists

@colemickens for sanity checking

Fixes #1442

@mention-bot
Copy link

@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.

Copy link
Contributor

@colemickens colemickens left a 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)
Copy link
Contributor

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)?

Copy link
Member Author

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...

@derekbekoe derekbekoe changed the title Update the handling of service principals. [ACS] Update the handling of service principals. Dec 1, 2016
@brendandburns
Copy link
Member Author

Comment addressed, please re-check.

Thanks!

Copy link
Member

@derekbekoe derekbekoe left a 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,
)
Copy link
Member

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.

Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@derekbekoe derekbekoe left a comment

Choose a reason for hiding this comment

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

Approving this change.

@derekbekoe derekbekoe merged commit 9a12bee into Azure:master Dec 8, 2016
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.

4 participants