20 lines
468 B
Go
20 lines
468 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// WriteKey is the auth credential supplied via Authorization header.
|
|
// We never store the raw value — only its sha256 hash and a short prefix
|
|
// for display in the console.
|
|
type WriteKey struct {
|
|
ID string
|
|
WorkspaceID string
|
|
SourceID string
|
|
KeyPrefix string
|
|
Label string
|
|
RevokedAt *time.Time
|
|
LastUsedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
func (k *WriteKey) Revoked() bool { return k.RevokedAt != nil }
|