From 1d1ff2477ff5006f1d61fe5dc51ad87897eb38a6 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Fri, 30 Oct 2020 15:18:14 -0600 Subject: [PATCH] Release v1.2.0 Signed-off-by: Ivan Kozlovic --- README.md | 4 ++-- header.go | 2 +- types_test.go | 7 ++++++- v2/header.go | 2 +- v2/types_test.go | 7 ++++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d3cb88a..9404398 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # JWT -A [JWT](https://jwt.io/) implementation that uses [nkeys](https://github.com/nats-io/nkeys) to digitally sign JWT tokens. +A [JWT](https://jwt.io/) implementation that uses [nkeys](https://github.com/nats-io/nkeys) to digitally sign JWT tokens. Nkeys use [Ed25519](https://ed25519.cr.yp.to/) to provide authentication of JWT claims. [![License Apache 2](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![ReportCard](http://goreportcard.com/badge/nats-io/jwt)](http://goreportcard.com/report/nats-io/jwt) -[![Build Status](https://travis-ci.org/nats-io/jwt.svg?branch=master)](http://travis-ci.org/nats-io/jwt) +[![Build Status](https://travis-ci.com/nats-io/jwt.svg?branch=master)](https://travis-ci.com/github/nats-io/jwt) [![GoDoc](http://godoc.org/github.com/nats-io/jwt?status.png)](http://godoc.org/github.com/nats-io/jwt) [![Coverage Status](https://coveralls.io/repos/github/nats-io/jwt/badge.svg?branch=master&t=NmEFup)](https://coveralls.io/github/nats-io/jwt?branch=master) diff --git a/header.go b/header.go index 44cfe2d..172fd63 100644 --- a/header.go +++ b/header.go @@ -23,7 +23,7 @@ import ( const ( // Version is semantic version. - Version = "1.0.1" + Version = "1.2.0" // TokenTypeJwt is the JWT token type supported JWT tokens // encoded and decoded by this library diff --git a/types_test.go b/types_test.go index 4315c16..0fd9a2f 100644 --- a/types_test.go +++ b/types_test.go @@ -38,9 +38,14 @@ func TestVersionMatchesTag(t *testing.T) { // We expect a tag of the form vX.Y.Z. If that's not the case, // we need someone to have a look. So fail if first letter is not // a `v` - if tag[0] != 'v' { + if len(tag) < 2 || tag[0] != 'v' { t.Fatalf("Expect tag to start with `v`, tag is: %s", tag) } + // Look only at tag from current 'v', that is v1 for this file. + if tag[1] != '1' { + // Ignore, it is not a v1 tag. + return + } // Strip the `v` from the tag for the version comparison. if Version != tag[1:] { t.Fatalf("Version (%s) does not match tag (%s)", Version, tag[1:]) diff --git a/v2/header.go b/v2/header.go index 4fe7920..c96880a 100644 --- a/v2/header.go +++ b/v2/header.go @@ -23,7 +23,7 @@ import ( const ( // Version is semantic version. - Version = "0.3.2" + Version = "2.0.0" // TokenTypeJwt is the JWT token type supported JWT tokens // encoded and decoded by this library diff --git a/v2/types_test.go b/v2/types_test.go index 4315c16..bc19363 100644 --- a/v2/types_test.go +++ b/v2/types_test.go @@ -38,9 +38,14 @@ func TestVersionMatchesTag(t *testing.T) { // We expect a tag of the form vX.Y.Z. If that's not the case, // we need someone to have a look. So fail if first letter is not // a `v` - if tag[0] != 'v' { + if len(tag) < 2 || tag[0] != 'v' { t.Fatalf("Expect tag to start with `v`, tag is: %s", tag) } + // Look only at tag from current 'v', that is v1 for this file. + if tag[1] != '2' { + // Ignore, it is not a v2 tag. + return + } // Strip the `v` from the tag for the version comparison. if Version != tag[1:] { t.Fatalf("Version (%s) does not match tag (%s)", Version, tag[1:])