23 lines
319 B
Go
23 lines
319 B
Go
package session
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var ErrInvalidSessionID = errors.New("invalid session id")
|
|
|
|
const MaxIDLength = 64
|
|
|
|
type Revocation struct {
|
|
ID string
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
func ValidateID(id string) error {
|
|
if id == "" || len(id) > MaxIDLength {
|
|
return ErrInvalidSessionID
|
|
}
|
|
return nil
|
|
}
|