Skip to content

Commit

Permalink
fix: tag names
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Jul 14, 2024
1 parent 0d3ff19 commit 83f1c0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metadata/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ func (d *Decoder) Decode(r io.ReadCloser) (payload *PayloadJSON, err error) {

// DecodeBytes handles decoding raw bytes. If you have a read closer it's suggested to use Decode.
func (d *Decoder) DecodeBytes(bytes []byte) (payload *PayloadJSON, err error) {
payload = &PayloadJSON{}

var token *jwt.Token

if token, err = d.parser.Parse(string(bytes), func(token *jwt.Token) (any, error) {
Expand Down Expand Up @@ -153,6 +151,8 @@ func (d *Decoder) DecodeBytes(bytes []byte) (payload *PayloadJSON, err error) {

var decoder *mapstructure.Decoder

payload = &PayloadJSON{}

if decoder, err = mapstructure.NewDecoder(&mapstructure.DecoderConfig{
Metadata: nil,
Result: payload,
Expand Down
7 changes: 6 additions & 1 deletion metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ type Statement struct {
// The FIDO protocol family. The values "uaf", "u2f", and "fido2" are supported.
ProtocolFamily string

// he Metadata Schema version.
Schema uint16

// The FIDO unified protocol version(s) (related to the specific protocol family) supported by this authenticator.
Upv []Version

Expand Down Expand Up @@ -342,6 +345,7 @@ type StatementJSON struct {
AlternativeDescriptions map[string]string `json:"alternativeDescriptions"`
AuthenticatorVersion uint32 `json:"authenticatorVersion"`
ProtocolFamily string `json:"protocolFamily"`
Schema uint16 `json:"schema"`
Upv []Version `json:"upv"`
AuthenticationAlgorithms []AuthenticationAlgorithm `json:"authenticationAlgorithms"`
PublicKeyAlgAndEncodings []PublicKeyAlgAndEncoding `json:"publicKeyAlgAndEncodings"`
Expand Down Expand Up @@ -405,6 +409,7 @@ func (j StatementJSON) Parse() (statement Statement, err error) {
AlternativeDescriptions: j.AlternativeDescriptions,
AuthenticatorVersion: j.AuthenticatorVersion,
ProtocolFamily: j.ProtocolFamily,
Schema: j.Schema,
Upv: j.Upv,
AuthenticationAlgorithms: j.AuthenticationAlgorithms,
PublicKeyAlgAndEncodings: j.PublicKeyAlgAndEncodings,
Expand Down Expand Up @@ -834,7 +839,7 @@ type AuthenticatorGetInfoJSON struct {
MaxMsgSize uint `json:"maxMsgSize"`
PivUvAuthProtocols []uint `json:"pinUvAuthProtocols"`
MaxCredentialCountInList uint `json:"maxCredentialCountInList"`
MaxCredentialIdLength uint `json:"maxCredentialLength"`
MaxCredentialIdLength uint `json:"maxCredentialIdLength"`
Transports []string `json:"transports"`
Algorithms []PublicKeyCredentialParameters `json:"algorithms"`
MaxSerializedLargeBlobArray uint `json:"maxSerializedLargeBlobArray"`
Expand Down

0 comments on commit 83f1c0d

Please sign in to comment.