master -> develop (#20)

* Squash merge develop into master

* feat: add automated production release workflow

* feat: add Gitflow workflow for syncing branches

* ci: update workflow runner to latest ubuntu version

* feat: enable buf.build publishing on master and develop branches

---------

Co-authored-by: Prad Nukala <prad@sonr.io>
This commit is contained in:
github-actions[bot]
2024-09-23 12:39:59 -04:00
committed by GitHub
co-authored by Prad Nukala
parent 7b0693ef67
commit 228adb7f93
146 changed files with 16786 additions and 123 deletions
+40
View File
@@ -0,0 +1,40 @@
//go:build js && wasm
// +build js,wasm
package main
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/vfs/wasm"
"github.com/onsonr/sonr/internal/db"
)
var dwn *DWN
type DWN struct {
*echo.Echo
DB *db.DB
}
func main() {
dwn = initRails()
wasm.Serve(dwn.Echo)
}
// initRails initializes the Rails application
func initRails() *DWN {
// Open the database
e := echo.New()
db, err := db.New()
if err != nil {
panic(err.Error())
}
db.ServeEcho(e.Group("/dwn"))
// Initialize the htmx handler
return &DWN{
Echo: e,
DB: db,
}
}
+61
View File
@@ -0,0 +1,61 @@
//go:build wasm
package main
import (
"github.com/labstack/echo/v4"
"github.com/syumai/workers"
"github.com/onsonr/sonr/internal/db"
"github.com/onsonr/sonr/internal/gui/views"
"github.com/onsonr/sonr/internal/mdw"
"github.com/onsonr/sonr/internal/svc"
)
func main() {
// Configure the server
e := echo.New()
// Use Middlewares
e.Use(mdw.UseSession)
// Setup routes
registerFrontend(e)
registerOpenID(e.Group("/authorize"))
registerVault(e.Group("/vault"))
// Serve Worker
workers.Serve(e)
}
func registerFrontend(e *echo.Echo) {
// Add Public Pages
e.GET("/", views.HomeView)
e.GET("/login", views.LoginView)
e.POST("/login/:identifier", svc.HandleCredentialAssertion)
e.GET("/register", views.RegisterView)
e.POST("/register/:subject", svc.HandleCredentialCreation)
e.POST("/register/:subject/check", svc.CheckSubjectIsValid)
e.GET("/profile", views.ProfileView)
}
func registerOpenID(g *echo.Group) {
// Add Authenticated Pages
g.Use(mdw.MacaroonMiddleware("test", "test"))
g.GET("/", views.AuthorizeView)
g.GET("/discovery", svc.GetDiscovery)
g.GET("/jwks", svc.GetJWKS)
g.GET("/token", svc.GetToken)
g.POST("/:origin/grant/:subject", svc.GrantAuthorization)
}
func registerVault(g *echo.Group) {
// Add Authenticated Pages
g.Use(mdw.MacaroonMiddleware("test", "test"))
vault, err := db.New(db.WitDir("vault"))
if err != nil {
// panic(err)
}
vault.ServeEcho(g)
}
+10
View File
@@ -0,0 +1,10 @@
name = "sonr-id"
main = "./build/worker.mjs"
compatibility_date = "2024-07-26"
[dev]
ip = "localhost"
port = 4202
[build]
command = "devbox run build:motr"