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

Next major v5 #133

Merged
merged 7 commits into from
Feb 19, 2023
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
18 changes: 6 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
name: build

permissions: read-all

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
inputs:
tag:
description: 'Tag to create'
required: true
default: 'v0.0.0'
schedule:
- cron: '0 0 * * 0'

# See https://github.com/cristalhq/.github/.github/workflows
jobs:
build:
uses: cristalhq/.github/.github/workflows/build.yml@d8f219c7111863d360a6c6f978ee64d6371a045e # latest @ main
uses: cristalhq/.github/.github/workflows/build.yml@main

codeql:
if: github.event.repository.public
permissions:
security-events: write
uses: cristalhq/.github/.github/workflows/codeql.yml@d8f219c7111863d360a6c6f978ee64d6371a045e # latest @ main
uses: cristalhq/.github/.github/workflows/codeql.yml@main

release:
if: github.event_name == 'workflow_dispatch'
uses: cristalhq/.github/.github/workflows/release.yml@d8f219c7111863d360a6c6f978ee64d6371a045e # latest @ main
permissions:
contents: write
uses: cristalhq/.github/.github/workflows/release.yml@main
with:
tag: ${{ github.event.input.tag }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

JSON Web Token for Go [RFC 7519](https://tools.ietf.org/html/rfc7519), also see [jwt.io](https://jwt.io) for more.

The latest version is `v4`.
The latest version is `v5`.

## Rationale

Expand Down Expand Up @@ -36,7 +36,7 @@ See [GUIDE.md](https://github.com/cristalhq/jwt/blob/main/GUIDE.md) for more det
Go version 1.17+

```
go get github.com/cristalhq/jwt/v4
go get github.com/cristalhq/jwt/v5
```

## Example
Expand Down Expand Up @@ -108,8 +108,8 @@ See [these docs][pkg-url].

[build-img]: https://github.com/cristalhq/jwt/workflows/build/badge.svg
[build-url]: https://github.com/cristalhq/jwt/actions
[pkg-img]: https://pkg.go.dev/badge/cristalhq/jwt/v4
[pkg-url]: https://pkg.go.dev/github.com/cristalhq/jwt/v4
[pkg-img]: https://pkg.go.dev/badge/cristalhq/jwt/v5
[pkg-url]: https://pkg.go.dev/github.com/cristalhq/jwt/v5
[reportcard-img]: https://goreportcard.com/badge/cristalhq/jwt
[reportcard-url]: https://goreportcard.com/report/cristalhq/jwt
[coverage-img]: https://codecov.io/gh/cristalhq/jwt/branch/main/graph/badge.svg
Expand Down
1 change: 0 additions & 1 deletion algo_es_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ var (
// openssl ecparam -name secp384r1 -genkey -noout -out es384-private.pem
// ES512
// openssl ecparam -name secp521r1 -genkey -noout -out es521-private.pem
//
const (
testKeyES256 = `-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIM+a8cZ6BjdZBYy7pMIqmWsHKSmAZhZ/RTeSkmzPKohfoAoGCCqGSM49
Expand Down
1 change: 0 additions & 1 deletion algo_rs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ var (
// openssl genrsa -out rs384-2048-private.rsa 2048
// RS512
// openssl genrsa -out rs512-4096-private.rsa 4096
//
const (
testKeyRSA1024 = `-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDZY2zMlYH8Onz1eAxYc6IdyPT5AmVsae/Q2+wuhFcf6DrGRrBj
Expand Down
1 change: 0 additions & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func NewBuilder(signer Signer, opts ...BuilderOption) *Builder {
// Build used to create and encode JWT with a provided claims.
// If claims param is of type []byte or string then it's treated as a marshaled JSON.
// In other words you can pass already marshaled claims.
//
func (b *Builder) Build(claims interface{}) (*Token, error) {
rawClaims, errClaims := encodeClaims(claims)
if errClaims != nil {
Expand Down
1 change: 0 additions & 1 deletion claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

// RegisteredClaims represents claims for JWT.
// See: https://tools.ietf.org/html/rfc7519#section-4.1
//
type RegisteredClaims struct {
// ID claim provides a unique identifier for the JWT.
ID string `json:"jti,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
// Builder, all Signers and Verifiers are safe for use by multiple goroutines simultaneously.
//
// See [RFC 7519](https://tools.ietf.org/html/rfc7519) and see [jwt.io](https://jwt.io) for more.
//
package jwt
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/cristalhq/jwt/v4"
"github.com/cristalhq/jwt/v5"
)

func ExampleSignAndVerify() {
Expand Down
1 change: 0 additions & 1 deletion fuzz.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build gofuzz
// +build gofuzz

// To run the fuzzer, run the following commands:
// $ GO111MODULE=off go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cristalhq/jwt/v4
module github.com/cristalhq/jwt/v5

go 1.17
go 1.19
2 changes: 0 additions & 2 deletions jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

// Token represents a JWT token.
// See: https://tools.ietf.org/html/rfc7519
//
type Token struct {
raw []byte
dot1 int
Expand Down Expand Up @@ -73,7 +72,6 @@ func (t *Token) isValid() bool {

// Header representa JWT header data.
// See: https://tools.ietf.org/html/rfc7519#section-5, https://tools.ietf.org/html/rfc7517
//
type Header struct {
Algorithm Algorithm `json:"alg"`
Type string `json:"typ,omitempty"` // only "JWT" can be here
Expand Down
2 changes: 1 addition & 1 deletion jwt_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/cristalhq/jwt/v4"
"github.com/cristalhq/jwt/v5"
)

func BenchmarkAlgEDSA(b *testing.B) {
Expand Down
1 change: 0 additions & 1 deletion numeric_date.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

// NumericDate represents date for StandardClaims
// See: https://tools.ietf.org/html/rfc7519#section-2
//
type NumericDate struct {
time.Time
}
Expand Down