Skip to content

Commit aee328e

Browse files
authored
Merge pull request #96 from silinternational/develop
Release 2.3.7
2 parents 39be283 + 638b4a5 commit aee328e

File tree

9 files changed

+23
-37
lines changed

9 files changed

+23
-37
lines changed

.github/workflows/test-deploy-publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
needs: [ 'tests', 'lint' ]
5252
if: github.ref_name == 'main' || github.ref_name == 'develop'
5353
runs-on: ubuntu-latest
54-
concurrency:
54+
concurrency:
5555
group: deploy-${{ github.ref }}-${{ matrix.region }}
5656
cancel-in-progress: false
5757
strategy:
@@ -82,21 +82,21 @@ jobs:
8282
runs-on: ubuntu-latest
8383
steps:
8484
- name: Checkout code
85-
uses: actions/checkout@v4
86-
85+
uses: actions/checkout@v4
86+
8787
- name: Log in to Docker Hub
8888
uses: docker/login-action@v3
8989
with:
9090
username: ${{ secrets.DOCKERHUB_USERNAME }}
9191
password: ${{ secrets.DOCKERHUB_TOKEN }}
92-
92+
9393
- name: Log in to GitHub Container Registry
9494
uses: docker/login-action@v3
9595
with:
9696
registry: ghcr.io
97-
username: ${{ github.actor}}
98-
password: ${{ secrets.GITHUB_TOKEN}}
99-
97+
username: ${{ github.actor }}
98+
password: ${{ secrets.GITHUB_TOKEN }}
99+
100100
- name: Extract metadata (tags, labels) for Docker
101101
id: meta
102102
uses: docker/metadata-action@v5

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM golang:1.23
22

3-
RUN curl -o- -L --proto "=https" https://slss.io/install | VERSION=3.7.5 bash && \
3+
RUN curl -o- -L --proto "=https" https://slss.io/install | VERSION=3.39.0 bash && \
44
mv $HOME/.serverless/bin/serverless /usr/local/bin && \
55
ln -s /usr/local/bin/serverless /usr/local/bin/sls
66

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ require (
3434
github.com/aws/smithy-go v1.22.1 // indirect
3535
github.com/davecgh/go-spew v1.1.1 // indirect
3636
github.com/go-webauthn/x v0.1.16 // indirect
37-
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
37+
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
3838
github.com/google/go-tpm v0.9.3 // indirect
3939
github.com/google/uuid v1.6.0 // indirect
4040
github.com/jmespath/go-jmespath v0.4.0 // indirect
41-
github.com/kr/text v0.2.0 // indirect
41+
github.com/kr/pretty v0.3.1 // indirect
4242
github.com/mitchellh/mapstructure v1.5.0 // indirect
4343
github.com/pmezard/go-difflib v1.0.0 // indirect
44+
github.com/rogpeppe/go-internal v1.12.0 // indirect
4445
github.com/x448/float16 v0.8.4 // indirect
4546
golang.org/x/sys v0.29.0 // indirect
4647
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect

go.sum

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ github.com/go-webauthn/x v0.1.16 h1:EaVXZntpyHviN9ykjdRBQIw9B0Ed3LO5FW7mDiMQEa8=
4646
github.com/go-webauthn/x v0.1.16/go.mod h1:jhYjfwe/AVYaUs2mUXArj7vvZj+SpooQPyyQGNab+Us=
4747
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
4848
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
49+
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
50+
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
4951
github.com/google/go-tpm v0.9.3 h1:+yx0/anQuGzi+ssRqeD6WpXjW2L/V0dItUayO0i9sRc=
5052
github.com/google/go-tpm v0.9.3/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
5153
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -58,18 +60,23 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
5860
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
5961
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
6062
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
61-
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
6263
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
64+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
65+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
6366
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
6467
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
6568
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
6669
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
6770
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
6871
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
72+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
6973
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
7074
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7175
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7276
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
77+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
78+
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
79+
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
7380
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
7481
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
7582
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

server/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ func newRouter() *mux.Router {
9696

9797
// Assign the handlers to run when endpoints are called.
9898
for _, route := range routes {
99-
// Create a handler function.
100-
var handler http.Handler
101-
handler = route.HandlerFunc
102-
103-
router.Methods(route.Method).Path(route.Pattern).Name(route.Name).Handler(handler)
99+
router.Methods(route.Method).Path(route.Pattern).Name(route.Name).Handler(route.HandlerFunc)
104100
}
105101

106102
router.NotFoundHandler = router.NewRoute().HandlerFunc(notFound).GetHandler()

u2fserver/main.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ import (
88

99
"github.com/gorilla/mux"
1010

11-
mfa "github.com/silinternational/serverless-mfa-api-go"
1211
u2fsim "github.com/silinternational/serverless-mfa-api-go/u2fsimulator"
1312
)
1413

15-
var envConfig mfa.EnvConfig
16-
1714
func main() {
1815
log.SetOutput(os.Stdout)
1916
log.Println("U2f Simulator Server starting...")
@@ -51,11 +48,7 @@ func newRouter() *mux.Router {
5148

5249
// Assign the handlers to run when endpoints are called.
5350
for _, route := range routes {
54-
// Create a handler function.
55-
var handler http.Handler
56-
handler = route.HandlerFunc
57-
58-
router.Methods(route.Method).Path(route.Pattern).Name(route.Name).Handler(handler)
51+
router.Methods(route.Method).Path(route.Pattern).Name(route.Name).Handler(route.HandlerFunc)
5952
}
6053

6154
router.NotFoundHandler = router.NewRoute().HandlerFunc(notFound).GetHandler()

user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (u *DynamoUser) DeleteCredential(credIDHash string) (int, error) {
153153
}
154154

155155
if len(u.Credentials) == 0 {
156-
err := fmt.Errorf("error in DeleteCredential. No webauthn credentials available.")
156+
err := fmt.Errorf("error in DeleteCredential: no webauthn credentials available")
157157
return http.StatusNotFound, err
158158
}
159159

user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (ms *MfaSuite) Test_User_DeleteCredential() {
3535
user: testUser0,
3636
credID: "noMatchingCredID",
3737
wantStatus: http.StatusNotFound,
38-
wantErrContains: "No webauthn credentials available.",
38+
wantErrContains: "no webauthn credentials available",
3939
verifyFn: func(results *dynamodb.ScanOutput) {
4040
found := false
4141
for i := range results.Items {

webauthn_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"encoding/json"
88
"fmt"
99
"io/ioutil"
10-
"math/big"
1110
"net/http"
1211
"net/http/httptest"
1312
"strings"
@@ -728,16 +727,6 @@ func Test_GetSignatureForLogin(t *testing.T) {
728727
panic("error marshalling client data: " + err.Error())
729728
}
730729

731-
xyStr := "4843956129390645175905258525279791420276294952604174799584408071708240463528636134250956749795798585127919587881956611106672985015071877198253568414405109"
732-
733-
bigXY, ok := new(big.Int).SetString(xyStr, 16)
734-
if !ok {
735-
panic("Failed making bigint")
736-
}
737-
738-
xyData := []byte{4}
739-
xyData = append(xyData, bigXY.Bytes()...)
740-
741730
keyHandle := "virtKey11"
742731
_, authDataBytes1, privateKey := u2fsim.GetAuthDataAndPrivateKey(localAppID, keyHandle)
743732
signature := GenerateAuthenticationSig(authDataBytes1, clientData, privateKey)

0 commit comments

Comments
 (0)