Changeset 0.32.0 (#206)
This commit is contained in:
18
server/store/ticket_iface.go
Normal file
18
server/store/ticket_iface.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package store
|
||||
|
||||
import "context"
|
||||
|
||||
// TicketStore manages short-lived, single-use WebSocket auth tickets.
|
||||
// v0.32.0: replaces in-memory sync.Map for cross-pod ticket validation.
|
||||
type TicketStore interface {
|
||||
// Issue creates a single-use ticket for the given user.
|
||||
// Returns the opaque ticket ID (128-bit hex).
|
||||
Issue(ctx context.Context, userID string) (string, error)
|
||||
|
||||
// Validate atomically consumes a ticket and returns the user ID.
|
||||
// Returns ("", false) if the ticket is invalid, expired, or already consumed.
|
||||
Validate(ctx context.Context, ticketID string) (string, bool)
|
||||
|
||||
// Reap removes expired tickets. Returns the count deleted.
|
||||
Reap(ctx context.Context) (int, error)
|
||||
}
|
||||
Reference in New Issue
Block a user