-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreation.go
66 lines (57 loc) · 2.82 KB
/
creation.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
package warp
//PublicKeyCredentialCreationOptions represent options for credential creation
type PublicKeyCredentialCreationOptions struct {
RP PublicKeyCredentialRPEntity `json:"rp"`
User PublicKeyCredentialUserEntity `json:"user"`
Challenge []byte `json:"challenge"`
PubKeyCredParams []PublicKeyCredentialParameters `json:"pubKeyCredParams"`
Timeout uint `json:"timeout,omitempty"`
ExcludeCredentials []PublicKeyCredentialDescriptor `json:"excludeCredentials,omitempty"`
AuthenticatorSelection *AuthenticatorSelectionCriteria `json:"authenticatorSelection,omitempty"`
Attestation AttestationConveyancePreference `json:"attestation,omitempty"`
Extensions AuthenticationExtensionsClientInputs `json:"extensions,omitempty"`
}
//PublicKeyCredentialEntity describes a user account, or a WebAuthn Relying
//Party, which a public key credential is associated with or scoped to,
//respectively.
type PublicKeyCredentialEntity struct {
Name string `json:"name"`
Icon string `json:"icon,omitempty"`
}
//PublicKeyCredentialRPEntity is used to supply additional Relying Party
//attributes when creating a new credential.
type PublicKeyCredentialRPEntity struct {
PublicKeyCredentialEntity
ID string `json:"id,omitempty"`
}
//PublicKeyCredentialUserEntity is used to supply additional user account
//attributes when creating a new credential.
type PublicKeyCredentialUserEntity struct {
PublicKeyCredentialEntity
ID []byte `json:"id"`
DisplayName string `json:"displayName"`
}
//AuthenticatorSelectionCriteria may be used to specify their requirements
//regarding authenticator attributes.
type AuthenticatorSelectionCriteria struct {
AuthenticatorAttachment AuthenticatorAttachment `json:"authenticatorAttachment,omitempty"`
RequireResidentKey bool `json:"requireResidentKey,omitempty"`
UserVerification UserVerificationRequirement `json:"userVerification,omitempty"`
}
//AuthenticatorAttachment describes authenticators' attachment modalities.
type AuthenticatorAttachment string
//enum values for AuthenticatorAttachment type
const (
AttachmentPlatform AuthenticatorAttachment = "platform"
AttachmentCrossPlatform AuthenticatorAttachment = "cross-platform"
)
//AttestationConveyancePreference may be used by relying parties to specify
//their preference regarding attestation conveyance during credential
//generation.
type AttestationConveyancePreference string
//enum values for AttestationConveyancePreference type
const (
ConveyanceNone AttestationConveyancePreference = "none"
ConveyanceIndirect AttestationConveyancePreference = "indirect"
ConveyanceDirect AttestationConveyancePreference = "direct"
)