Commit Graph

152 Commits

Author SHA1 Message Date
Asim Aslam
a6d7b1d710
Move api/router/util to util/router (#1909) 2020-08-07 13:30:29 +01:00
Asim Aslam
8ee31b94a1
remove handler/util package in favour of util/router (#1908) 2020-08-07 12:47:20 +01:00
Asim Aslam
b93cd0c964 dont process endpoint unless absolutely necessary 2020-08-05 18:09:04 +01:00
Asim Aslam
563768b58a
v3 refactor (#1868)
* Move to v3

Co-authored-by: Ben Toogood <bentoogood@gmail.com>
2020-07-27 13:22:00 +01:00
Di Wu
f9bf562393
fix typo in comments (#1840)
* remove global error tracking

* rpc_server: fix invalid register err

* fix typo

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-16 16:33:11 +01:00
97ae2979ad
pass request context from request rpc endpoints (#1799)
http middleware can add additional metadata to context,
for example tracing wrappers, pass down it to underlining
services

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-07-06 13:55:17 +01:00
Asim Aslam
6f309dada3
fix typo (#1789) 2020-07-06 13:52:42 +01:00
ben-toogood
174e44b846
Deprecate client/selector (#1767)
* client/{grpc,rpc}: depricate selector (wip)

* {client,cmd}: remove client/selector

* deprecate client/selector

* router/static: fix lookup

* config/cmd: add support for legacy static selector flag

* config/cmd: add support for legacy dns selector flag
2020-07-01 17:06:59 +01:00
ben-toogood
6d9d94b105
api/router/registry: use resolved domain (#1774) 2020-07-01 12:23:55 +01:00
ben-toogood
df3e5364ca
api/resolver: add resolve options (#1756)
* api/resolver: Resolve options

* router/registry: fix init bug

* router/registry: fix wildcard query bug

* web: fix registation domain bug

* registry/etcd: pass domain in service metadata

* api/resolver/subdomain: expose domain func

* Update api/resolver/subdomain/subdomain.go

Co-authored-by: Dominic Wong <domwongemail@googlemail.com>

Co-authored-by: Dominic Wong <domwongemail@googlemail.com>
2020-06-29 16:37:45 +01:00
ben-toogood
104b7d8f8d
api/resolver: update resolver to enable subdomain routing (#1747)
* api/resolver: update domain / service prefix usage

* api/resolver/subdomain: implement subdomain resolver for domain resolution

* api/handler: fix tests
2020-06-26 14:28:18 +01:00
Dominic Wong
0327f30e3c Fix regex detection. Fixes #1663 (#1696) 2020-06-12 10:42:52 +01:00
92e9d05432 api/handler/rpc: dont log error on normal websocket error code (#1688)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-06-12 10:42:52 +01:00
Asim Aslam
b68af8ab63 run go fmt 2020-05-30 11:00:43 +01:00
Ben Toogood
dc10f88c12 Replace auth account.Namespace with account.Scopes 2020-05-19 18:17:17 +01:00
x1nchen
af2db0a0d9
fix: update dependency certmagic (#1625)
module github.com/mholt/certmagic has been renamed github.com/caddyserver/certmagic,
so upgrade on this module will fail.

fix: micro/micro#835

caddyserver/certmagic@v0.10.6 is Maximum upgradeable version with go version 1.13

Higher version use *tls.ClientHelloInfo.SupportsCertificate which only supported in go 1.14
2020-05-13 15:00:13 +01:00
Ben Toogood
f892b41299 Add runtime to service.Options() 2020-05-11 17:09:28 +01:00
90dd1f63c8
api/handler/rpc: fix encoding of inner message (#1601)
* api/handler/rpc: fix encoding of inner message

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-05-04 15:50:53 +03:00
d44adafca5
api/router: avoid unneeded loops and fix path match (#1594)
* api/router: avoid unneeded loops and fix path match

* if match found in google api path syntax, not try pcre loop
* if path is not ending via $ sign, append it to pcre to avoid matching other strings like
  /api/account/register can be matched to /api/account
* api: add tests and validations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-29 15:23:10 +03:00
6fa27373ed
bundle qson lib in util (#1561)
* copy qson from https://github.com/joncalhoun/qson
  as author not want to maintain repo
* latest code contains our fix to proper decode strings
  with escaped & symbol
* replace package in api/handler/rpc

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-23 11:08:09 +03:00
Asim Aslam
226d6ad22b log whats happening in http handler 2020-04-19 00:41:03 +01:00
f00fd7a49e
api/router: support pcre and google.api pattern matching (#1549)
* api/router: support pcre and google.api pattern matching

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-19 00:31:34 +03:00
62cedf64da
api/router/registry: extract path based parameters from url to req (#1530)
* api/router/registry: extract path based parameters from url to req
* api/handler/rpc: fix empty body request parsing
* bundle grpc-gateway util funcs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-15 17:50:51 +03:00
b700d425a4
api/handler/rpc: improvements and fixes (#1535)
* api/handler/rpc: fix empty body case
* api/handler/rpc: copy all request headers to metadata

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-15 01:37:15 +03:00
268651df18
regenerate all proto based files (#1531)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-14 16:25:09 +03:00
Asim Aslam
e515005083 Remove only allowing certain methods 2020-04-13 23:05:39 +01:00
Asim Aslam
a056bdce7c fix metadata parsing 2020-04-12 14:40:37 +01:00
Asim Aslam
b08c636b44 fixup handler tests 2020-04-12 14:29:38 +01:00
Asim Aslam
d03a02f2e4 fix import 2020-04-12 11:25:12 +01:00
Asim Aslam
962588b649 Strip MetadataKey global var 2020-04-12 11:16:08 +01:00
0a2363b49b
api minor improvements (#1526)
* api/handler/rpc: unblock all http methods and set Host meta
* api/router/static: add debug log

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-11 22:21:55 +03:00
Asim Aslam
0f2006ac50 fix compilation issues 2020-04-11 11:02:06 +01:00
Asim Aslam
d4b2c948dd Remove cloudflare store 2020-04-10 19:50:57 +01:00
Asim Aslam
e5268dd0a6
move reg util to own package (#1523)
* move reg util to own package

* fix test

* fix broken static router
2020-04-10 17:41:10 +01:00
Ben Toogood
f9cfbe96c0 Merge master into resover-refactor 2020-04-09 12:42:34 +01:00
1063b954de
dont display t.Log/t.Logf as errors in github actions (#1508)
* fix tests and github action annotations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-09 14:05:46 +03:00
Ben Toogood
4ff959ef50 Dynamic Namespace 2020-04-09 11:03:33 +01:00
Ben Toogood
27eb7db1c2 Add default resolver to api router 2020-04-09 10:34:21 +01:00
Ben Toogood
3ede494945 Change import name 2020-04-09 10:32:08 +01:00
Ben Toogood
f102aba4c1 Fix HTTP tests 2020-04-09 10:28:38 +01:00
Asim Aslam
bf8ebf8ad2 add namespace 2020-04-08 23:27:32 +01:00
Asim Aslam
48dd30c4c2 fix http test 2020-04-08 19:20:43 +01:00
Ben Toogood
8ff86ae08b Extract micro resolver 2020-04-08 16:21:53 +01:00
Asim Aslam
b2079669f7 Strip namespace from router 2020-04-08 15:39:01 +01:00
Asim Aslam
2c1d1afd71 Strip namespace from registry router 2020-04-08 15:38:02 +01:00
Asim Aslam
9a73828782 Remove unused handlers 2020-04-08 15:34:11 +01:00
ben-toogood
6b524e2c55
Merge branch 'master' into namespace 2020-04-08 09:12:28 +01:00
Ben Toogood
e907d24e3b API Wrappers 2020-04-07 19:29:26 +01:00
Ben Toogood
67cd59d7bc Rename namespace from Resolver.Endpoint 2020-04-07 16:27:59 +01:00
Ben Toogood
4362a885eb Refactor Namespace Resolver 2020-04-07 16:24:51 +01:00