Skip to content

feat: SSO authentication on coordinators - #4399

Merged
as51340 merged 25 commits into
masterfrom
feat/sso-coords
Aug 3, 2026
Merged

feat: SSO authentication on coordinators#4399
as51340 merged 25 commits into
masterfrom
feat/sso-coords

Conversation

@as51340

@as51340 as51340 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Enables SSO HA authentication on coords. SSO is enabled when --auth-module-mappings flag is set to true and role with write privilege exists. In that case basic auth using username and password is forbidden.

Also:

  • fixes flaky tests/drivers.
  • removes unused EnableWritingOnMainRpc.
  • adds forwarding for SetCoordinatorSetting.
  • Fixes RPC timeouts for follower->leader communication and system db rpc messages

⚠️ Breaking change: the COORDINATOR privilege is removed

This PR removes the COORDINATOR privilege (Permission::COORDINATOR, AuthQuery::Privilege::COORDINATOR) and drops it from the privilege grammar rule. It never gated any operation, but it was grantable, so removing it is user visible:

  • GRANT / DENY / REVOKE COORDINATOR no longer parses. Any provisioning script, migration, or IaC step that runs e.g. GRANT COORDINATOR TO some_role; now fails with a syntax error instead of succeeding. Such statements must be deleted — they were always no-ops.
  • SHOW PRIVILEGES no longer reports COORDINATOR, and it is gone from kPermissionsAll / kPrivilegesAll, so GRANT ALL PRIVILEGES no longer includes it. Tooling that snapshots or diffs the full privilege list sees one fewer entry.
  • Existing grants need no migration. Bit 25 is left reserved and is deliberately not reused, so a durably stored mask with bit 25 set is never reinterpreted as some other privilege. Permissions::GetGrants()/GetDenies() iterate kPermissionsAll, so a stale bit is simply never reported and never checked — it is inert. It also can no longer be revoked via Cypher, which is harmless for the same reason.
  • The new COORDINATOR_READ / COORDINATOR_WRITE privileges are not a drop-in replacement. They are coordinator-only: EditPermissions rejects them on a data instance, and they gate the coordinator Cypher surface for SSO sessions. A GRANT COORDINATOR on a data instance has no equivalent to rewrite it to, because it never granted anything in the first place.

Documented as a breaking change in the v3.13.0 release notes.

@as51340 as51340 added this to the mg-v3.13.0 milestone Jul 13, 2026
@as51340 as51340 self-assigned this Jul 13, 2026
@as51340 as51340 added feature feature Capability - high-availability customer customer CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push labels Jul 13, 2026
@as51340 as51340 changed the title docs: Add spec for SSO on coords feat: Add spec for SSO on coords Jul 13, 2026
Comment thread specs/coordinator-sso-auth/issues/04-role-query-forwarding.md Outdated
@as51340 as51340 changed the title feat: Add spec for SSO on coords feat: SSO HA authentication on coords Jul 13, 2026
@as51340 as51340 added the Docs needed Docs needed label Jul 16, 2026
@as51340
as51340 requested a review from andrejtonev July 20, 2026 06:11
@as51340
as51340 marked this pull request as ready for review July 20, 2026 06:11
@as51340 as51340 changed the title feat: SSO HA authentication on coords feat: SSO authentication on coordinators Jul 20, 2026
Comment thread src/coordination/coordinator_instance.cpp
Comment thread src/coordination/include/coordination/coordinator_rpc.hpp Outdated
Comment thread src/query/frontend/ast/query/auth_query.hpp Outdated
Comment thread src/rpc/client.hpp
Comment thread src/coordination/coordinator_instance.cpp Outdated
Comment thread src/glue/SessionHL.cpp
Comment thread src/glue/coordinator_sso_authenticator.hpp Outdated
Comment thread src/coordination/include/coordination/coordinator_ops_status.hpp Outdated
Comment thread src/communication/bolt/v1/states/init.hpp Outdated
Comment thread src/glue/SessionHL.cpp
@as51340
as51340 requested a review from andrejtonev July 22, 2026 07:03
Comment thread src/communication/bolt/v1/states/init.hpp
Comment thread src/rpc/client.hpp
Comment thread src/communication/bolt/v1/states/init.hpp
Comment thread src/coordination/coordinator_cluster_state.cpp
Comment thread src/communication/bolt/v1/states/init.hpp Outdated
Comment thread src/query/interpreter.hpp
Comment thread src/query/frontend/opencypher/grammar/MemgraphCypher.g4
Comment thread src/coordination/coordinator_instance.cpp Outdated
Comment thread coords_auth.md Outdated
@as51340
as51340 requested a review from andrejtonev July 31, 2026 06:05
as51340 added 17 commits July 31, 2026 15:07
Re-read the --context-yaml file before starting instances so startup flags
edited while instances are stopped take effect on the next start, without
restarting the runner.

The context dict is mutated in place because the interactive loop and the
ACTIONS closures hold a reference to it. A missing or unparsable file keeps
the current description instead of tearing down the session. Instances that
are still running warn that their reloaded args are ignored, and a running
instance removed from the YAML keeps its old description so it can still be
stopped from the runner.
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@as51340
as51340 added this pull request to the merge queue Aug 3, 2026
Merged via the queue into master with commit 572d5b4 Aug 3, 2026
38 checks passed
@as51340
as51340 deleted the feat/sso-coords branch August 3, 2026 14:25
@as51340

as51340 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • Adds support for SSO authentication on coordinators using coordinators' roles. Users are not supported. In order to support HA routing connection, the same role needs to exist on both coordinators and data instances. Two privileges are added: COORDINATOR_READ and COORDINATOR_WRITE. Roles without any privilege cannot be used for authentication. This PR removes the COORDINATOR privilege (Permission::COORDINATOR, AuthQuery::Privilege::COORDINATOR) and drops it from the privilege grammar rule. It never gated any operation, but it was grantable, so removing it is user visible. #4399
    • What has changed? What does it mean for a user? What should a user do with it? [#{{PR_number}}]({{link to the PR}})
  • Documentation PR link
    • Is back linked to this development PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Capability - high-availability CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push customer customer Docs needed Docs needed feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants