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

Add ability to authorize using a Service Account #562

Merged
merged 17 commits into from
Apr 19, 2023

Conversation

adezxc
Copy link

@adezxc adezxc commented Apr 3, 2023

This PR is related to issue terraform-provider-vcd#995

Add support for authenticating using a Service Account

For now, the PR only enables using Service accounts that are in Active Stage so the user is expected to provide an file containing an api token .json file e.g

{"refresh_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

So the SDK will do the following steps:

  1. Read File contents
  2. Get bearer token and new refresh_token using SetApiToken
  3. Save the new refresh_token to the same file

Adam Jasinski added 5 commits March 29, 2023 17:31
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Adam Jasinski added 2 commits April 3, 2023 12:54
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
@adezxc adezxc marked this pull request as ready for review April 3, 2023 14:19
@adezxc adezxc removed the request for review from dataclouder April 3, 2023 14:19
Adam Jasinski added 2 commits April 4, 2023 10:38
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

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

Approving. Maybe in the near future we can check how to provide a testing Service account to create a test for SetServiceAccountApiToken .

Adam Jasinski added 5 commits April 13, 2023 23:10
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
@Didainius Didainius requested review from dataclouder and removed request for lvirbalas April 14, 2023 13:15
Adam Jasinski added 2 commits April 18, 2023 15:48
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
Signed-off-by: Adam Jasinski <jasinskia@vmware.com>
@adezxc adezxc merged commit fe1bed6 into vmware:main Apr 19, 2023
@adezxc adezxc deleted the service_accounts branch April 19, 2023 07:51
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.

5 participants