From 0932141498565d576a157b91bf328b39e5645f57 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Tue, 5 Sep 2023 01:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/route/route.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/server/route/route.go b/server/route/route.go index 4e9ac6d..f0dc0e7 100644 --- a/server/route/route.go +++ b/server/route/route.go @@ -2,6 +2,7 @@ package route import ( "fmt" + "net/http" "github.com/julienschmidt/httprouter" "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 { - r.POST("/api/authserver/authenticate", warpHJSON(handelY.Authenticate())) - r.POST("/api/authserver/validate", warpHJSON(handelY.Validate())) - r.POST("/api/authserver/signout", warpHJSON(handelY.Signout())) - r.POST("/api/authserver/invalidate", handelY.Invalidate()) - r.POST("/api/authserver/refresh", handelY.Refresh()) + r.POST("/api/yggdrasil/authserver/authenticate", warpHJSON(handelY.Authenticate())) + r.POST("/api/yggdrasil/authserver/validate", warpHJSON(handelY.Validate())) + r.POST("/api/yggdrasil/authserver/signout", warpHJSON(handelY.Signout())) + r.POST("/api/yggdrasil/authserver/invalidate", handelY.Invalidate()) + 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 }