{"id":20292030,"url":"https://github.com/bankiru/rpc-server-bundle","last_synced_at":"2025-09-11T07:41:16.878Z","repository":{"id":62491554,"uuid":"56494619","full_name":"bankiru/rpc-server-bundle","owner":"bankiru","description":"Abstract RPC server","archived":false,"fork":false,"pushed_at":"2022-11-08T05:06:32.000Z","size":105,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T14:26:03.493Z","etag":null,"topics":["api","api-server","bundle","rpc","symfony"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bankiru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-18T09:26:16.000Z","updated_at":"2023-07-27T05:47:51.000Z","dependencies_parsed_at":"2023-01-22T22:01:18.890Z","dependency_job_id":null,"html_url":"https://github.com/bankiru/rpc-server-bundle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bankiru/rpc-server-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bankiru%2Frpc-server-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bankiru%2Frpc-server-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bankiru%2Frpc-server-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bankiru%2Frpc-server-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bankiru","download_url":"https://codeload.github.com/bankiru/rpc-server-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bankiru%2Frpc-server-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274596077,"owners_count":25314021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-server","bundle","rpc","symfony"],"created_at":"2024-11-14T15:14:55.316Z","updated_at":"2025-09-11T07:41:16.860Z","avatar_url":"https://github.com/bankiru.png","language":"PHP","readme":"[![Latest Stable Version](https://poser.pugx.org/bankiru/rpc-server-bundle/v/stable)](https://packagist.org/packages/bankiru/rpc-server-bundle) \n[![Total Downloads](https://poser.pugx.org/bankiru/rpc-server-bundle/downloads)](https://packagist.org/packages/bankiru/rpc-server-bundle) \n[![Latest Unstable Version](https://poser.pugx.org/bankiru/rpc-server-bundle/v/unstable)](https://packagist.org/packages/bankiru/rpc-server-bundle) \n[![License](https://poser.pugx.org/bankiru/rpc-server-bundle/license)](https://packagist.org/packages/bankiru/rpc-server-bundle)\n\n[![Build Status](https://travis-ci.org/bankiru/rpc-server-bundle.svg)](https://travis-ci.org/bankiru/rpc-server-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/bankiru/rpc-server-bundle/badges/quality-score.png)](https://scrutinizer-ci.com/g/bankiru/rpc-server-bundle/)\n[![Code Coverage](https://scrutinizer-ci.com/g/bankiru/rpc-server-bundle/badges/coverage.png)](https://scrutinizer-ci.com/g/bankiru/rpc-server-bundle/)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/53b98f25-6b08-43b2-9ebe-e2d83e17b868/mini.png)](https://insight.sensiolabs.com/projects/53b98f25-6b08-43b2-9ebe-e2d83e17b868)\n\n# HTTP RPC Server bundle\n\nThis bundle provides default controller realisation to handle RPC \nrequests which come to the application via HTTP requests\n \n## Implementations\n\nRPC server does not declares any implementation requirements. Some could be\n\n* JSON-RPC\n* SOAP (extends XML-RPC)\n\nor other custom RPC which operates with method+parameters and utilizes single\nendpoint for several methods\n \n## HTTP Endpoints\n\nEndpoint is a HTTP route which process basic HTTP request, providing initial parsing\nand processing request data\n\nTo enable HTTP endpoint you should enable custom endpoint router loader via the following router configuration:\n\n```yaml\n# app/config/routing.yml\nrpc:\n  resource: .\n  type: endpoint\n\n```\n\nResource value is not important, it is ignored when loading routes as the endpoints are\nconfigured vua config\n\n### Configuration\n\nBasic endpoint configuration looks like\n\n```yaml\nrpc:\n  router:\n    endpoints:\n      my-public-endpoint:\n        path: /\n        defaults:\n          _controller: JsonRpcBundle:JsonRpc:jsonRpc\n          _format: json\n        context: Default\n        resources:\n        - \"@MyBundle/Resources/config/service_rpc.yml\"\n```\n\nThis creates endpoint on URL / with generic symfony controller. Also it \npre-populates the methods from the `service_rpc.yml` config file\n\n`my-public-endpoint` will become a route name, so make sure it does not \noverlap with other routes until you want it do to this.\n \n### Method routing\n\nEach RPC request has method and parameters. You can configure the application\nto handle different methods within different endpoints with different actions\n\nGeneric configuration looks like\n\n```yaml\nmy_bundle:\n  resource: \"@MyBundle/Rpc/\"\n  prefix: my_bundle/\n  type: annotation\n```\n\nDifferent resource types are supported. Built-in are\n\n#### Annotation \n\n```php\n@Method(\"my-bundle/my-method\", context={\"private\"}, defaultContext=false) \n```\n\n#### Yaml\n\nDifferent endpoint implementation may utilize different controller name parsers, so\n`MyBundle:Test:entity` notation is endpoint-dependent. I.e JSON-RPC may search `TestController` \ncontroller in `MyBundle\\JsonRpc\\TestController`\n\n```yaml\nmy-bundle/my-method:\n  controller: \"MyBundle:Test:entity\"\n  default_context: true\n  context: private\n```\n\n#### Resource\n\nYou can pass directory, class, file, yaml config as method source with \nprefix and context inheritance\n \nThe following chaing will result in `prefix/annotation/sub` method \nhandled by `AnnotationController::subAction` with `private`+`default` context\n \n```yaml\nprivate:\n  resource: jsonrpc_private_nested.yml\n  context: private\n```\n\n```yaml\nannotation:\n  resource: \"@JsonRpcTestBundle/JsonRpc\"\n  prefix: prefix/\n```\n\n```php\n/**\n * Class AnnotationController\n *\n * @package Bankiru\\Api\\JsonRpc\\Test\\JsonRpc\n * @Method(\"annotation/\")\n */\nclass AnnotationController extends Controller\n{\n    /**\n     * @return array\n     * @Method(\"sub\")\n     */\n    public function subAction()\n    {\n        return [];\n    }\n}\n```\n\n## Events\n \nThis bundle repeats the generic symfony request processing flow. You can \nhook your extension into given system events\n\n * `rpc.request` is triggered on handling RPC call\n    * Routing happens here\n * `rpc.controller` is triggered to filter controller (i.e. allows security filtering)\n * `rpc.response` is triggered whenever response is acquired by the endpoint processor \n * `rpc.view` is triggered if response, returned from controller is not \n    instance of `RpcResponseInterface`\n * `rpc.exception` is triggered when exception is raised during RPC call processing\n * `rpc.finish_request` is used to finalize RPC response before it is returned to HTTP controller\n\n\n## RPC Controller implementation\n\nThe goal of implementing controller is to extend abstract `RpcController` passing\n`RequestInterface` and endpoint name into `getResponse` method.\n\n`RequestInterface` is an extension of `RpcRequestInterface` with extra attributes\nallowing request metadata carrying alongside the request.\n \nThe generic solution is to convert incoming symfony `Request` instance into your own\nimplementation of `RequestInterface` (i.e extract method and args from XML-RPC or JSON-RPC requests)\nand send serialized response back, transforming `RpcResponseInterface` back to your response object. \n\nYou can also automatically convert `RpcResponseInterface` into your serialized response via\ngeneric symfony view event processing\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbankiru%2Frpc-server-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbankiru%2Frpc-server-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbankiru%2Frpc-server-bundle/lists"}