-
Notifications
You must be signed in to change notification settings - Fork 2
/
structures.go
67 lines (56 loc) · 2.23 KB
/
structures.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package warp
//CollectedClientData represents the contextual bindings of both the WebAuthn
//Relying Party and the client.
type CollectedClientData struct {
Type string `json:"type"`
Challenge string `json:"challenge"`
Origin string `json:"origin"`
TokenBinding *TokenBinding `json:"tokenBinding,omitempty"`
}
//TokenBinding contains information about the state of the Token Binding
//protocol used when communicating with the Relying Party.
type TokenBinding struct {
Status TokenBindingStatus `json:"status"`
ID string `json:"id,omitempty"`
}
//TokenBindingStatus represents a token binding status value.
type TokenBindingStatus string
//enum values for the TokenBindingStatus type
const (
StatusSupported = "supported"
StatusPresent = "present"
)
//PublicKeyCredentialType defines the valid credential types.
type PublicKeyCredentialType string
//enum values for PublicKeyCredentialType type
const (
PublicKey PublicKeyCredentialType = "public-key"
)
//PublicKeyCredentialDescriptor contains the attributes that are specified by a
//caller when referring to a public key credential as an input parameter to the
//create() or get() methods.
type PublicKeyCredentialDescriptor struct {
Type PublicKeyCredentialType `json:"type"`
ID []byte `json:"id"`
Transports []AuthenticatorTransport `json:"transports,omitempty"`
}
//AuthenticatorTransport defines hints as to how clients might communicate with
//a particular authenticator in order to obtain an assertion for a specific
//credential.
type AuthenticatorTransport string
//enum values for AuthenticatorTransport type
const (
TransportUSB AuthenticatorTransport = "usb"
TransportNFC AuthenticatorTransport = "nfc"
TransportBLE AuthenticatorTransport = "ble"
TransportInternal AuthenticatorTransport = "internal"
)
//UserVerificationRequirement describes relying party user verification
//requirements
type UserVerificationRequirement string
//enum values for UserVerificationRequirement type
const (
VerificationRequired UserVerificationRequirement = "required"
VerificationPreferred UserVerificationRequirement = "preferred"
VerificationDiscouraged UserVerificationRequirement = "discouraged"
)