class

KemalIdentity::Postgres::LinkRepository

Inherits KemalIdentity::Federation::LinkRepository < Reference < Object

Federation::LinkRepository over auth_external_identities.

The unique index on (issuer, subject) is doing the security work here: without it one provider account can be attached to two local ones, and whichever row is found first decides who somebody logs in as. A duplicate is surfaced as an InfrastructureError rather than absorbed.

Constants

COLUMNS = "id, account_id, issuer, subject, created_at, last_authenticated_at"
UNIQUE_VIOLATION = "23505"

Constructors

Instance methods

touch(issuer : String, subject : String, at : Time) : Bool

Records that this link was just used to authenticate. Returns false for an unknown pair.

Source