Skip to content

Conversation

@gpalmz
Copy link
Collaborator

@gpalmz gpalmz commented Nov 21, 2025

Will use this as base branch until code thaw.

@gpalmz gpalmz marked this pull request as ready for review November 21, 2025 21:37
@gpalmz gpalmz requested a review from a team as a code owner November 21, 2025 21:37
@gpalmz gpalmz requested review from benblaustein and benjjs and removed request for benblaustein November 21, 2025 21:37
@gpalmz gpalmz changed the title [AZINTS-4143] Check for ability to create app registrations [AZINTS-4143] Add functions to check ability to create app registrations Nov 21, 2025
Comment on lines -164 to -168
def execute_json_nullable(az_cmd: AzCmd) -> Any:
az_response = execute(az_cmd, can_fail=True)
if not az_response:
return None
return json.loads(az_response)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, I feel like this was supposed to be used somewhere.... If we find it I think it would be better off as an optional argument to execute_json.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree

@gpalmz gpalmz requested a review from benjjs November 21, 2025 22:11
def get_assigned_entra_role_ids(user_id: str) -> set[str]:
return set(
execute_json(
Cmd(["az", "rest"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these not using AzCmd because there isn't a service associated with these commands? Seems a little bit confusing just from a naming perspective given that they are very much az cli commands.

Copy link
Collaborator Author

@gpalmz gpalmz Nov 21, 2025

Choose a reason for hiding this comment

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

Right. I kinda think we should phase out that AzCmd class, I don't really see the benefit of it. I also think we could consider integrating the shlex.quote into the Cmd class to make it easier to use. Anything that's an input to a command should proably be quoted (I think, lmk if you think that's not right)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think we should quote everything - just have to be very careful to not double quote things. The PR for that change will need to be tested very thoroughly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed

Copy link
Collaborator

@benjjs benjjs left a comment

Choose a reason for hiding this comment

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

Approach seems good and the refactor is otherwise appreciated

@gpalmz gpalmz changed the title [AZINTS-4143] Add functions to check ability to create app registrations Code freeze base branch Dec 1, 2025
@gpalmz gpalmz merged commit 43c4451 into main Dec 8, 2025
1 check passed
@gpalmz gpalmz deleted the gpalmz/azure-check-entra-role-assignments branch December 8, 2025 15:57
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