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

Feature/enable sso authentication on connect #48

Merged

Conversation

SwissGipfel
Copy link
Contributor

Our own take on sso_auth implementation. Feature PR is duplicate to #45
We just saw, that there's already a PR for this feature.

However, we would already have some tests for the sso_auth option.

@disc
Copy link
Owner

disc commented Sep 14, 2023

Hey @SwissGipfel, thank you for the contribution. Can you make sure that tests are okay? the latest pipeline shows that sso_auth-related test is failed;

=== RUN   TestGetServer_basic
    resource_server_test.go:15: Step 3/5 error: Error running apply: exit status 1
        
        Error: Non-200 response on updating the server
        body=500: Internal Server Error
        
          with pritunl_server.test,
          on terraform_plugin_test.tf line 2, in resource "pritunl_server" "test":
           2: resource "pritunl_server" "test" {
        
--- FAIL: TestGetServer_basic (16.71s)
=== RUN   TestGetServer_with_sso_auth
    resource_server_test.go:59: Step 1/7 error: Check failed: Check 2/3 error: pritunl_server.test: Attribute 'sso_auth' expected "true", got "false"

@disc disc self-requested a review September 14, 2023 13:44
Copy link
Owner

@disc disc left a comment

Choose a reason for hiding this comment

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

Failed tests need to be fixed

@SwissGipfel
Copy link
Contributor Author

Hey @disc thanks for your review!
My bad, sorry. I only checked the tests against our own test system, not with the Makefile.

With version 1.32.3602.80 of 13be708 all the tests passed (locally)

$ make test
Error response from daemon: No such container: tf_pritunl_acc_test
Unable to find image 'ghcr.io/jippi/docker-pritunl:1.32.3602.80' locally
1.32.3602.80: Pulling from jippi/docker-pritunl
Digest: sha256:5498c843538ac65e586e242b088a9a64cf1ce1249679baa7075d79669703e40c
Status: Downloaded newer image for ghcr.io/jippi/docker-pritunl:1.32.3602.80
3ba27296cdc043c38643f2d8d4a37feb8368e6dfbe348a7340d2b92bdea40886
sleep 20
./tools/wait-for-it.sh localhost:27017 -- echo "mongodb is up"
wait-for-it.sh: waiting 15 seconds for localhost:27017
wait-for-it.sh: localhost:27017 is available after 0 seconds
mongodb is up
# enables an api access for the pritunl user, updates an api token and secret
MongoDB shell version v4.4.23
connecting to: mongodb://127.0.0.1:27017/pritunl?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("c603769e-6681-4d01-84dd-6018b2eadb3d") }
MongoDB server version: 4.4.23
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }
bye
TF_ACC=1 \
PRITUNL_URL="https://localhost/" \
PRITUNL_INSECURE="true" \
PRITUNL_TOKEN=tfacctest_token \
PRITUNL_SECRET=tfacctest_secret \
go test -v -cover -count 1 ./internal/provider
=== RUN   TestDataSourceHost
=== PAUSE TestDataSourceHost
=== RUN   TestAccOrganization_basic
=== PAUSE TestAccOrganization_basic
=== RUN   TestGetServer_basic
--- PASS: TestGetServer_basic (2.26s)
=== RUN   TestGetServer_with_sso_auth
--- PASS: TestGetServer_with_sso_auth (2.79s)
=== RUN   TestGetServer_with_attached_organization
--- PASS: TestGetServer_with_attached_organization (4.14s)
=== RUN   TestGetServer_with_a_few_attached_organizations
--- PASS: TestGetServer_with_a_few_attached_organizations (2.67s)
=== RUN   TestGetServer_with_attached_route
--- PASS: TestGetServer_with_attached_route (2.36s)
=== RUN   TestGetServer_with_a_few_attached_routes
--- PASS: TestGetServer_with_a_few_attached_routes (1.62s)
=== RUN   TestGetServer_with_invalid_route
--- PASS: TestGetServer_with_invalid_route (0.12s)
=== RUN   TestCreateServer_with_invalid_network
--- PASS: TestCreateServer_with_invalid_network (0.16s)
=== RUN   TestCreateServer_with_unsupported_network
--- PASS: TestCreateServer_with_unsupported_network (1.38s)
=== RUN   TestCreateServer_with_invalid_bind_address
--- PASS: TestCreateServer_with_invalid_bind_address (1.18s)
=== RUN   TestGetServer_with_default_host
--- PASS: TestGetServer_with_default_host (1.93s)
=== RUN   TestGetServer_without_hosts
--- PASS: TestGetServer_without_hosts (1.83s)
=== RUN   TestAccUser_basic
=== PAUSE TestAccUser_basic
=== CONT  TestDataSourceHost
=== CONT  TestAccUser_basic
=== CONT  TestAccOrganization_basic
--- PASS: TestDataSourceHost (0.58s)
--- PASS: TestAccOrganization_basic (1.94s)
--- PASS: TestAccUser_basic (2.64s)
PASS
coverage: 63.0% of statements
ok  	github.com/disc/terraform-provider-pritunl/internal/provider	25.094s	coverage: 63.0% of statements
tf_pritunl_acc_test

@disc disc added the enhancement New feature or request label Sep 14, 2023
@disc disc merged commit 27e1fe3 into disc:master Sep 14, 2023
3 checks passed
@disc disc mentioned this pull request Sep 14, 2023
@SwissGipfel SwissGipfel deleted the feature/enable-sso-authentication-on-connect branch September 14, 2023 14:26
@disc
Copy link
Owner

disc commented Sep 14, 2023

@SwissGipfel new option has been already released in the version 0.1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants