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

fix(bitbucketcloud)!: Use AccountID as username instead of Nickname #2034

Merged

Conversation

maxbrunet
Copy link
Contributor

@maxbrunet maxbrunet commented Jan 31, 2022

I want to be able to identify the user running the workflow and do checks like #308 (comment), and nickname is not appropriate:

Note that while we are introducing a nickname field, it will not be effective for identifying user accounts, because nicknames are not guaranteed to be globally unique. If you do store user data, we strongly encourage you to use Atlassian account IDs as the identifier for your data.

https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/

I also clean up username from the test data, since it has been removed on 29 April 2019.

I suppose PullRequest.Author is only informative, so it should be fine to keep Nickname there.

For reference, the change from Username to Nickname was made in #502.

@maxbrunet maxbrunet requested a review from a team as a code owner January 31, 2022 23:50
@maxbrunet
Copy link
Contributor Author

I do not know all the places where User.Username is used, but policies.owners.users could be broken for some Bitbucket Cloud users for example.

Only the user's username, UUID, and accound ID can be used to identify a user via the Bitbucket Cloud REST API:

  • For users who created their account before the deprecation, their nickname was initialized to the value of their username, so in this case it should work for them.
  • For users who created their account recently, their nickname is initialized to the value of their display name, so it should not work for them.

And a user can change their nickname independently from their username.

@maxbrunet
Copy link
Contributor Author

I changed my mind about PullRequest.Author, I think it makes sense to identify the user uniquely there as well, it is exposed as the PULL_AUTHOR environment variable. For a future usage example as in an RBAC mechanism defining whose PR can be auto-planned.

@chenrui333 chenrui333 added this to the v0.19.1 milestone Mar 7, 2022
@chenrui333 chenrui333 merged commit 24e8cf7 into runatlantis:master Mar 7, 2022
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
…unatlantis#2034)

* fix(bitbucketcloud)!: Use AccountID as username instead of Nickname

* Update PullRequest.Author as well

* Remove unused Nickname field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants