Skip to content

[management] Add static connectors to combined server#5765

Closed
jnfrati wants to merge 38 commits intomainfrom
feat/static-connectors
Closed

[management] Add static connectors to combined server#5765
jnfrati wants to merge 38 commits intomainfrom
feat/static-connectors

Conversation

@jnfrati
Copy link
Copy Markdown
Contributor

@jnfrati jnfrati commented Apr 1, 2026

Describe your changes

With the release of #5586 we now allow users to setup static connectors through management.json, which allows them to provision dex IdP entries directly through config, this PR introduces the same capability for the combined server.

Example config.yaml:

server:
  listenAddress: ":80"
  exposedAddress: "https://example.com:443"
  stunPorts:
    - 3478
  metricsPort: 9090
  healthcheckAddress: ":9000"
  logLevel: "info"
  logFile: "console"

  authSecret: "secret"
  dataDir: "/var/lib/netbird"

  auth:
    localAuthDisabled: true
    issuer: "https://example.com/oauth2"
    signKeyRefreshEnabled: true
    dashboardRedirectURIs:
      - "https://example.com/nb-auth"
      - "https://example.com/nb-silent-auth"
    cliRedirectURIs:
      - "http://localhost:53000/"
    staticConnectors:
      - type: keycloak
        name: keycloak
        id: keycloak
        config:
          issuer: "https://keycloak.domain.com/realms/netbird"
          clientID: clientId
          clientSecret: secret
          redirectURI: https://example.com/oauth2/callback


      - type: authentik
        name: authentik
        id: authentik
        config:
          issuer: https://authentik.domain.com/application/o/netbird/
          clientID: clientId
          clientSecret: secret
          redirectURI: https://example.com/oauth2/callback

  reverseProxy:
    trustedHTTPProxies:
      - "172.30.0.10/32"

  store:
    engine: "sqlite"
    encryptionKey: secretKey

Caveats

  • config.yaml parameters will override any "dashboard" change if the management server restarts
  • first user to log-in is the owner, no way to change this programatically

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features

    • Added support for configuring static identity provider connectors through configuration settings, providing enhanced flexibility in authentication provider setup.
  • Refactor

    • Updated internal type declarations to align with modern standards and improve code consistency.

calderbit and others added 30 commits February 18, 2026 01:13
…ation tool

Move ListUsers/UpdateUserID out of store.Store and activity.Store into migration-specific interfaces (MigrationStore, MigrationEventStore) so migration code can be cleanly removed later. Add tools/idp-migrate CLI that migrates user IDs and generates EmbeddedIdP management.json config
Entire-Checkpoint: 5eaefec1fa77
@jnfrati jnfrati requested review from braginini and shuuri-labs April 1, 2026 14:03
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b173f5c6-9aaf-4658-880c-ba043919d077

📥 Commits

Reviewing files that changed from the base of the PR and between d670e73 and cfa6793.

📒 Files selected for processing (2)
  • combined/cmd/config.go
  • idp/dex/config.go

📝 Walkthrough

Walkthrough

The changes introduce support for static connectors in authentication configuration and modernize type declarations to use Go's any type alias instead of interface{}. A new StaticConnectors field is added to the configuration structure and propagated to the embedded IdP configuration, while type definitions are updated for improved compatibility.

Changes

Cohort / File(s) Summary
Static Connectors Configuration
combined/cmd/config.go
Added StaticConnectors field of type []dex.Connector to AuthConfig struct with YAML field mapping, and propagated the value to idp.EmbeddedIdPConfig.StaticConnectors.
Type Modernization
idp/dex/config.go
Updated Connector struct's Config field type from map[string]interface{} to map[string]any for Go 1.18+ standards compliance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A new field hops in with connectors so fine,
Static paths declared, beautifully aligned.
Types now simplified, any takes the stage,
Modern Go whispers across every page,
Small changes, big clarity—the rabbit approves! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding static connectors support to the combined server configuration.
Description check ✅ Passed The description covers all required sections with detailed information: changes explanation, feature type selection, documentation update indication, and contributor agreement confirmation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/static-connectors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 1, 2026

@jnfrati jnfrati closed this Apr 1, 2026
@jnfrati jnfrati deleted the feat/static-connectors branch April 1, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants