refactor: move Motr API to state package

This commit is contained in:
Prad Nukala
2024-10-02 02:13:25 -04:00
parent 75c65228fc
commit ae56055640
11 changed files with 16 additions and 12 deletions
+1
View File
@@ -0,0 +1 @@
package handlers
+1
View File
@@ -0,0 +1 @@
package handlers
+7 -7
View File
@@ -15,7 +15,7 @@ import (
"github.com/labstack/echo/v4"
promise "github.com/nlepage/go-js-promise"
"github.com/onsonr/sonr/cmd/motr/handlers"
"github.com/onsonr/sonr/cmd/motr/state"
"github.com/onsonr/sonr/internal/session"
"github.com/onsonr/sonr/pkg/nebula/pages"
)
@@ -30,13 +30,13 @@ func main() {
func registerState(e *echo.Echo) {
g := e.Group("state")
g.POST("/login/:identifier", handlers.HandleCredentialAssertion)
g.POST("/login/:identifier", state.HandleCredentialAssertion)
// g.GET("/discovery", state.GetDiscovery)
g.GET("/jwks", handlers.GetJWKS)
g.GET("/token", handlers.GetToken)
g.POST("/:origin/grant/:subject", handlers.GrantAuthorization)
g.POST("/register/:subject", handlers.HandleCredentialCreation)
g.POST("/register/:subject/check", handlers.CheckSubjectIsValid)
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)
}
func registerViews(e *echo.Echo) {
@@ -1,4 +1,4 @@
package handlers
package state
import (
"encoding/json"
+1
View File
@@ -0,0 +1 @@
package state
@@ -1,4 +1,4 @@
package handlers
package state
import (
"github.com/labstack/echo/v4"
+1
View File
@@ -0,0 +1 @@
package state