[PR #801] [MERGED] Add integration tests for OIDC authentication #1658

Closed
opened 2025-12-29 02:31:06 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/801
Author: @juanfont
Created: 9/8/2022
Status: Merged
Merged: 9/21/2022
Merged by: @juanfont

Base: mainHead: oidc-integration-testing


📝 Commits (10+)

  • b27b789 Added base config file template
  • cb70d7c Return the results on error
  • fca3805 Initial work on OIDC tests
  • 5f384c6 Removed old code and minor changes
  • f33e3e3 Parse the OIDC login URL
  • 71b7123 Minor change on the base config for OIDC
  • 9c0cf45 OIDC integration tests working
  • 41353a5 Added integration tests for OIDC on Makefile
  • 5774b32 Include OIDC in the full execution
  • b2f3ffb Run integration tests in Actions

📊 Changes

15 files changed (+785 additions, -93 deletions)

View changed files

📝 .github/workflows/test-integration.yml (+9 -0)
📝 Makefile (+4 -1)
📝 api_common.go (+2 -2)
cmd/headscale/cli/mockoidc.go (+100 -0)
📝 cmd/headscale/cli/root.go (+4 -0)
📝 flake.nix (+1 -1)
📝 integration_cli_test.go (+61 -61)
📝 integration_common_test.go (+9 -9)
📝 integration_embedded_derp_test.go (+4 -4)
📝 integration_general_test.go (+12 -12)
integration_oidc_test.go (+506 -0)
integration_test/etc_oidc/base_config.yaml (+22 -0)
integration_test/etc_oidc/tls/server.crt (+22 -0)
integration_test/etc_oidc/tls/server.key (+28 -0)
📝 machine.go (+1 -3)

📄 Description

This PR adds basic integration tests for our OIDC code.

For the time being they are pretty basic (just login in), but it is a start :)

We make use of https://github.com/oauth2-proxy/mockoidc for simulating a OIDC Identity Provider.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/801 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 9/8/2022 **Status:** ✅ Merged **Merged:** 9/21/2022 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `oidc-integration-testing` --- ### 📝 Commits (10+) - [`b27b789`](https://github.com/juanfont/headscale/commit/b27b789e286c3043a6e988a4bc3e15fcf20b7ecb) Added base config file template - [`cb70d7c`](https://github.com/juanfont/headscale/commit/cb70d7c705a4a0a170445f8672253e861fed8a58) Return the results on error - [`fca3805`](https://github.com/juanfont/headscale/commit/fca380587a9342a4ae22189ba6935693aca2d7b5) Initial work on OIDC tests - [`5f384c6`](https://github.com/juanfont/headscale/commit/5f384c63239d5fe2ce0313e9b16580ed5122369c) Removed old code and minor changes - [`f33e3e3`](https://github.com/juanfont/headscale/commit/f33e3e3b818c75fdf2e15c7910480dc7a8c1b561) Parse the OIDC login URL - [`71b7123`](https://github.com/juanfont/headscale/commit/71b712356fa0711ef3f8cd756288a7cf565c9410) Minor change on the base config for OIDC - [`9c0cf45`](https://github.com/juanfont/headscale/commit/9c0cf4595a46582b29f876622edaab06f6e7328d) OIDC integration tests working - [`41353a5`](https://github.com/juanfont/headscale/commit/41353a57c87185bea493aece55bac592d4b10a9f) Added integration tests for OIDC on Makefile - [`5774b32`](https://github.com/juanfont/headscale/commit/5774b32e552255d513e3e37486cd70f1f9eb1b07) Include OIDC in the full execution - [`b2f3ffb`](https://github.com/juanfont/headscale/commit/b2f3ffbc5ac50c74a12798de173973d5b0055233) Run integration tests in Actions ### 📊 Changes **15 files changed** (+785 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yml` (+9 -0) 📝 `Makefile` (+4 -1) 📝 `api_common.go` (+2 -2) ➕ `cmd/headscale/cli/mockoidc.go` (+100 -0) 📝 `cmd/headscale/cli/root.go` (+4 -0) 📝 `flake.nix` (+1 -1) 📝 `integration_cli_test.go` (+61 -61) 📝 `integration_common_test.go` (+9 -9) 📝 `integration_embedded_derp_test.go` (+4 -4) 📝 `integration_general_test.go` (+12 -12) ➕ `integration_oidc_test.go` (+506 -0) ➕ `integration_test/etc_oidc/base_config.yaml` (+22 -0) ➕ `integration_test/etc_oidc/tls/server.crt` (+22 -0) ➕ `integration_test/etc_oidc/tls/server.key` (+28 -0) 📝 `machine.go` (+1 -3) </details> ### 📄 Description This PR adds basic integration tests for our OIDC code. For the time being they are pretty basic (just login in), but it is a start :) We make use of https://github.com/oauth2-proxy/mockoidc for simulating a OIDC Identity Provider. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:31:06 +01:00
adam closed this issue 2025-12-29 02:31:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1658