-
Notifications
You must be signed in to change notification settings - Fork 89
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 support for creating external resources associated with self-managed certificates #118
Add support for creating external resources associated with self-managed certificates #118
Conversation
0811a1b
to
c3898c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid contribution @impl as always. There's just one thing I'd like us to add.
Considering the custom domain verification always relies on a 3rd party (in your examples you introduced the google provider) we introduced a wiremock server to be able to run the tests for domain verification. You can spin it up from the root of the project using docker compose
or running the make dev-up
command.
The response/request mappings are found here: https://github.com/auth0/terraform-provider-auth0/blob/main/dockerfiles/wiremock/__files/custom_domain_with_pending_verification.json.
Would you be able to add an assertion for the 2 properties we introduced on the domain verification tests and update the request/response payloads as well to be able to parse them? 🙏🏻
Aha, wonderful! I was wondering how the heck those tests worked. :-) I'll update them and push up a new commit. Thanks for the thorough review! |
@impl Let me know if you need any help with that, as we haven't really documented well that part in our contributing section. I'll update that next week for other folks as well to give better clarity. In the future we're aiming at giving the possibility for forks to run all the tests without requiring a real test tenant (and they'll run automatically on fork PRs), but having all requests / responses mocked. The actual Auth0 Management API should get hit only once we merge to master just to rule out any potential miss-alignments between the mocks. All of this will require some work from our end tho so I don't have an ETA when it will be available in full. For now we just use mocks for the domain verification. |
@sergiughf, that sounds like a great plan to me. I've been able to run relevant tests against a tenant I created for acceptance testing, but of course it would also be convenient to not have to do that in some cases. I went ahead and added a test for self-managed certificates and updated some of the Auth0-managed certificates test as well. To make the WireMock files a little less confusing I ended up doing some minor refactoring, which is entirely separate in one commit in case there's anything specific there you'd like changed. Hopefully it will be enough of a bridge until you can get it set up for everything. Let me know! |
dockerfiles/wiremock/__files/custom_domain_verification/cd_auth0managed.json
Outdated
Show resolved
Hide resolved
8fc44bd
to
8e18a96
Compare
8e18a96
to
5f471a6
Compare
63661af
to
8c3db6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@impl I can't thank you enough for this contribution and also the others. The improvements brought are highly appreciated. As always a pleasure to review and collaborate together. 🌟
Of course, and thank you for the review/improvements and for being so responsive to these PRs! Our Terraform config looks better by the day ;). |
Description
This change adds attributes to
auth0_custom_domain
andauth0_custom_domain_verification
to make it possible to seamlessly manage all the additional infrastructure associated with self-managed certificates. I also added a complete example of setting up a custom domain using self-managed certs with GCP.Dependencies:
For testing purposes I updated theDone!go.mod
for this branch to point to ourgo-auth0
fork. When the dependency lands, I'll update this PR to remove the temporaryreplace
directive. (Please don't merge until then! :-)Checklist
Note: Checklist required to be completed before a PR is considered to be reviewable.
Auth0 Code of Conduct
Auth0 General Contribution Guidelines
Changes include test coverage?
Does the description provide the correct amount of context?
Have you updated the documentation?
Is this code ready for production?