goauthentik / terraform-provider-authentik

Manage https://goauthentik.io with terraform.
https://registry.terraform.io/providers/goauthentik/authentik/latest/docs
GNU General Public License v3.0
58 stars 16 forks source link

Add VS Code devcontainer. #487

Closed Gunsmithy closed 2 months ago

Gunsmithy commented 3 months ago

Hi there,

Long time listener, first time contributor. (That's not true. I'm new to Authentik as well.)

In trying to keep all of our Infrastructure as Code for our new Authentik deployment I'm implementing, I found that all the new RBAC resources that are in preview apparently are not in this Terraform provider.

With the intention of potentially being able to contribute these new resources myself, I have created this devcontainer, so non-Go developers such as myself can have a more cozy starting place and baseline envrionment with passing tests from which to grow.

Changes:

  1. Added the devcontainer.json file itself. The JSON is mostly default with a couple extensions, change however you see fit.
  2. The Dockerfile for the devcontainer is based off of the Microsoft Go 1.21 image with no changes. 1.22 is available but I set as 1.21 to match your project files.
  3. The .env file contains bootstrap secrets/passwords/tokens for running the Docker Compose Authentik install. All presumably fine to have here as exposing a devcontainer to the Internet would be very questionable anyways.
  4. The Docker Compose file is mostly copied from the link in the documentation, https://goauthentik.io/docker-compose.yml, with the minor addition of the new service for the devcontainer itself using the Microsoft image
  5. The settings.json file and Readme references were changed to be this-token-is-for-testing-dont-use to keep distinct from now the boostrap akadmin password being set in the .env file
  6. The tests timeout was set to 0 in the Readme file as I found it took me 132 seconds to run them on my new machine, well over the 30s specified, and I wouldn't want a slower machine scaring any potential contributors off
  7. I added separate Readme instructions for running the tests from within the devcontainer, however, it could be considered to remove the localhost-related instructions if deciding upon fully adopting the devcontainer into your normal workflow. A simple change to the docker-compose could also allow access to other instances of Authentik you may be running on localhost too. This would simplify the instructions to new contributors, but I did not wish to affect existing workflows.

Let me know what you think!

Dylan

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.38%. Comparing base (721af76) to head (ad899d2). Report is 10 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #487 +/- ## ========================================== - Coverage 85.42% 85.38% -0.04% ========================================== Files 80 80 Lines 7857 7864 +7 ========================================== + Hits 6712 6715 +3 - Misses 745 747 +2 - Partials 400 402 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.