Commit Graph

155 Commits

Author SHA1 Message Date
ben-toogood
2430925ea3 Refactor auth: add token and store implementations (#1230)
* Refactor auth: add token and memory implementations

* Fix typo

* Remove memory auth (implemented already by the store implementation), revert default to noop

* Add grpc header

* Global Config

* config/global => util/config

* Rename package to remove confict

* Tweak

* Improve Error Handling
2020-09-18 16:32:52 +03:00
144014db34 allocations improvements and tunnel fixes (#1248)
* reduce allocations in tunnel code

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* another allocation fix

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* allocate maps with len if it known

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* allocate key for send once

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Asim Aslam
f91ec84d59 secure the grpc client (#1215)
* secure the grpc client

* make compile

* Add system cert pool

* Revert manually adding ca certs

* Tweak comment

Co-authored-by: ben-toogood <bentoogood@gmail.com>
2020-09-18 16:32:52 +03:00
b00167520c fixes for safe conversation and avoid panics (#1213)
* fixes for safe convertation

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix client publish panic

If broker connect returns error we dont check it status and use
it later to publish message, mostly this is unexpected because
broker connection failed and we cant use it.
Also proposed solution have benefit - we flag connection status
only when we have succeseful broker connection

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* api/handler/broker: fix possible broker publish panic

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
ben-toogood
5b60299d47 Ignore gRPC Proxy (#1205) 2020-09-18 16:32:52 +03:00
Asim Aslam
4a6f438db2 normalise proxy name (#1203) 2020-09-18 16:32:52 +03:00
Asim Aslam
6460839705 when the stream errors cleanup the connection (#1199) 2020-09-18 16:32:52 +03:00
Asim Aslam
5657fd07d2 set dial timeout in stream 2020-09-18 16:32:52 +03:00
978659a441 client/grpc: fix panic on invalid message (#1191)
* client/grpc: fix panic on invalid message
* travis: disable lint and race for now

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
a5a238d554 pass micro errors from grpc server to grpc client (#1167)
* pass micro errors from grpc server to grpc client

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* wrap micro errors.Error to grpc status

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
8740815c56 fix ctx.Done issue #720 (#1166)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
0807802cea fix import paths for v2 release
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Asim Aslam
b65757048a cancel stream 2020-09-18 16:32:52 +03:00
Asim Aslam
5422d368c0 ensure we close the grpc stream (#1098)
* ensure we close the grpc stream

* use g.Close

* use closed bool flag for checking connection close
2020-09-18 16:32:52 +03:00
Asim Aslam
8c86ad526f fix grpc json streaming by setting content sub type (#1089) 2020-09-18 16:32:52 +03:00
Asim Aslam
7d5e31cd58 Moving to gRPC by default (#1069)
* Step 1

* Fix the test panics
2020-09-18 16:32:52 +03:00
jamsonzan
01ad981688 support streams pool for grpc (#1062)
* Update grpc_pool.go

* Update options.go

* Update grpc.go

* Update grpc_pool_test.go

* streams pool for grpc

* use busy list to speed up allocate while pool is very busy

* fix idle bug
2020-09-18 16:32:52 +03:00
Milos Gajdos
f0fd4f90a5 Fixing dead code and go vet moaning 2020-09-18 16:32:52 +03:00
b3a60ba4f1 linting fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Astone
1e0ca25db0 improve code quality 2020-09-18 16:32:52 +03:00
Asim Aslam
88d56e653d revert some protocol changes for now 2020-09-18 16:32:52 +03:00
dc67083701 grpc client goroutine leak fix
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Asim Aslam
9d31078176 The mega cruft proxy PR (#974)
* the mega cruft proxy PR

* Rename broker id

* add protocol=grpc

* fix compilation breaks

* Add the tunnel broker to the network

* fix broker id

* continue to be backwards compatible in the protocol
2020-09-18 16:32:52 +03:00
tegk
b18c0c8bb4 used gofmt with -s flag on whole project 2020-09-18 16:32:52 +03:00
orb li
cb8ba30ac5 Conceptual deliverable 2020-09-18 16:32:52 +03:00
orb li
ab876bfc74 Adding dependency 2020-09-18 16:32:52 +03:00
orb li
3fba82d0f8 Add dialoptions and calloptions 2020-09-18 16:32:52 +03:00
Asim Aslam
756857f1a6 Add grpc content-type 2020-09-18 16:32:52 +03:00
Asim Aslam
c03b95cb79 Force grpc client/server to use grpc codec for broker 2020-09-18 16:32:52 +03:00
johnson
2846a2cc65 update service not found error tooltip
fixing test failed issue

change back error type
change registry.ErrNotFound back to selector.ErrNotFound

change back error type
change registry.ErrNotFound back to selector.ErrNotFound

remove the single node tunnel test

Fix read yaml config from memory

package main

import (
	"fmt"

	"github.com/micro/go-micro/config"
	"github.com/micro/go-micro/config/source/memory"
)

var configData = []byte(`
2020-09-18 16:32:52 +03:00
Asim Aslam
a6e682ebf1 move all the buffer references to util/buf 2020-09-18 16:32:52 +03:00
张三
5c95e48656 fix bug
https://github.com/micro/micro/issues/293
Send request failed using micro Content-Type application/grpc+json
2020-09-18 16:32:52 +03:00
640f0504b5 fix ipv6 addr parsing and using
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Asim Aslam
995484282e Fix breaks and go fmt 2020-09-18 16:32:52 +03:00
Asim Aslam
fbd64e5cba move transport back 2020-09-18 16:32:52 +03:00
Asim Aslam
5ab3e7e90b Remove Port from registry 2020-09-18 16:32:52 +03:00
Joe
e2b8abd86a grpc: using jsonpb.Marshaler to do Marshal, map to jsonpb.Unmarsh 2020-09-18 16:32:52 +03:00
Asim Aslam
1b9e535220 Change Publication to Event 2020-09-18 16:32:52 +03:00
Asim Aslam
9235dfb2a2 gofmt 2020-09-18 16:32:52 +03:00
Asim Aslam
480aa760f9 Move transport to network/transport 2020-09-18 16:32:52 +03:00
e782237b41 codec grpc: fix extra allocations on message unmarshal
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-18 16:32:52 +03:00
Joe
fb97097ef6 if unmarshal target is proto.Message, using jsonpb 2020-09-18 16:32:52 +03:00
Asim Aslam
a29870b154 fix grpc proto wrapper 2020-09-18 16:32:52 +03:00
lpxxn
058d0e476e pass parameter to anonymous function 2020-09-18 16:32:52 +03:00
Asim Aslam
30a0bfeeb8 Accept a range of addresses 2020-09-18 16:32:52 +03:00
Asim Aslam
e21f065b7e Go fmt everything 2020-09-18 16:32:52 +03:00
Asim Aslam
507beaf373 Move selector to client/selector 2020-09-18 16:32:52 +03:00
Asim Aslam
7596a027d9 Fix the grpc test 2020-09-18 16:32:52 +03:00
Asim Aslam
e83572b994 Add working grpc proxy config 2020-09-18 16:32:52 +03:00
johnson
869c6ec764 grpc message should be able to set 2020-09-18 16:32:52 +03:00