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 Azure DevOps Server and Azure DevOps Services as valid OAuth client service providers #99

Merged
merged 9 commits into from
Dec 10, 2019

Conversation

lafentres
Copy link
Contributor

@lafentres lafentres commented Oct 29, 2019

Description

This adds support for using Azure DevOps Server and Azure DevOps Services as valid OAuth client service providers.

Depends on this go-tfe PR being merged first.

Also depends on this go-tfe PR being merged

Testing

  1. Build the provider
  2. cp $GOPATH/bin/terraform-provider-tfe ~/.terraform.d/plugins/
  3. Use this config:
# Configure the Terraform Enterprise Provider
provider "tfe" {
  hostname = "NGROK"
  token    = "ADMIN_TOKEN"
}
resource "tfe_oauth_client" "ado_server" {
  organization     = "hashicorp"
  api_url          = "https://ado.hashicorp.engineering"
  http_url         = "https://ado.hashicorp.engineering"
  oauth_token      = "my-vcs-provider-token"
  service_provider = "ado_server"
}

resource "tfe_oauth_client" "ado_server_with_private_key" {
  organization     = "hashicorp"
  api_url          = "https://ado.hashicorp.engineering"
  http_url         = "https://ado.hashicorp.engineering"
  oauth_token      = "my-vcs-provider-token"
  service_provider = "ado_server"
  private_key      = "-----BEGIN RSA PRIVATE KEY-----\ncontent\n-----END RSA PRIVATE KEY-----"
}

resource "tfe_oauth_client" "ado_services" {
  organization     = "hashicorp"
  api_url          = "https://dev.azure.com"
  http_url         = "https://dev.azure.com"
  oauth_token      = "my-vcs-provider-token"
  service_provider = "ado_services"
}
  1. Margaritas?

@lafentres lafentres self-assigned this Oct 29, 2019
@veverkap veverkap marked this pull request as ready for review December 4, 2019 22:51
@veverkap veverkap requested a review from sudomateo December 4, 2019 22:51
@veverkap veverkap assigned veverkap and unassigned lafentres Dec 4, 2019
@veverkap veverkap changed the title [DRAFT] Add Azure DevOps Server and Azure DevOps Services as valid OAuth client service providers Add Azure DevOps Server and Azure DevOps Services as valid OAuth client service providers Dec 4, 2019
Copy link
Contributor

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

LGTM!

@ghost ghost added size/S and removed size/XS labels Dec 10, 2019
@veverkap
Copy link
Contributor

@svanharmelen @sudomateo asking for a rereview since we are now REQUIRING private_key for ado_server

Copy link
Contributor

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

This looks good to me.

I think we could avoid ForceNew: true on the private key field with a little more work, but it's up to y'all whether you think that's worth it or not.

Copy link
Contributor

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

I must admit I don't know Azure DevOps that well, but if this is required on their side I guess this makes sense. If it doesn't then I doubt if we should make it required...

As for the ordering, it's just my OCD kicking in trying to keep things consistent 😉

tfe/resource_tfe_oauth_client.go Show resolved Hide resolved
website/docs/r/oauth_client.html.markdown Show resolved Hide resolved
tfe/resource_tfe_oauth_client.go Show resolved Hide resolved
website/docs/r/oauth_client.html.markdown Outdated Show resolved Hide resolved
Copy link
Contributor Author

@lafentres lafentres left a comment

Choose a reason for hiding this comment

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

This looks good to me! I left a couple of comments and I think it might be good to add a test case for the private key validation but that's it.
0fc03f2d2976dafe

tfe/resource_tfe_oauth_client.go Outdated Show resolved Hide resolved
Patrick Veverka and others added 2 commits December 10, 2019 13:09
@veverkap veverkap merged commit a5e7271 into master Dec 10, 2019
@veverkap veverkap deleted the lafentres/add-ado-support branch December 10, 2019 18:32
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