sonr/pkg/workers/routes/webnode.go
Prad Nukala 2cd44c0b66
feature/1125 offload sync service worker (#1144)
- **feat: provide access to block time**
- **refactor: move block expiry calculation to helper function**
- **feat: register decentralized web node HTMX views**
- **feat: Reorganize methods in layout.templ file alphabetically**
- **feat: add support for layout variants**
- **feat: update Allocate RPC to use GET request with path parameters**
- **feat: add gRPC Gateway endpoint for Allocate**
- **refactor: rename SyncCurrent to Sync**
- **feat: improve code organization by making vault assembly private**
- **feat: add a new method for syncing DID documents**
2024-10-18 13:07:52 -04:00

34 lines
1.2 KiB
Go

package routes
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/nebula/components/authentication"
"github.com/onsonr/sonr/pkg/workers/handlers"
)
// RegisterWebNodeAPI registers the Decentralized Web Node API routes.
func RegisterWebNodeAPI(e *echo.Echo) {
g1 := e.Group("api")
g1.GET("/register/:subject/start", handlers.Auth.RegisterSubjectStart)
g1.POST("/register/:subject/check", handlers.Auth.RegisterSubjectCheck)
g1.POST("/register/:subject/finish", handlers.Auth.RegisterSubjectFinish)
g1.GET("/login/:subject/start", handlers.Auth.LoginSubjectStart)
g1.POST("/login/:subject/check", handlers.Auth.LoginSubjectCheck)
g1.POST("/login/:subject/finish", handlers.Auth.LoginSubjectFinish)
g1.GET("/:origin/grant/jwks", handlers.OpenID.GetJWKS)
g1.GET("/:origin/grant/token", handlers.OpenID.GetToken)
g1.POST("/:origin/grant/:subject", handlers.OpenID.GrantAuthorization)
}
// RegisterWebNodeViews registers the Decentralized Web Node HTMX views.
func RegisterWebNodeViews(e *echo.Echo) {
e.File("/", "index.html")
e.GET("/#", authentication.CurrentViewRoute)
e.GET("/login", authentication.LoginModalRoute)
e.File("/config", "config.json")
e.GET("/register", authentication.RegisterModalRoute)
}