Skip to content

Commit

Permalink
Merge pull request #15 from begonia-org/feature/feat-grpc-proxy
Browse files Browse the repository at this point in the history
Feature/feat grpc proxy
  • Loading branch information
geebytes authored May 24, 2024
2 parents 172ecc6 + f6a4d3b commit 0e4c5ca
Show file tree
Hide file tree
Showing 45 changed files with 1,844 additions and 277 deletions.
13 changes: 4 additions & 9 deletions gateway/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ func loadGlobalMessages(pd ProtobufDescription) error {
continue
}
msg := dynamicpb.NewMessageType(msgType)
err := protoregistry.GlobalTypes.RegisterMessage(msg)
if err != nil {
return false
}
_ = protoregistry.GlobalTypes.RegisterMessage(msg)
}
for i := 0; i < fd.Enums().Len(); i++ {
enumType := fd.Enums().Get(i)
Expand All @@ -132,10 +129,7 @@ func loadGlobalMessages(pd ProtobufDescription) error {
continue
}
enum := dynamicpb.NewEnumType(enumType)
err := protoregistry.GlobalTypes.RegisterEnum(enum)
if err != nil {
return false
}
_ = protoregistry.GlobalTypes.RegisterEnum(enum)
}

return true
Expand Down Expand Up @@ -294,7 +288,7 @@ func (h *HttpEndpointImpl) inParamsHandle(pathParams map[string]string, req *htt
}

