mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
feat: add passkey creation functionality
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package passkeys
|
||||
|
||||
import (
|
||||
"github.com/go-webauthn/webauthn/protocol"
|
||||
"github.com/go-webauthn/webauthn/protocol/webauthncose"
|
||||
)
|
||||
|
||||
func defaultPrimaryAttestationFormats() []protocol.AttestationFormat {
|
||||
return []protocol.AttestationFormat{
|
||||
protocol.AttestationFormatApple,
|
||||
protocol.AttestationFormatAndroidKey,
|
||||
protocol.AttestationFormatAndroidSafetyNet,
|
||||
protocol.AttestationFormatFIDOUniversalSecondFactor,
|
||||
}
|
||||
}
|
||||
|
||||
func defaultSecondaryAttestationFormats() []protocol.AttestationFormat {
|
||||
return []protocol.AttestationFormat{
|
||||
protocol.AttestationFormatPacked,
|
||||
protocol.AttestationFormatTPM,
|
||||
}
|
||||
}
|
||||
|
||||
func defaultAuthenticatorSelection() protocol.AuthenticatorSelection {
|
||||
return protocol.AuthenticatorSelection{
|
||||
AuthenticatorAttachment: protocol.Platform,
|
||||
ResidentKey: protocol.ResidentKeyRequirementRequired,
|
||||
UserVerification: protocol.VerificationRequired,
|
||||
}
|
||||
}
|
||||
|
||||
func buildCredentialParameters() []protocol.CredentialParameter {
|
||||
return []protocol.CredentialParameter{
|
||||
{
|
||||
Type: "public-key",
|
||||
Algorithm: webauthncose.AlgES256,
|
||||
},
|
||||
{
|
||||
Type: "public-key",
|
||||
Algorithm: webauthncose.AlgES256K,
|
||||
},
|
||||
{
|
||||
Type: "public-key",
|
||||
Algorithm: webauthncose.AlgEdDSA,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user