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

feat: azapi_client_config - add object id #657

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

matt-FFFFFF
Copy link
Member

@matt-FFFFFF matt-FFFFFF commented Nov 1, 2024

This PR closes the gap to the azurerm equivalent by adding the object_id attribute to the azapi_client_config resource.

Also adds a convenience attribute to azapi_client_config to allow for adding the subscription resource id easily into parent_id.

@ms-henglu

@matt-FFFFFF matt-FFFFFF marked this pull request as ready for review November 1, 2024 15:56
@ms-henglu ms-henglu added this to the v2.1.0 milestone Nov 8, 2024
Copy link
Member

@ms-henglu ms-henglu left a comment

Choose a reason for hiding this comment

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

Thanks @matt-FFFFFF for this PR. It mostly LGTM, just some minor comments, please check.

@ms-henglu ms-henglu requested a review from magodo November 13, 2024 05:26
@matt-FFFFFF
Copy link
Member Author

Hi @ms-henglu I have updated this and responded to your comments. Please can you review again? Thanks!

log.Printf("[DEBUG] Error getting requesting token from credentials: %s", err)
}

cl, err := parseTokenClaims(tok.Token)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a nil-check on the tok? If above GetToken returns error, the tok could be nil here?

Copy link
Member Author

@matt-FFFFFF matt-FFFFFF Nov 15, 2024

Choose a reason for hiding this comment

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

tok is of type AccessToken. This is a value type not a pointer.

The type declaration is:

type AccessToken struct {
	Token     string
	ExpiresOn time
}

I refactored using a comparison of tok.Token == "" as this will be the default value if the token request fails.

WDYT?

b7ae1bb

Copy link
Member

@ms-henglu ms-henglu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! LGTM

@ms-henglu ms-henglu merged commit bb8a4f0 into Azure:main Nov 18, 2024
10 checks passed
@matt-FFFFFF matt-FFFFFF deleted the feat/azapiClientConfigObjectId branch November 18, 2024 07:05
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.

2 participants