更改路由

This commit is contained in:
xmdhs 2023-09-05 01:09:33 +08:00
parent 5c738aed9c
commit 0932141498
No known key found for this signature in database
GPG Key ID: E809D6D43DEFCC95

View File

@ -2,6 +2,7 @@ package route
import ( import (
"fmt" "fmt"
"net/http"
"github.com/julienschmidt/httprouter" "github.com/julienschmidt/httprouter"
"github.com/xmdhs/authlib-skin/handle" "github.com/xmdhs/authlib-skin/handle"
@ -22,11 +23,23 @@ func NewRoute(yggService *yggdrasil.Yggdrasil, handel *handle.Handel) (*httprout
} }
func newYggdrasil(r *httprouter.Router, handelY yggdrasil.Yggdrasil) error { func newYggdrasil(r *httprouter.Router, handelY yggdrasil.Yggdrasil) error {
r.POST("/api/authserver/authenticate", warpHJSON(handelY.Authenticate())) r.POST("/api/yggdrasil/authserver/authenticate", warpHJSON(handelY.Authenticate()))
r.POST("/api/authserver/validate", warpHJSON(handelY.Validate())) r.POST("/api/yggdrasil/authserver/validate", warpHJSON(handelY.Validate()))
r.POST("/api/authserver/signout", warpHJSON(handelY.Signout())) r.POST("/api/yggdrasil/authserver/signout", warpHJSON(handelY.Signout()))
r.POST("/api/authserver/invalidate", handelY.Invalidate()) r.POST("/api/yggdrasil/authserver/invalidate", handelY.Invalidate())
r.POST("/api/authserver/refresh", handelY.Refresh()) r.POST("/api/yggdrasil/authserver/refresh", handelY.Refresh())
r.GET("/api/yggdrasil", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.Write([]byte(`{
"meta": {
"serverName": "test",
"implementationName": "test",
"implementationVersion": "999.999.999"
},
"skinDomains": [
],
"signaturePublickey": "123"
}`))
})
return nil return nil
} }