feature/migrate models (#16)

* feat: add new supported attestation formats to genesis

* feat: refactor keyType to keytype enum

* refactor: remove unused imports and code

* refactor: update main.go to use src package

* refactor: move web-related structs from  to

* refactor: move client middleware package to root

* refactor: remove unused IndexedDB dependency

* feat: update worker implementation to use

* feat: add Caddyfile and Caddy configuration for vault service

* refactor(config): move keyshare and address to Motr config

* fix: validate service origin in AllocateVault

* chore: remove IndexedDB configuration

* feat: add support for IPNS-based vault access
This commit is contained in:
Prad Nukala
2024-09-19 02:04:22 -04:00
committed by GitHub
parent 6d8bd8fc85
commit 96e6486c43
151 changed files with 10997 additions and 21705 deletions
@@ -1,4 +1,4 @@
package state
package handlers
import (
"encoding/json"
@@ -8,16 +8,16 @@ import (
"github.com/labstack/echo/v4"
)
func CheckSubjectIsValid(e echo.Context) error {
func checkSubjectIsValid(e echo.Context) error {
credentialID := e.FormValue("credentialID")
return e.JSON(200, credentialID)
}
func HandleCredentialAssertion(e echo.Context) error {
func handleCredentialAssertion(e echo.Context) error {
return e.JSON(200, "HandleCredentialAssertion")
}
func HandleCredentialCreation(e echo.Context) error {
func handleCredentialCreation(e echo.Context) error {
// Get the serialized credential data from the form
credentialDataJSON := e.FormValue("credentialData")
+1
View File
@@ -0,0 +1 @@
package handlers
@@ -1,22 +1,22 @@
package state
package handlers
import (
"github.com/labstack/echo/v4"
)
func GrantAuthorization(e echo.Context) error {
func grantAuthorization(e echo.Context) error {
// Implement authorization endpoint using passkey authentication
// Store session data in cache
return nil
}
func GetJWKS(e echo.Context) error {
func getJWKS(e echo.Context) error {
// Implement token endpoint
// Use cached session data for validation
return nil
}
func GetToken(e echo.Context) error {
func getToken(e echo.Context) error {
// Implement token endpoint
// Use cached session data for validation
return nil
+6 -7
View File
@@ -2,19 +2,18 @@ package handlers
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/dwn/handlers/state"
middleware "github.com/onsonr/sonr/internal/dwn/middleware"
)
func RegisterState(e *echo.Echo) {
g := e.Group("state")
g.POST("/login/:identifier", state.HandleCredentialAssertion)
g.POST("/login/:identifier", handleCredentialAssertion)
// g.GET("/discovery", state.GetDiscovery)
g.GET("/jwks", state.GetJWKS)
g.GET("/token", state.GetToken)
g.POST("/:origin/grant/:subject", state.GrantAuthorization)
g.POST("/register/:subject", state.HandleCredentialCreation)
g.POST("/register/:subject/check", state.CheckSubjectIsValid)
g.GET("/jwks", getJWKS)
g.GET("/token", getToken)
g.POST("/:origin/grant/:subject", grantAuthorization)
g.POST("/register/:subject", handleCredentialCreation)
g.POST("/register/:subject/check", checkSubjectIsValid)
}
func RegisterSync(e *echo.Echo) {
-1
View File
@@ -1 +0,0 @@
package sync
-1
View File
@@ -1 +0,0 @@
package sync
+1
View File
@@ -0,0 +1 @@
package handlers