Skip to content

Feat/named sessions - #16

Merged
raymondproguy merged 8 commits into
mainfrom
feat/named-sessions
Sep 13, 2026
Merged

raymondproguy merged 8 commits into
mainfrom
feat/named-sessions

Conversation

@raymondproguy

Copy link
Copy Markdown
Contributor

No description provided.

The two halves of a session label. Parsing ships for real — it needs
nothing the session doesn't already store. Locating an address needs
an outbound call or a licensed database, so IPGeolocator ships with
zero implementations, exactly like BreachedPasswordChecker.
Computed on read from the IP and User-Agent a session already carries,
so there is no schema change and no migration — every session ever
recorded gets a label the first time ListNamed is called. One
geolocator lookup per distinct IP, and an error means "unknown", not a
failed listing.
A new facade beside ListSessions/ListPublicSessions rather than a
change to either — existing callers keep their return types. Geolocator
is optional in the same way BreachedPasswordChecker is: unset means the
feature quietly does less, never that a call fails.
The parser is tested against authentic User-Agent strings, since the
only real risk in it is that browsers impersonate each other inside the
header. The rest covers the promises: one lookup per distinct IP, and a
failing geolocator costs a label, never the listing.
42 checks over seven scenarios, including the two that matter most: a
down geolocator costs a label and never the listing, and a session
recorded before any geolocator existed gets a located label the moment
one is configured — nothing is stored, so nothing needs backfilling.
Covers the interface contract a host implements, the User-Agent traps
worth checking by hand (browsers impersonate each other in the header),
and the upgrade check that matters: labels are computed on read, so
existing sessions gain them with no migration.
Item 10's labels are computed on read, so the branch note also records
that it carries items 8 and 9 and how it would separate from them.
@raymondproguy
raymondproguy merged commit 91a3eac into main Sep 13, 2026
1 check failed
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.

1 participant