From 3521250816687dd6f484a08f98fb1840a1e4b4c9 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Fri, 12 Apr 2024 13:56:31 +0200 Subject: [PATCH] Small updates (#4) --- README.md | 2 +- go.mod | 2 +- paseto.go | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 89644b8..8d274fe 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See [docs][pkg-url] or [GUIDE.md](https://github.com/cristalhq/paseto/blob/main/ ## Install -Go version 1.18+ +Go version 1.21+ ``` go get github.com/cristalhq/paseto diff --git a/go.mod b/go.mod index 032d967..80e1db2 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module paseto -go 1.18 +go 1.21 diff --git a/paseto.go b/paseto.go index 7520173..6c11652 100644 --- a/paseto.go +++ b/paseto.go @@ -2,6 +2,20 @@ package paseto import "encoding/json" +type TokenType uint + +const ( + TokenUnknown TokenType = 0 + TokenV1Local TokenType = 1 + TokenV1Public TokenType = 2 + TokenV2Local TokenType = 3 + TokenV2Public TokenType = 4 + TokenV3Local TokenType = 5 + TokenV3Public TokenType = 6 + TokenV4Local TokenType = 7 + TokenV4Public TokenType = 8 +) + type Token struct { typ TokenType raw []byte @@ -67,17 +81,3 @@ func (t *Token) DecodeFooter(dst any) error { func (t *Token) isValid() bool { return t != nil && len(t.raw) > 0 } - -type TokenType uint - -const ( - TokenUnknown TokenType = 0 - TokenV1Local TokenType = 1 - TokenV1Public TokenType = 2 - TokenV2Local TokenType = 3 - TokenV2Public TokenType = 4 - TokenV3Local TokenType = 5 - TokenV3Public TokenType = 6 - TokenV4Local TokenType = 7 - TokenV4Public TokenType = 8 -)