Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small updates #4

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
# See https://github.com/cristalhq/.github/.github/workflows
jobs:
build:
uses: cristalhq/.github/.github/workflows/build.yml@v0.6.0
uses: cristalhq/.github/.github/workflows/build.yml@v0.8.1

vuln:
uses: cristalhq/.github/.github/workflows/vuln.yml@v0.6.0
uses: cristalhq/.github/.github/workflows/vuln.yml@v0.8.1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module paseto

go 1.18
go 1.21
28 changes: 14 additions & 14 deletions paseto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Loading