Skip to content

Commit 95cebd1

Browse files
authored
Merge pull request #9 from fujiwara/real_test
Real test
2 parents 51ba9d4 + f3252eb commit 95cebd1

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

.github/workflows/go.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ jobs:
55
strategy:
66
matrix:
77
go:
8-
- 1.16
9-
- 1.17
8+
- 1.18
9+
- 1.19
1010
name: Build
1111
runs-on: ubuntu-latest
1212

1313
steps:
1414
- name: Set up Go
15-
uses: actions/setup-go@v1
15+
uses: actions/setup-go@v3
1616
with:
1717
go-version: ${{ matrix.go }}
1818
id: go
1919

2020
- name: Check out code into the Go module directory
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222

2323
- name: Build & Test
2424
run: |

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.17
19+
go-version: 1.19
2020
- name: Run GoReleaser
21-
uses: goreleaser/goreleaser-action@v1
21+
uses: goreleaser/goreleaser-action@v4
2222
with:
2323
version: latest
2424
args: release

validator/real_test.go

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package validator_test
2+
3+
import (
4+
"io/ioutil"
5+
"os"
6+
"strings"
7+
"testing"
8+
9+
"github.com/fujiwara/go-amzn-oidc/validator"
10+
)
11+
12+
func TestRealJWT(t *testing.T) {
13+
testJWT := "testdata/test.jwt"
14+
if _, err := os.Stat(testJWT); err != nil {
15+
t.Skipf("%s is not found", testJWT)
16+
}
17+
f, _ := os.Open(testJWT)
18+
b, _ := ioutil.ReadAll(f)
19+
f.Close()
20+
21+
token := strings.TrimSpace(string(b))
22+
t.Log(token)
23+
c, err := validator.Validate(token)
24+
if err != nil {
25+
t.Error(err)
26+
}
27+
t.Log(c)
28+
}

validator/testdata/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.jwt

0 commit comments

Comments
 (0)