Pds: PdsSessionService DI registration uses an ephemeral signing key — all sessions invalidate on restart #37
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
AddAtProtoPds()registersPdsSessionServicevia plain DI:Its constructor is
PdsSessionService(PdsOptions options, byte[]? signingKey = null)— DI can't supplybyte[], so every process start generates a random HMAC signing key, which invalidates all access/refresh tokens on every restart/redeploy. For a production PDS that means all clients are silently logged out whenever the container restarts.Workaround (what Updraft does): re-register after
AddAtProtoPdsso the last registration wins:Suggestion: add
PdsOptions.SessionSigningKey(base64) and have the default registration use it when set, with a startup warning when falling back to an ephemeral key.