[PR #2606] [MERGED] fix(auth): tolerate string booleans in oidc provider config #8397

Closed
opened 2026-04-20 18:11:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2606
Author: @tink-bot
Created: 4/11/2026
Status: Merged
Merged: 4/11/2026
Merged by: @kolaente

Base: mainHead: fix-2599-oidc-env-bool


📝 Commits (2)

  • 11e9d2e test(auth): cover env-var string booleans for oidc providers (#2599)
  • b480eaf fix(auth): tolerate string booleans in oidc provider config (#2599)

📊 Changes

2 files changed (+138 additions, -34 deletions)

View changed files

📝 pkg/modules/auth/openid/providers.go (+34 -34)
📝 pkg/modules/auth/openid/providers_test.go (+104 -0)

📄 Description

The four OIDC provider boolean fields (emailfallback, usernamefallback, forceuserinfo, requireavailability) were parsed with a strict .(bool) type assertion, which fails whenever config arrives as strings — i.e. from environment variables or the *.file Docker secret convention (both flow through GetConfigValueFromFile which always returns strings). requireavailability is the one #2599 reports.

Extract a small parseBoolField helper that accepts both native bools and strings via strconv.ParseBool.

Bonus fix: the same bug was silently dropping stringified emailfallback / usernamefallback values with no log at all — those two call sites had no else branch. They now log a parse error from the shared helper's code path, matching the other two fields.

Fixes #2599


🔄 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/go-vikunja/vikunja/pull/2606 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 4/11/2026 **Status:** ✅ Merged **Merged:** 4/11/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-2599-oidc-env-bool` --- ### 📝 Commits (2) - [`11e9d2e`](https://github.com/go-vikunja/vikunja/commit/11e9d2e085a28e7ca62d37595af6ff676f8b811b) test(auth): cover env-var string booleans for oidc providers (#2599) - [`b480eaf`](https://github.com/go-vikunja/vikunja/commit/b480eafd2909675e925a1b65b6fbb4bbfcb17a1f) fix(auth): tolerate string booleans in oidc provider config (#2599) ### 📊 Changes **2 files changed** (+138 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `pkg/modules/auth/openid/providers.go` (+34 -34) 📝 `pkg/modules/auth/openid/providers_test.go` (+104 -0) </details> ### 📄 Description The four OIDC provider boolean fields (`emailfallback`, `usernamefallback`, `forceuserinfo`, `requireavailability`) were parsed with a strict `.(bool)` type assertion, which fails whenever config arrives as strings — i.e. from environment variables or the `*.file` Docker secret convention (both flow through `GetConfigValueFromFile` which always returns strings). `requireavailability` is the one #2599 reports. Extract a small `parseBoolField` helper that accepts both native bools and strings via `strconv.ParseBool`. **Bonus fix:** the same bug was silently dropping stringified `emailfallback` / `usernamefallback` values with no log at all — those two call sites had no `else` branch. They now log a parse error from the shared helper's code path, matching the other two fields. Fixes #2599 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:11:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8397