refactor: add GetAdminToken interface. (#2684)

* refactor: add GetAdminToken interface.

* update config.
This commit is contained in:
Monet Lee
2024-09-29 16:20:34 +08:00
committed by GitHub
parent 765fa17e7a
commit 5452741af8
8 changed files with 21 additions and 19 deletions
+2 -2
View File
@@ -72,8 +72,8 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
return nil
}
func (s *authServer) UserToken(ctx context.Context, req *pbauth.UserTokenReq) (*pbauth.UserTokenResp, error) {
resp := pbauth.UserTokenResp{}
func (s *authServer) GetAdminToken(ctx context.Context, req *pbauth.GetAdminTokenReq) (*pbauth.GetAdminTokenResp, error) {
resp := pbauth.GetAdminTokenResp{}
if req.Secret != s.config.Share.Secret {
return nil, errs.ErrNoPermission.WrapMsg("secret invalid")
}