func (h *HttpEndpointImpl) addHexEncodeSHA256HashV2(req *http.Request) error {
if req.Body == nil {
if req==nil||req.Body == nil {
return nil
}
// 创建SHA256哈希对象
Expand Down Expand Up @@ -386,6 +380,7 @@ func (h *HttpEndpointImpl) RegisterHandlerClient(ctx context.Context, pd Protobu
}
for _, item := range items {
item := item
// log.Printf("register endpoint %s: %s %v", strings.ToUpper(item.HttpMethod), item.HttpUri, item.Pattern)
mux.Handle(strings.ToUpper(item.HttpMethod), item.Pattern, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
if req.Header.Get("accept") == "" {
req.Header.Set("accept", "application/json")
Expand Down
99 changes: 90 additions & 9 deletions gateway/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/peer"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoregistry"
"gopkg.in/cenkalti/backoff.v1"
)
Expand Down Expand Up @@ -134,11 +135,11 @@ func testRegisterClient(t *testing.T) {
go example.Run(helloAddr)
time.Sleep(2 * time.Second)
go gw.Start()
time.Sleep(1 * time.Second)
f:=func(){
time.Sleep(2 * time.Second)
f := func() {
gw.Start()
}
c.So(f,c.ShouldPanic)
c.So(f, c.ShouldPanic)
time.Sleep(4 * time.Second)
_, err = gw.proxyLB.Select("test/.test")
c.So(err, c.ShouldNotBeNil)
Expand Down Expand Up @@ -181,6 +182,16 @@ func testRequestGet(t *testing.T) {
c.So(err, c.ShouldBeNil)
c.So(resp.StatusCode, c.ShouldEqual, http.StatusIMUsed)

url = fmt.Sprintf("http://127.0.0.1:%d/api/v1/example/world?msg=hello", gwPort)
r2, err := http.NewRequest(http.MethodPost, url, nil)

c.So(err, c.ShouldBeNil)

resp2, err := http.DefaultClient.Do(r2)

c.So(err, c.ShouldBeNil)
c.So(resp2.StatusCode, c.ShouldEqual, http.StatusNotImplemented)

})
}
func testCors(t *testing.T) {
Expand Down Expand Up @@ -774,10 +785,6 @@ func testWebSocketError(t *testing.T) {
output: []interface{}{nil, fmt.Errorf("test upgrade error")},
exceptErr: websocket.ErrBadHandshake,
},
// {
// patch: (*websocketForwarder).Write,
// output: []interface{}{0, fmt.Errorf("test websocket write error")},
// },
{
patch: (*goloadbalancer.ConnPool).Get,
output: []interface{}{nil, fmt.Errorf("test get conn error")},
Expand Down Expand Up @@ -852,6 +859,11 @@ func testServerSideEventErr(t *testing.T) {
output: []interface{}{nil, fmt.Errorf("test marshal error")},
err: fmt.Errorf("test marshal error"),
},
{
patch: (*gwRuntime.DecoderWrapper).Decode,
output: []interface{}{fmt.Errorf("test decode error")},
err: fmt.Errorf("test decode error"),
},
}
for _, caseV := range cases {
url := fmt.Sprintf("http://127.0.0.1:%d/api/v1/example/server/sse/world?msg=hello", gwPort)
Expand Down Expand Up @@ -1075,9 +1087,74 @@ func testUpdateLoadbalance(t *testing.T) {
}
for _, v := range endps {
c.So(v.Stats().GetIdleConns(), c.ShouldBeGreaterThan, 0)
// c.So(v.Close(), c.ShouldBeNil)
}
// helloAddr := fmt.Sprintf("")
})
}
func testStartErr(t *testing.T) {
c.Convey("test start error", t, func() {
_, filename, _, _ := runtime.Caller(0)
pbFile := filepath.Join(filepath.Dir(filepath.Dir(filename)), "testdata", "helloworld.pb")
pb, err := os.ReadFile(pbFile)
c.So(err, c.ShouldBeNil)
pd, err := NewDescriptionFromBinary(pb, filepath.Join("tmp", "test-pd"))
c.So(err, c.ShouldBeNil)
opts, cnf := newTestServer(0, 0)
localGW := NewGateway(cnf, opts)
err = localGW.RegisterHandlerClient(context.Background(), pd)
c.So(err, c.ShouldBeNil)

c.So(localGW.Start, c.ShouldPanic)

min := 1949
max := 12138
rander := rand.New(rand.NewSource(time.Now().Unix())) // 初始化随机数种子

randomNumber := rander.Intn(max-min+1) + min
opts1, cnf1 := newTestServer(randomNumber+3, randomNumber)
localGW1 := NewGateway(cnf1, opts1)
err = localGW1.RegisterHandlerClient(context.Background(), pd)
c.So(err, c.ShouldBeNil)
go localGW1.Start()
time.Sleep(3 * time.Second)
opts2, cnf2 := newTestServer(gwPort, randomNumber+4)
localGW2 := NewGateway(cnf2, opts2)
err = localGW2.RegisterHandlerClient(context.Background(), pd)
c.So(err, c.ShouldBeNil)
c.So(localGW2.Start, c.ShouldPanic)

})
}
func testAddHexEncodeSHA256HashV2Err(t *testing.T) {
c.Convey("test add hex encode sha256 hash v2 err", t, func() {
httpEp := &HttpEndpointImpl{}
err := httpEp.addHexEncodeSHA256HashV2(nil)
c.So(err, c.ShouldBeNil)
patch := gomonkey.ApplyFuncReturn(io.Copy, int64(0), fmt.Errorf("test io copy error"))
defer patch.Reset()
req, err := http.NewRequest(http.MethodPost, "http://www.example.com", strings.NewReader("hello"))
c.So(err, c.ShouldBeNil)
err = httpEp.addHexEncodeSHA256HashV2(req)
c.So(err.Error(), c.ShouldContainSubstring, "test io copy error")
patch.Reset()
})
}

func testRegisterHandlerClientErr(t *testing.T) {
c.Convey("test register handler client err", t, func() {
_, filename, _, _ := runtime.Caller(0)
pbFile := filepath.Join(filepath.Dir(filepath.Dir(filename)), "testdata", "helloworld.pb")
pb, err := os.ReadFile(pbFile)
c.So(err, c.ShouldBeNil)
pd, err := NewDescriptionFromBinary(pb, filepath.Join("tmp", "test-pd"))
c.So(err, c.ShouldBeNil)
patch := gomonkey.ApplyFuncReturn(protodesc.NewFiles,nil, fmt.Errorf("test NewFiles error"))
defer patch.Reset()
err = gw.RegisterHandlerClient(context.Background(), pd)
patch.Reset()

c.So(err, c.ShouldNotBeNil)
c.So(err.Error(), c.ShouldContainSubstring, "test NewFiles error")

})
}
func TestHttp(t *testing.T) {
Expand All @@ -1095,10 +1172,14 @@ func TestHttp(t *testing.T) {
t.Run("testWebSocketError", testWebSocketError)
t.Run("testServerSideEventErr", testServerSideEventErr)
t.Run("testClientStreamErr", testClientStreamErr)
t.Run("testAddHexEncodeSHA256HashV2Err", testAddHexEncodeSHA256HashV2Err)
t.Run("testRegisterHandlerClientErr", testRegisterHandlerClientErr)
// t.Run("testInParamsHandle", testInParamsHandle)
t.Run("testRequestError", testRequestError)
t.Run("testLoadHttpEndpointItemErr", testLoadHttpEndpointItemErr)
t.Run("testDeleteEndpoint", testDeleteEndpoint)
t.Run("testRegisterLocalService", testRegisterLocalService)
t.Run("testStartErr", testStartErr)

// time.Sleep(30 * time.Second)
}
6 changes: 6 additions & 0 deletions gateway/mask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,11 @@ func TestDecodeErr(t *testing.T) {
c.So(err, c.ShouldNotBeNil)
c.So(err.Error(), c.ShouldContainSubstring, caseV.err.Error())
}
r := bytes.NewReader([]byte(`{"message":"John Doe","msg":{"msg":"hello world"},"allow":"DENY","repeated_msg":[{"msg":"John Doe"}]}`))
decoder := NewMaskDecoder(NewJsonDecoder(r))
mapData:=make(map[string]interface{})
err := decoder.Decode(mapData)
c.So(err, c.ShouldBeNil)
c.So(len(mapData), c.ShouldEqual, 0)
})
}
4 changes: 4 additions & 0 deletions gateway/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ func HandleErrorWithLogger(logger logger.Logger) runtime.ErrorHandlerFunc {
"status": statusCode,
},
)
if _,ok:=metadata.FromIncomingContext(ctx);!ok{
md:=IncomingHeadersToMetadata(ctx,req)
ctx=metadata.NewIncomingContext(ctx,md)
}
code := statusCode
data := &common.HttpResponse{}
data.Code = int32(common.Code_INTERNAL_ERROR)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/cockroachdb/errors v1.11.1
github.com/google/wire v0.6.0
github.com/smartystreets/goconvey v1.8.1
github.com/spark-lence/tiga v0.0.0-20240517061929-e81eba889226
github.com/spark-lence/tiga v0.0.0-20240523101823-47fd881052e5
github.com/spf13/cobra v1.8.0
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5
google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.1
)
Expand Down Expand Up @@ -80,7 +80,7 @@ require (
require (
github.com/agiledragon/gomonkey/v2 v2.11.0
github.com/begonia-org/go-loadbalancer v0.0.0-20240519060752-71ca464f0f1a
github.com/begonia-org/go-sdk v0.0.0-20240521170528-b02c5a54f25e
github.com/begonia-org/go-sdk v0.0.0-20240524034736-5c195b7e4b0f
github.com/go-git/go-git/v5 v5.11.0
github.com/go-playground/validator/v10 v10.19.0
github.com/gorilla/websocket v1.5.0
Expand Down Expand Up @@ -135,7 +135,7 @@ require (
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)

Expand Down
40 changes: 8 additions & 32 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,12 @@ github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/begonia-org/go-layered-cache v0.0.0-20240510102605-41bdb7aa07fa h1:DHjhGvN6SYMA2Vf2D0/kILQKcSiFQH6OqNMivYebFag=
github.com/begonia-org/go-layered-cache v0.0.0-20240510102605-41bdb7aa07fa/go.mod h1:xEqoca1vNGqH8CV7X9EzhDV5Ihtq9J95p7ZipzUB6pc=
github.com/begonia-org/go-loadbalancer v0.0.0-20240408092223-42b5fab476ce h1:qLUMzfJuPyWVeIs9d4FaootUIQzWs4xfFwkI6R6IH40=
github.com/begonia-org/go-loadbalancer v0.0.0-20240408092223-42b5fab476ce/go.mod h1:crPS67sfgmgv47psftwfmTMbmTfdepVm8MPeqApINlI=
github.com/begonia-org/go-loadbalancer v0.0.0-20240515153502-b1d83dda8ae3 h1:0BxtLwjHi9tQiQ8l+rEqIqTY0WqngC3RptORz7edTHU=
github.com/begonia-org/go-loadbalancer v0.0.0-20240515153502-b1d83dda8ae3/go.mod h1:crPS67sfgmgv47psftwfmTMbmTfdepVm8MPeqApINlI=
github.com/begonia-org/go-loadbalancer v0.0.0-20240519060752-71ca464f0f1a h1:Mpw7T+90KC5QW7yCa8Nn/5psnlvsexipAOrQAcc7YE0=
github.com/begonia-org/go-loadbalancer v0.0.0-20240519060752-71ca464f0f1a/go.mod h1:crPS67sfgmgv47psftwfmTMbmTfdepVm8MPeqApINlI=
github.com/begonia-org/go-sdk v0.0.0-20240515083527-ef2ff6b73539 h1:M7pPon2kyX2MlJM8R6+TGqGAFhWzSzAd8VqCZ9/bm3g=
github.com/begonia-org/go-sdk v0.0.0-20240515083527-ef2ff6b73539/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240516160356-c90fe583fd2e h1:VwPf1HI//SopJpJtWHtQd6JreryTtu8s1m0zQo+Jeqc=
github.com/begonia-org/go-sdk v0.0.0-20240516160356-c90fe583fd2e/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240517035447-b6ee0a94bc66 h1:ejdny9b1oeioMFd8IWQcY9uDpDOAlTnMAJvhsalHdjs=
github.com/begonia-org/go-sdk v0.0.0-20240517035447-b6ee0a94bc66/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240517084829-c3cdf5e5e1eb h1:H58fLjtWA5CZSl20GLyi+3xnQiRiP47aEub7YWFjuQc=
github.com/begonia-org/go-sdk v0.0.0-20240517084829-c3cdf5e5e1eb/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240517093020-2a19277f4cd0 h1:PRMFCCLybAmO0gnaU3pZhY1koi1N1so3iMBdbLEfCOU=
github.com/begonia-org/go-sdk v0.0.0-20240517093020-2a19277f4cd0/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240519143740-d09416b7b751 h1:ku84LpIO8hZ54BzE089pfTB1Op7YIA3GMLEcN49VoUI=
github.com/begonia-org/go-sdk v0.0.0-20240519143740-d09416b7b751/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240520034852-0b45d3942779 h1:iL/WWH9anPFbGJWYIhqPIcVAkWKfPq0HntG5NkHI2uk=
github.com/begonia-org/go-sdk v0.0.0-20240520034852-0b45d3942779/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240520090120-64e22f6f7a4d h1:yJ0+f8SDNyA2GSf1XvLN2R4BK60ruNU7+V328BBCDYw=
github.com/begonia-org/go-sdk v0.0.0-20240520090120-64e22f6f7a4d/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240521170528-b02c5a54f25e h1:QIlVvEUYC2t+ctxzKMFtMw0a1eXauR87pimm2D55guQ=
github.com/begonia-org/go-sdk v0.0.0-20240521170528-b02c5a54f25e/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/begonia-org/go-sdk v0.0.0-20240524034736-5c195b7e4b0f h1:DQAupqwJEj9lYPk7phcbr+8+lZOFPLRNA9Ao+8Sh11M=
github.com/begonia-org/go-sdk v0.0.0-20240524034736-5c195b7e4b0f/go.mod h1:I70a3fiAADGrOoOC3lv408rFcTRhTwLt3pwr6cQwB4Y=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
Expand Down Expand Up @@ -240,12 +222,10 @@ github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sS
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spark-lence/tiga v0.0.0-20240510102710-93bf07b60b07 h1:BLvfdUv/NKsRirhQbUum2eduFHfu0tcWyF4fHhP62zY=
github.com/spark-lence/tiga v0.0.0-20240510102710-93bf07b60b07/go.mod h1:jo3Qr3EkFkOX0GUD6c4YyLoJESTYtd2hfYP9HZk8s8I=
github.com/spark-lence/tiga v0.0.0-20240517030839-e2e8385d3629 h1:J5qEeswukKY+wAnQLgHFz8T9/vItTF4lga7JDjwz8fE=
github.com/spark-lence/tiga v0.0.0-20240517030839-e2e8385d3629/go.mod h1:MSL8X9t+qvpQ4Tq3vVPKncq9RJcCzF2XGEWkCuNhm6Q=
github.com/spark-lence/tiga v0.0.0-20240517061929-e81eba889226 h1:WKMb1r+0r5lDKrynMlC9v62EajmtLXMIIk6NzrVbcNs=
github.com/spark-lence/tiga v0.0.0-20240517061929-e81eba889226/go.mod h1:MSL8X9t+qvpQ4Tq3vVPKncq9RJcCzF2XGEWkCuNhm6Q=
github.com/spark-lence/tiga v0.0.0-20240523101823-47fd881052e5 h1:lbs5Qf0cOLvIu0d1hftGNYWeudonk77XA6FRxa40yN8=
github.com/spark-lence/tiga v0.0.0-20240523101823-47fd881052e5/go.mod h1:MSL8X9t+qvpQ4Tq3vVPKncq9RJcCzF2XGEWkCuNhm6Q=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
Expand Down Expand Up @@ -412,18 +392,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8 h1:W5Xj/70xIA4x60O/IFyXivR5MGqblAb8R3w26pnD6No=
google.golang.org/genproto/googleapis/api v0.0.0-20240513163218-0867130af1f8/go.mod h1:vPrPUTsDCYxXWjP7clS81mZ6/803D8K4iM9Ma27VKas=
google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 h1:4HZJ3Xv1cmrJ+0aFo304Zn79ur1HMxptAE7aCPNLSqc=
google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g=
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ=
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 h1:mxSlqyb8ZAHsYDCfiXN1EDdNTdvjUJSLY+OnAUtYNYA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0=
google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
Expand Down
2 changes: 1 addition & 1 deletion internal/biz/aksk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (a *AccessKeyAuth) AppValidator(ctx context.Context, req *gosdk.GatewayRequ

return "", gosdk.NewError(errors.ErrRequestExpired, int32(api.APPSvrCode_APP_REQUEST_EXPIRED_ERR), codes.DeadlineExceeded, "app_timestamp")
}
secret, err := a.app.GetSecret(ctx, accessKey)
secret, err := a.GetSecret(ctx, accessKey)
if err != nil {
return "", gosdk.NewError(err, int32(api.APPSvrCode_APP_UNKNOWN), codes.Unauthenticated, "app_secret")
}
Expand Down
Loading

0 comments on commit 0e4c5ca

Please sign in to comment.