-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcredential.go
41 lines (35 loc) · 1.48 KB
/
credential.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
package warp
//CMCredential is the basic Credential Management Credential type that
//is inherited by PublicKeyCredential
type CMCredential struct {
ID string `json:"id"`
Type string `json:"type"`
}
//PublicKeyCredential inherits from Credential and contains the attributes that
//are returned to the caller when a new credential is created, or a new
//assertion is requested.
type PublicKeyCredential struct {
CMCredential
RawID []byte `json:"rawId"`
Extensions AuthenticationExtensionsClientOutputs `json:"extensions,omitempty"`
}
//AttestationPublicKeyCredential is the PublicKeyCredential returned from a call
//to navigator.credentials.create(), with an AuthenticatorAttestationResponse
type AttestationPublicKeyCredential struct {
PublicKeyCredential
Response AuthenticatorAttestationResponse `json:"response"`
}
//AssertionPublicKeyCredential is the PublicKeyCredential returned from a call
//to navigator.credentials.get(), with an AuthenticatorAssertionResponse
type AssertionPublicKeyCredential struct {
PublicKeyCredential
Response AuthenticatorAssertionResponse `json:"response"`
}
//CredentialCreationOptions specifies the parameters to create a credential
type CredentialCreationOptions struct {
PublicKey PublicKeyCredentialCreationOptions `json:"publicKey"`
}
//CredentialRequestOptions specifies the parameters to retrieve a credential
type CredentialRequestOptions struct {
PublicKey PublicKeyCredentialRequestOptions `json:"publicKey"`
}