Skip to content

Commit

Permalink
Merge pull request #116 from nats-io/release_1_2_0
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
kozlovic authored Oct 30, 2020
2 parents 7d55e83 + 1d1ff24 commit 057ba30
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
Expand Down
2 changes: 1 addition & 1 deletion v2/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion v2/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
Expand Down

0 comments on commit 057ba30

Please sign in to comment.