Skip to content

Commit 4f89e3d

Browse files
committed
remove pkg/errors
1 parent 4a7c0b7 commit 4f89e3d

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ require (
1212
github.com/go-webauthn/webauthn v0.11.2
1313
github.com/gorilla/mux v1.8.1
1414
github.com/kelseyhightower/envconfig v1.4.0
15-
github.com/pkg/errors v0.9.1
1615
github.com/satori/go.uuid v1.2.0
1716
github.com/stretchr/testify v1.9.0
1817
golang.org/x/crypto v0.32.0

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ github.com/go-webauthn/webauthn v0.11.2 h1:Fgx0/wlmkClTKlnOsdOQ+K5HcHDsDcYIvtYmf
4444
github.com/go-webauthn/webauthn v0.11.2/go.mod h1:aOtudaF94pM71g3jRwTYYwQTG1KyTILTcZqN1srkmD0=
4545
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=
47-
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
48-
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
4947
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
5048
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
5149
github.com/google/go-tpm v0.9.3 h1:+yx0/anQuGzi+ssRqeD6WpXjW2L/V0dItUayO0i9sRc=
@@ -70,8 +68,6 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
7068
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
7169
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
7270
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
73-
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
74-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7571
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7672
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7773
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=

webauthnuser.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"crypto/sha256"
55
"encoding/base64"
66
"encoding/json"
7+
"errors"
78
"fmt"
89
"io"
910
"log"
1011
"net/http"
1112

1213
"github.com/fxamacker/cbor/v2"
13-
"github.com/pkg/errors"
1414

1515
"github.com/go-webauthn/webauthn/protocol"
1616
"github.com/go-webauthn/webauthn/protocol/webauthncose"
@@ -212,14 +212,14 @@ func (u *WebauthnUser) encryptAndStoreCredentials() error {
212212
func (u *WebauthnUser) Load() error {
213213
err := u.Store.Load(envConfig.WebauthnTable, WebAuthnTablePK, u.ID, u)
214214
if err != nil {
215-
return errors.Wrap(err, "failed to load user")
215+
return fmt.Errorf("failed to load user: %w", err)
216216
}
217217

218218
// decrypt SessionStorage if available
219219
if len(u.EncryptedSessionData) > 0 {
220220
plain, err := u.ApiKey.DecryptData(u.EncryptedSessionData)
221221
if err != nil {
222-
return errors.Wrap(err, "failed to decrypt encrypted session data")
222+
return fmt.Errorf("failed to decrypt encrypted session data: %w", err)
223223
}
224224

225225
// unmarshal decrypted session data into SessionData
@@ -236,14 +236,14 @@ func (u *WebauthnUser) Load() error {
236236
if len(u.EncryptedCredentials) > 0 {
237237
dec, err := u.ApiKey.DecryptData(u.EncryptedCredentials)
238238
if err != nil {
239-
return errors.Wrap(err, "failed to decrypt encrypted credential data")
239+
return fmt.Errorf("failed to decrypt encrypted credential data: %w", err)
240240
}
241241

242242
// unmarshal decrypted session data into Credentials
243243
var creds []webauthn.Credential
244244
err = json.Unmarshal(dec, &creds)
245245
if err != nil {
246-
return errors.Wrap(err, "failed to unmarshal credential data")
246+
return fmt.Errorf("failed to unmarshal credential data: %w", err)
247247
}
248248
u.Credentials = creds
249249
}

0 commit comments

Comments
 (0)