mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 18:01:39 +00:00
feature/1109 grpc session model (#1141)
- **feat: remove Hway deployment** - **feat: introduce session middleware for requests** - **refactor: update path imports to use new pkg folder** - **feat: add gRPC client for interacting with services** - **feat: remove grpc client and use REST api** - **refactor: move from to** - **feat: add client views endpoint** - **feat: add webauthn support** - **closes: #1124** - **refactor: Improve PR labeler configuration** - **feat: add milestone discussion template** - **feat: remove OKR tracking issue template** - **feat: use gorilla sessions for session management** - **refactor: move pubkey related code to** - **<no value>** - **refactor: remove unused identifier type** - **feat: integrate Macaroon Keeper with Service Module** - **refactor: rename worker routes for clarity**
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package models
|
||||
package marketing
|
||||
|
||||
type Button struct {
|
||||
Text string
|
||||
@@ -0,0 +1,58 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"github.com/go-webauthn/webauthn/protocol"
|
||||
"github.com/go-webauthn/webauthn/protocol/webauthncose"
|
||||
)
|
||||
|
||||
func NewCredentialCreationOptions(subject, address string) (*protocol.PublicKeyCredentialCreationOptions, error) {
|
||||
chl, err := protocol.CreateChallenge()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &protocol.PublicKeyCredentialCreationOptions{
|
||||
Challenge: chl,
|
||||
User: protocol.UserEntity{
|
||||
DisplayName: subject,
|
||||
ID: address,
|
||||
},
|
||||
Attestation: defaultAttestation(),
|
||||
AuthenticatorSelection: defaultAuthenticatorSelection(),
|
||||
Parameters: defaultCredentialParameters(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func buildUserEntity(userID string) protocol.UserEntity {
|
||||
return protocol.UserEntity{
|
||||
ID: userID,
|
||||
}
|
||||
}
|
||||
|
||||
func defaultAttestation() protocol.ConveyancePreference {
|
||||
return protocol.PreferDirectAttestation
|
||||
}
|
||||
|
||||
func defaultAuthenticatorSelection() protocol.AuthenticatorSelection {
|
||||
return protocol.AuthenticatorSelection{
|
||||
AuthenticatorAttachment: "platform",
|
||||
ResidentKey: protocol.ResidentKeyRequirementPreferred,
|
||||
UserVerification: "preferred",
|
||||
}
|
||||
}
|
||||
|
||||
func defaultCredentialParameters() []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