-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pr/rhansen/310
- Loading branch information
Showing
10 changed files
with
125 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: coverage | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
coverage: | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
VOUCH_ROOT: ${{ github.workspace }}/src/github.com/${{ github.repository }} | ||
defaults: | ||
run: | ||
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: ['1.14', '1.15'] | ||
# go: ['1.15'] | ||
|
||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | ||
- name: goget | ||
run: ./do.sh goget | ||
- name: coverage test | ||
run: ./do.sh coverage | ||
|
||
- name: Send coverage | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/.cover/cover.out | ||
flag-name: Go-${{ matrix.go }} | ||
parallel: true | ||
|
||
# notifies that all test jobs are finished. | ||
finish: | ||
needs: coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
parallel-finished: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ func BenchmarkValidateRequestHandler(b *testing.B) { | |
tokens := structs.PTokens{} | ||
customClaims := structs.CustomClaims{} | ||
|
||
userTokenString := jwtmanager.CreateUserTokenString(*user, customClaims, tokens) | ||
userTokenString, err := jwtmanager.NewVPJWT(*user, customClaims, tokens) | ||
assert.NoError(b, err) | ||
|
||
c := &http.Cookie{ | ||
// Name: cfg.Cfg.Cookie.Name + "_1of1", | ||
|
@@ -80,12 +81,13 @@ func TestValidateRequestHandlerPerf(t *testing.T) { | |
tokens := structs.PTokens{} | ||
customClaims := structs.CustomClaims{} | ||
|
||
userTokenString := jwtmanager.CreateUserTokenString(*user, customClaims, tokens) | ||
vpjwt, err := jwtmanager.NewVPJWT(*user, customClaims, tokens) | ||
assert.NoError(t, err) | ||
|
||
c := &http.Cookie{ | ||
// Name: cfg.Cfg.Cookie.Name + "_1of1", | ||
Name: cfg.Cfg.Cookie.Name, | ||
Value: userTokenString, | ||
Value: vpjwt, | ||
Expires: time.Now().Add(1 * time.Hour), | ||
} | ||
|
||
|
@@ -169,7 +171,8 @@ func TestValidateRequestHandlerWithGroupClaims(t *testing.T) { | |
Email: "[email protected]", | ||
Name: "Test Name", | ||
} | ||
userTokenString := jwtmanager.CreateUserTokenString(*user, customClaims, tokens) | ||
vpjwt, err := jwtmanager.NewVPJWT(*user, customClaims, tokens) | ||
assert.NoError(t, err) | ||
|
||
req, err := http.NewRequest("GET", "/validate", nil) | ||
if err != nil { | ||
|
@@ -179,7 +182,7 @@ func TestValidateRequestHandlerWithGroupClaims(t *testing.T) { | |
req.AddCookie(&http.Cookie{ | ||
// Name: cfg.Cfg.Cookie.Name + "_1of1", | ||
Name: cfg.Cfg.Cookie.Name, | ||
Value: userTokenString, | ||
Value: vpjwt, | ||
Expires: time.Now().Add(1 * time.Hour), | ||
}) | ||
|
||
|
@@ -229,7 +232,8 @@ func TestJWTCacheHandler(t *testing.T) { | |
tokens := structs.PTokens{} | ||
customClaims := structs.CustomClaims{} | ||
|
||
jwt := jwtmanager.CreateUserTokenString(*user, customClaims, tokens) | ||
jwt, err := jwtmanager.NewVPJWT(*user, customClaims, tokens) | ||
assert.NoError(t, err) | ||
badjwt := strings.ReplaceAll(jwt, "a", "z") | ||
badjwt = strings.ReplaceAll(badjwt, "b", "x") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.