Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions crypto/dpop/dpop.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"net/http"
"net/url"
"slices"
"strings"
"time"

"github.com/lestrrat-go/jwx/v2/jwa"
Expand Down Expand Up @@ -158,18 +157,18 @@ func Parse(s string) (*DPoP, error) {
}
if v, ok := token.Get(HTUKey); !ok {
return nil, fmt.Errorf("%w: missing htu claim", ErrInvalidDPoP)
} else if s, ok := v.(string); !ok {
} else if htu, ok := v.(string); !ok {
return nil, fmt.Errorf("%w: invalid htu claim", ErrInvalidDPoP)
} else if s == "" {
} else if htu == "" {
return nil, fmt.Errorf("%w: missing htu claim", ErrInvalidDPoP)
} else if _, err := url.Parse(s); err != nil {
} else if _, err := url.Parse(htu); err != nil {
return nil, fmt.Errorf("%w: invalid htu claim: %w", ErrInvalidDPoP, err)
}
if v, ok := token.Get(HTMKey); !ok {
return nil, fmt.Errorf("%w: missing htm claim", ErrInvalidDPoP)
} else if s, ok := v.(string); !ok {
} else if htm, ok := v.(string); !ok {
return nil, fmt.Errorf("%w: invalid htm claim", ErrInvalidDPoP)
} else if s == "" {
} else if htm == "" {
return nil, fmt.Errorf("%w: missing htm claim", ErrInvalidDPoP)
}
if token.JwtID() == "" {
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,6 @@ github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b h1:80
github.com/nuts-foundation/crypto-ecies v0.0.0-20211207143025-5b84f9efce2b/go.mod h1:6YUioYirD6/8IahZkoS4Ypc8xbeJW76Xdk1QKcziNTM=
github.com/nuts-foundation/go-did v0.18.0 h1:IB0X8PrzDulpR1zAgDpaHfwoSjJpIhx5u1Tg8I2nnb8=
github.com/nuts-foundation/go-did v0.18.0/go.mod h1:4od1gAmCi9HjHTQGEvHC8pLeuXdXACxidAcdA52YScc=
github.com/nuts-foundation/go-leia/v4 v4.2.0 h1:o/bgYVCyTgsfgtaKmlrcUaJ2z4NwetERC98SUWwYajM=
github.com/nuts-foundation/go-leia/v4 v4.2.0/go.mod h1:Gw6bXqJLOAmHSiXJJYbVoj+Mowp/PoBRywO0ZPsVzA0=
github.com/nuts-foundation/go-leia/v4 v4.3.0 h1:R0qGISIeg2q/PCQTC9cuoBtA6cFu4WBV2DbmSOWKZyM=
github.com/nuts-foundation/go-leia/v4 v4.3.0/go.mod h1:Gw6bXqJLOAmHSiXJJYbVoj+Mowp/PoBRywO0ZPsVzA0=
github.com/nuts-foundation/go-stoabs v1.11.0 h1:q18jVruPdFcVhodDrnKuhq/24i0pUC/YXgzJS0glKUU=
Expand Down