[PR #1358] [MERGED] feat: Add OpenID Connect require availability configuration with startup validation #4909

Closed
opened 2026-04-16 13:20:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1358
Author: @Copilot
Created: 8/30/2025
Status: Merged
Merged: 8/30/2025
Merged by: @kolaente

Base: mainHead: copilot/fix-1357


📝 Commits (6)

  • 7daaf88 Initial plan
  • bb4219f feat: Add OpenID Connect force availability feature
  • f8e0049 fix: Remove example file and hide ForceAvailability from JSON
  • 23acf91 feat: Check OpenID Connect providers at startup for force availability
  • f191447 fix: Correct gofmt formatting in openid.go struct alignment
  • a583236 refactor: Rename forceavailability to requireavailability in OpenID Connect configuration

📊 Changes

4 files changed (+51 additions, -23 deletions)

View changed files

📝 config-raw.json (+5 -0)
📝 pkg/initialize/init.go (+6 -0)
📝 pkg/modules/auth/openid/openid.go (+17 -13)
📝 pkg/modules/auth/openid/providers.go (+23 -10)

📄 Description

This PR adds a new OpenID Connect configuration option called requireavailability that enables startup validation of OpenID Connect providers.

Key Features

  • Startup Validation: When requireavailability: true is set for an OpenID Connect provider, Vikunja will validate provider connectivity during application startup
  • Fail-Fast Behavior: If a required provider is unavailable, the application will crash with log.Fatalf(), allowing container orchestrators like Kubernetes to restart the service automatically
  • Zero Downtime Dependencies: Enables proper dependency management in containerized environments where authentication providers must be available before serving requests

Configuration

Add the new option to your OpenID Connect provider configuration:

auth:
  openid:
    providers:
      your-provider:
        name: "Your Provider"
        authurl: "https://provider.example.com"
        clientid: "your-client-id" 
        clientsecret: "your-client-secret"
        requireavailability: true  # New option

Implementation Details

  • The RequireAvailability field is excluded from JSON serialization to prevent exposure in API responses
  • Provider connectivity is checked by calling openid.GetAllProviders() during application initialization
  • Failed provider connections result in immediate application termination with descriptive error messages
  • The feature integrates seamlessly with existing OpenID Connect provider configuration

This is particularly useful for production deployments where you want to ensure all authentication methods are functional before the application begins accepting user requests.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


🔄 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/1358 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 8/30/2025 **Status:** ✅ Merged **Merged:** 8/30/2025 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `copilot/fix-1357` --- ### 📝 Commits (6) - [`7daaf88`](https://github.com/go-vikunja/vikunja/commit/7daaf88e43cac26c5cfa66e9f992d5611563f639) Initial plan - [`bb4219f`](https://github.com/go-vikunja/vikunja/commit/bb4219fbf5da5318a54e13516f5f3b1fce971cbf) feat: Add OpenID Connect force availability feature - [`f8e0049`](https://github.com/go-vikunja/vikunja/commit/f8e004991e784eb1b0805d347c6a18070ff3d436) fix: Remove example file and hide ForceAvailability from JSON - [`23acf91`](https://github.com/go-vikunja/vikunja/commit/23acf910198e10a705647a52366f06d376242d49) feat: Check OpenID Connect providers at startup for force availability - [`f191447`](https://github.com/go-vikunja/vikunja/commit/f191447515ecbb95d5d3182bdfc95a17e55306d5) fix: Correct gofmt formatting in openid.go struct alignment - [`a583236`](https://github.com/go-vikunja/vikunja/commit/a583236139a9607389db4eee99c573d837b3bdbd) refactor: Rename forceavailability to requireavailability in OpenID Connect configuration ### 📊 Changes **4 files changed** (+51 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `config-raw.json` (+5 -0) 📝 `pkg/initialize/init.go` (+6 -0) 📝 `pkg/modules/auth/openid/openid.go` (+17 -13) 📝 `pkg/modules/auth/openid/providers.go` (+23 -10) </details> ### 📄 Description This PR adds a new OpenID Connect configuration option called `requireavailability` that enables startup validation of OpenID Connect providers. ## Key Features - **Startup Validation**: When `requireavailability: true` is set for an OpenID Connect provider, Vikunja will validate provider connectivity during application startup - **Fail-Fast Behavior**: If a required provider is unavailable, the application will crash with `log.Fatalf()`, allowing container orchestrators like Kubernetes to restart the service automatically - **Zero Downtime Dependencies**: Enables proper dependency management in containerized environments where authentication providers must be available before serving requests ## Configuration Add the new option to your OpenID Connect provider configuration: ```yaml auth: openid: providers: your-provider: name: "Your Provider" authurl: "https://provider.example.com" clientid: "your-client-id" clientsecret: "your-client-secret" requireavailability: true # New option ``` ## Implementation Details - The `RequireAvailability` field is excluded from JSON serialization to prevent exposure in API responses - Provider connectivity is checked by calling `openid.GetAllProviders()` during application initialization - Failed provider connections result in immediate application termination with descriptive error messages - The feature integrates seamlessly with existing OpenID Connect provider configuration This is particularly useful for production deployments where you want to ensure all authentication methods are functional before the application begins accepting user requests. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey. --- <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-16 13:20:56 -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#4909