26 lines
717 B
Go
26 lines
717 B
Go
// Package entity holds auth domain types shared by HTTP Bearer and TCP AUTH.
|
|
package entity
|
|
|
|
import "time"
|
|
|
|
// Principal is the authenticated identity.
|
|
type Principal struct {
|
|
UserID int64
|
|
DeviceID uint64
|
|
AppID uint32
|
|
JTI string
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
// IssuedToken is the login / refresh `data` payload.
|
|
type IssuedToken struct {
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
ExpiresIn int64 `json:"expires_in"`
|
|
RefreshExpiresIn int64 `json:"refresh_expires_in"`
|
|
UserID int64 `json:"user_id"`
|
|
DeviceID uint64 `json:"device_id"`
|
|
AppID uint32 `json:"app_id"`
|
|
SparkID string `json:"spark_id"`
|
|
}
|