1
0
mirror of https://github.com/go-micro/go-micro.git synced 2026-04-30 19:15:24 +02:00
Commit Graph

381 Commits

Author SHA1 Message Date
Copilot ac47a4650a MCP gateway: add per-tool scopes, tracing, rate limiting, and audit logging (#2850)
* Initial plan

* Add MCP per-tool scopes, tracing, rate limiting, and audit logging

- Add Scopes field to Tool struct for per-tool scope requirements
- Add Auth (auth.Auth) integration to Options for token inspection
- Add trace ID generation (UUID) propagated via metadata to downstream RPCs
- Add per-tool rate limiting with configurable requests/sec and burst
- Add AuditFunc callback for immutable tool-call audit records
- Extract tool scopes from registry endpoint metadata ("scopes" key)
- Update both HTTP and stdio transports with auth/trace/rate/audit
- Add comprehensive tests for all new functionality

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Revert unrelated example go.mod changes

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Remove auto-generated example go.sum files

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Add WithEndpointScopes helper, gateway-level ToolScopes, and documentation

- Add server.WithEndpointScopes() for declaring per-endpoint auth scopes at
  handler registration time
- Add mcp.Options.ToolScopes for gateway-level scope overrides without
  changing individual services
- Update documented example to show WithEndpointScopes usage
- Update examples/mcp/README.md with scopes, tracing, and rate-limiting docs
- Update gateway/mcp/DOCUMENTATION.md with scopes section and FAQ
- Add tests for both new features

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Fix ToolScopes doc comment: clarify override (not merge) semantics

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Revert unrelated example go.mod/go.sum changes

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Rename ToolScopes to Scopes in MCP Options

The field name "Scopes" is more universal and consistent with how
auth scopes are used throughout go-micro. Updated all code references,
tests, and documentation.

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* MCP gateway: add per-tool scopes, tracing, rate limiting, and audit logging

Co-authored-by: asim <17530+asim@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: asim <17530+asim@users.noreply.github.com>
2026-02-11 21:01:31 +00:00
asim fe76f3ddb5 further mcp integrations 2026-02-11 14:12:21 +00:00
asim a38d7df106 go fmt 2026-02-04 14:37:40 +00:00
Copilot a100a47340 Fix google.protobuf.Any JSON marshaling missing @type field (#2845)
* Initial plan

* Update JSON codec to use modern protojson for proper Any type support

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Add comprehensive tests for google.protobuf.Any JSON marshaling

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Revert codec/proto to old protobuf package for backward compatibility

Co-authored-by: asim <17530+asim@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: asim <17530+asim@users.noreply.github.com>
2026-02-04 09:33:27 +00:00
Asim Aslam 91d91eef1f Fix for https://github.com/micro/go-micro/issues/2687 2025-10-22 06:38:16 +00:00
asim 1dde737b64 move micro cli and protoc-gen-micro to cmd/ 2025-10-14 11:13:35 +01:00
Asim Aslam aa2ed9aa91 Patch for potential deadlock 2025-10-07 16:20:45 +00:00
Ak-Army 9070b3befd [feature] ability to use wildcard in topic name (factory-events.*.*) (#2804) 2025-09-09 12:51:39 +01:00
Ak-Army 88f38eaef6 Subscribe error handling (#2785)
* [fix] etcd config source prefix issue (#2389)

* http transport data race issue (#2436)

* [fix] #2431 http transport data race issue

* [feature] Ability to close connection while receiving.
Ability to send messages while receiving.
Icreased r channel limit to 100 to more fluently communication.
Do not dropp sent request if r channel is full.

* [feature] always subscribes to all topics and if there is an error in one of them, the unsuccessful topics will be subscribed to again

---------

Co-authored-by: Johnson C <chengqiaosheng@gmail.com>
2025-06-04 08:55:17 +01:00
Asim Aslam caba761c7b fix extraction field naming with standard Go types (#2763) 2025-05-15 18:59:10 +01:00
asim 12dfa797dc drop the separate go mods 2025-05-14 22:03:38 +01:00
Asim Aslam 230505bf5a Add grpc plugin (#2758)
* Add grpc plugin

* remove stale readmes
2025-05-14 21:04:42 +01:00
asim 563e0d265d meh 2024-07-07 18:40:24 +01:00
Ak-Army 1515db5240 Fix stream eos error (#2716)
* [fix] etcd config source prefix issue (#2389)

* http transport data race issue (#2436)

* [fix] #2431 http transport data race issue

* [feature] Ability to close connection while receiving.
Ability to send messages while receiving.
Icreased r channel limit to 100 to more fluently communication.
Do not dropp sent request if r channel is full.

* [fix] Do not send error when stream send eos header, just close the connection

* [fix] Do not overwrite the error in http client

---------

Co-authored-by: Johnson C <chengqiaosheng@gmail.com>
2024-07-02 13:06:14 +01:00
asim 610c00859f v5 2024-06-04 21:40:43 +01:00
Elmut ca6190f5f2 append to subscribers (#2640)
* append to subscribers

* Update rpc_router.go

error correction log
2023-11-26 11:08:28 +01:00
Lukasz Raczylo a7522e7d6c fix: struct field alignment (#2632) 2023-04-26 02:16:34 +02:00
David Brouwer a3980c2308 feat: add test framework & refactor RPC server (#2579)
Co-authored-by: Rene Jochum <rene@jochum.dev>
2022-10-20 13:00:50 +02:00
Rene Jochum 010b1d9f11 fix: linting issues (#2566) 2022-09-30 20:32:55 +02:00
David Brouwer 85c0b0b8eb fix: some linting issues (#2563) 2022-09-30 16:27:07 +02:00
Mohamed MHAMDI 1db36357d5 feat(logger): add logger option to all micro components (override DefaultLogger) closes #2556 (#2559)
* feat(logger): add logger option to all components

* fix: refactor api/rpc.go

* fix: refactor api/stream.go

* fix: api/options.go comment

* fix(logger): do not use logger.Helper internally

* fix(logger): fix comments

* fix(logger): use level.Enabled method

* fix: rename mlogger to log

* fix: run go fmt

* fix: log level

* fix: factories

Co-authored-by: Mohamed MHAMDI <mmhamdi@hubside.com>
Co-authored-by: Davincible <david.brouwer.99@gmail.com>
2022-09-29 16:44:53 +02:00
Arvin 63a9b94820 support use of listen options (#2536)
* feat: support use of listen options

* style: Adjust the import order of packages.
2022-07-30 10:56:14 +01:00
David Brouwer 107bd74187 fix: allow event subscribers to use pointers (#2514)
When a subscriber would use a pointer as event type, panics would occur.
2022-06-22 09:01:13 +08:00
bosima 1919048c8f Support direct generation of grpc method (#2474)
* Support direct generation of grpc method when package and service names of proto files are different.
* fix req.Interface() return nil.
2022-04-10 22:12:39 +08:00
Johnson C a40f6e8fae [fix] fixing f.IsExported undefined issue (#2382)
IsExported needs go1.17, replace with PkgPath
2021-12-07 17:30:48 +08:00
Johnson C 90b3e4af0b [fix] ignore unexported field (#2354)
ignore unexported field when register endpoints
2021-11-18 17:07:00 +08:00
Asim Aslam 0c2041e439 add events package (#2341)
* add events package

* update go version
2021-11-08 08:52:39 +00:00
Asim Aslam 1cd7cfaa6c go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
JeffreyBool acc3f5479f fix service default logger (#2171)
* Update http.go

Exit before deregister is executed

* Create http.go

Exit before deregister is executed

* Solve the problem that the resources have not been fully released due to early exit

* Optimize some code

* Optimize some code

* Optimize some code

* fix service default logger
2021-05-23 08:38:20 +01:00
Asim Aslam d94936f6c9 v3 (#2104)
* v3

* revert plugins

* fixup some issues
2021-01-20 13:54:31 +00:00
Asim Aslam eb1e22bd10 strip grpc 2020-12-30 08:21:30 +00:00
Asim Aslam a7c31a0d2b refactor all the things 2020-12-29 15:49:26 +00:00
Asim Aslam 35c59042bf refactor network 2020-12-12 18:59:40 +00:00
Di Wu 3e6ac73cfe Fix invalid usage for sync.WaitGroup (#1752)
* Custom private blocks

* Fix invalid usage for sync.WaitGroup

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-03 11:30:59 +01:00
ben-toogood 8dfd93e915 util/wrapper: Add Static Client wrapper (#1685)
* util/wrapper: Add Static Client wrapper

* util/wrapper/static: pass address to stream too

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

* add static client wrapper tests

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

* server: fix error message spaces between words

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

* server/{rpc,grpc}: replace log.Error with log.Errorf

* server/grpc: fix log typo

* server/rpc: fix log typo

Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-06-12 10:42:52 +01:00
Ben Toogood 2729569f66 Add Debug.Cache method 2020-05-24 18:45:57 +01:00
Asim Aslam a29676b86a Registration Retry / Interval (#1651)
* Change the default ttl to 90 seconds

* add retries to registration

* Add retry to web register
2020-05-20 11:49:09 +01:00
Asim Aslam 19a03babc4 Update server.go 2020-05-12 11:32:01 +01:00
Janos Dobronszki 1eb63635b5 Adding file upload and download capabilities (#1610) 2020-05-11 14:08:27 +02:00
Ben Toogood 506006f0fa Auth Options 2020-05-11 11:47:59 +01:00
Socket 46d09ec2bc unsubscribe can async (#1596)
Co-authored-by: huangshaojie <huangshaojie@corp.netease.com>
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-04-30 10:42:13 +01:00
Vasiliy Tolstov 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
Asim Aslam 7345ce9192 change logging for service startup 2020-04-23 11:24:39 +01:00
Vasiliy Tolstov bea092f082 server: set registered only after configuring subscribers (#1557)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-21 23:01:59 +03:00
Janos Dobronszki 075d7d4fef Renaming ShutdownSignals -> Shutdown (#1553) 2020-04-21 14:14:20 +02:00
Janos Dobronszki e5c215556e Add SIGKILL to shutdown signals (#1552)
* Add SIGKILL to shutdown signals

* go mod tidy

* Add missing file
2020-04-21 14:00:12 +02:00
Vasiliy Tolstov 4d177a782e vendor proto files from google (#1536)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-15 13:22:32 +03:00
Vasiliy Tolstov 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 1768958af7 fix typo 2020-04-08 22:50:56 +01:00
Vasiliy Tolstov 1fbc056dd4 minimize allocations (#1472)
* server: minimize allocations on re-register

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

* server: stop old instance before Init()

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

* client/grpc: fix allocations in protobuf marshal

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

* codec/json: fix allocations in protobuf marshal

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

* remove stop from init

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

* codec/grpc: expose MaxMessageSize

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

* codec: use buffer pool

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

* metadata: minimize reallocations

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

* util/wrapper: use metadata helper

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

* registry/cache: move logs to debug level

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

* server: move logs to debug level

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

* server: cache service only when Advertise is ip addr

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

* server: use metadata.Copy

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-08 10:50:19 +01:00