- Rename `par` to `pred` (predecessor) in types, serialization, tests - Remove `pol`, `pol_decision` from core payload; move to `ect_ext` - Remove `sub` from payload (not part of ECT spec) - Update `typ` from `wimse-exec+jwt` to `exec+jwt` (accept both) - Rename MaxParLength to MaxPredLength everywhere - Update testdata, demos, READMEs with migration table - All Go tests pass, all 56 Python tests pass (90% coverage)
28 lines
1.5 KiB
Go
28 lines
1.5 KiB
Go
package ect
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors for programmatic handling and logging.
|
|
var (
|
|
ErrPayloadRequired = errors.New("ect: payload and privateKey required")
|
|
ErrKeyIDRequired = errors.New("ect: KeyID required")
|
|
ErrInvalidTyp = errors.New("ect: invalid typ parameter")
|
|
ErrProhibitedAlg = errors.New("ect: prohibited algorithm")
|
|
ErrMissingKid = errors.New("ect: missing kid")
|
|
ErrUnknownKey = errors.New("ect: unknown key identifier")
|
|
ErrWITSubjectMismatch = errors.New("ect: issuer does not match WIT subject")
|
|
ErrAudienceMismatch = errors.New("ect: audience does not include verifier")
|
|
ErrExpired = errors.New("ect: token expired")
|
|
ErrIATTooOld = errors.New("ect: iat too far in the past")
|
|
ErrIATInFuture = errors.New("ect: iat in the future")
|
|
ErrMissingClaims = errors.New("ect: missing required claims (jti, exec_act, pred)")
|
|
ErrReplay = errors.New("ect: jti already seen (replay)")
|
|
ErrResolveKeyRequired = errors.New("ect: ResolveKey required")
|
|
ErrExtSize = errors.New("ect: ext exceeds max size (4096 bytes)")
|
|
ErrExtDepth = errors.New("ect: ext exceeds max nesting depth (5)")
|
|
ErrInvalidJTI = errors.New("ect: jti must be UUID format")
|
|
ErrInvalidWID = errors.New("ect: wid must be UUID format when set")
|
|
ErrPredLength = errors.New("ect: pred exceeds max length")
|
|
ErrHashFormat = errors.New("ect: inp_hash/out_hash must be algorithm:base64url (e.g. sha-256:...)")
|
|
)
|