Skip to content

feat(auth): support auth-provider connection checks and managed role claims #554

Closed

Description

@zippyy

Problem

Silo authentication plugins can validate credentials and return identity claims, but the host currently has no generic way to:

  1. test staged authentication-provider configuration before saving it; or
  2. opt into synchronizing the linked Silo account's coarse user / admin role from a trusted external provider.

This was encountered while deploying an LDAP authentication provider against Active Directory. The provider can determine group membership, but only the Silo host owns local account roles, permissions, and access-group assignment.

Proposed host contract

Connection checks

An auth_provider.v1 capability advertises:

{"connection_test": true}

When an administrator tests staged configuration, Silo starts a temporary plugin instance with the staged values and sends an AuthenticateRequest whose metadata contains boolean connection_test=true. The request contains no username or password. Providers that do not advertise the capability retain existing behavior.

Managed roles

After successful authentication, a provider may return both:

{
  "silo_role_managed": true,
  "silo_role": "user"
}

The host ignores silo_role unless the explicit managed marker is boolean true. Only user and admin are accepted. Malformed managed claims fail authentication instead of partially applying authorization state.

Promotion clears the normal-user access group. Demotion restores default user permissions and the current default access group. Each transition is logged with the installation, capability, user, previous role, and new role.

Trust model

Authentication plugins already execute trusted server-side code and receive credentials for their provider. Managed-role support additionally permits a trusted provider to promote or demote accounts linked to that installation. The contract is deliberately limited to user and admin; providers cannot set arbitrary permissions, libraries, or access-group IDs.

A working local administrator account remains required for recovery.

Compatibility

The proposal uses existing protobuf Struct metadata and claims, so the v1 wire schema remains additive. Providers that omit these fields are unchanged. A future typed SDK RPC or field can supersede the convention while preserving these keys for compatibility.

Companion implementation

The reference consumer is the TechRelay LDAP plugin, which maps configured direct LDAP/AD administrator groups to the managed role claim. Nested-group resolution remains explicitly out of scope.

Adversarial review

The review identified and addressed these risks in the proposed implementation:

  • a bare silo_role claim could accidentally or silently alter accounts — an explicit boolean managed marker is now required;
  • role transitions were not auditable — structured transition logging was added;
  • the auth provider queried access_groups directly — default-group lookup was moved to UserRepository;
  • demotion can replace prior custom authorization state — the default-reset behavior is now explicit and documented;
  • LDAP diagnostics could expose internal directory details — the companion plugin now logs full errors but returns only stable operation stages.

Open design question: whether these compatibility keys should first be formalized in the plugin SDK as constants or replaced by typed fields/RPCs before merge.

AI Disclosure

  • Tool(s): ChatGPT with the GitHub connector
  • Model(s): GPT-5.6 Thinking
  • Involvement: AI-assisted; the human supplied the real deployment requirements and expected behavior, while AI implemented and reviewed the changes
  • Adversarial review: summarized above; each confirmed finding was either fixed in code or called out as an explicit design tradeoff

Activity

  1. zippyy commented on Aug 7, 2026

    @zippyy
    Author

    Implementation is now split into focused draft PRs:

    The original combined draft #555 was closed as superseded. All active PRs remain drafts pending workflow execution, maintainer design feedback, and live LDAP/AD revalidation.

  2. zippyy commented on Aug 7, 2026

    @zippyy
    Author

    Closing this issue because it was opened prematurely before the TechRelay fork work had been reviewed and approved for upstream discussion. The design notes will remain in the fork and can be resubmitted intentionally later.

  3. added
    triaged
    and removed
    triaged
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions