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

Refactoring: Resource Provider Registration / Auth prep. #2197

Merged
merged 12 commits into from
Oct 31, 2018

Conversation

tombuildsstuff
Copy link
Contributor

This PR refactors the Resource Provider registration out into it's own package; it also moves some of the Authentication related stuff out into it's own package since it's going to be refactored further in the near future.

As a part of refactoring the Resource Provider registration out, I've also inverted the dependency such that we're able to reuse the RP Registration once it's pulled out it's own library - which will become part of the greater shared authentication library (across AzureRM/Public, Azure Stack and the AzureRM Backend in Terraform Core)

In the near future the intention is to have a shared authentication package with feature toggles for AzureCLIParsingAuth, ClientSecretAuth, CloudShellAuth etc - so that we're able to decide what's supported in each location as necessary (for example, CloudShell isn't available in Azure Stack); so whilst some of this PR may seem superfluous, there's some prep work for the upcoming refactor

Tests pass:

```
$ acctests azurerm TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered
=== RUN   TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered
--- PASS: TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered (5.90s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	7.278s
```
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

LGTM once passing testing is shown and potentially documenting/unexporting some of these functions. 🚀

azurerm/config.go Show resolved Hide resolved
azurerm/config.go Show resolved Hide resolved
azurerm/helpers/authentication/config.go Show resolved Hide resolved
azurerm/helpers/azure/sender.go Show resolved Hide resolved
azurerm/helpers/authentication/validation.go Show resolved Hide resolved
azurerm/helpers/authentication/environment.go Show resolved Hide resolved
@tombuildsstuff
Copy link
Contributor Author

tombuildsstuff commented Oct 31, 2018

Resource Provider Registration test passes:

$ acctests azurerm TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered
=== RUN   TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered
--- PASS: TestAccAzureRMEnsureRequiredResourceProvidersAreRegistered (5.90s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	7.278s

@tombuildsstuff tombuildsstuff merged commit 93c24b2 into master Oct 31, 2018
@tombuildsstuff tombuildsstuff deleted the refactor/auth branch October 31, 2018 18:55
tombuildsstuff added a commit that referenced this pull request Oct 31, 2018
@ghost
Copy link

ghost commented Mar 6, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants