Skip to content

Identity layer, part 1: foundations and session hardening (Phase 0) #458

Open

Description

@caseysoftware

Intent: prepare authentication, user records and sessions for single sign-on and provisioning, without changing how anyone logs in today.

Already done on dev-5.0.0: session id no longer in redirect URLs (e445eefa); session id regenerated at login (3d68dea5); Secure/HttpOnly/SameSite=Lax session cookie (c8b01906); lost password works again (c28135bd).

Before starting: #436, #437, #439, #440, #441, #442, #444, #445.

Steps

  • Split CAppUI::login() into a password authenticator, w2p_Auth_AccountResolver and w2p_Auth_SessionEstablisher; fileviewer.php uses the same path instead of its own copy.
  • Interfaces w2p_Interfaces_PasswordAuthenticator and w2p_Interfaces_FederatedProvider, value object w2p_Auth_Identity, and w2p_Auth_ProviderRegistry with sql and ldap providers. getAuth() and w2p_Authenticators_SQL/_LDAP stay as shims for one release. Remove w2p_Authenticators_PostNuke and its pn option.
  • Migrations: users.user_status, user_source, user_external_id, user_auth_epoch, user_last_login, user_allow_local_login; unique user_username (users.user_username has no unique index #438); tables identity_providers (the auth_method/ldap_* settings move here) and user_identities.
  • Every request checks user_status and user_auth_epoch (How often is a signed-in user's status re-checked? #455); disabling a user ends their sessions and stops their calendar feed.
  • w2p_Provisioning_Service skeleton; LDAP first-login creation moves onto it.
  • w2p_Security_SecretStore (sodium, W2P_APP_KEY or env: references), shared with Where are backend configuration and secrets stored? #413; the LDAP bind and SMTP passwords move into it.
  • w2p_Security_RateLimiter for password logins.
  • Token-based password reset (Lost password replaces the password immediately instead of sending a reset link #443).
  • session.use_strict_mode.

Goal: existing SQL and LDAP logins pass the regression suite unchanged, and a disabled user is cut off on their next request.

Spec: Identity Layer proposal (#435).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions