Changes for page Версія 6: Налаштування
Last modified by Ashterix on 2024/07/11 10:08
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Version 6. Bundle config1 +2. Bundle config - Content
-
... ... @@ -2,11 +2,6 @@ 2 2 {{toc/}} 3 3 {{/box}} 4 4 5 -{{error}} 6 -**WARNING!!! **This version of the documentation is out of date. 7 -In JsonRpcBundle version 7, the configuration has undergone significant changes and is not backwards compatible with version 6. 8 -{{/error}} 9 - 10 10 (% class="wikigeneratedid" %) 11 11 All bundle settings are located in the file {{code language="none"}}config/packages/ufo_json_rpc.yaml{{/code}}. 12 12 ... ... @@ -167,24 +167,6 @@ 167 167 class: App\Services\RpcSecurity\UserTokenValidator 168 168 {{/code}} 169 169 170 -= Block {{code language="none"}}async{{/code}} = 171 - 172 -This block is for configuring [[asynchronous transport>>doc:docs.JsonRpcBundle.functionality.async.WebHome]]. 173 - 174 -Add the parameter {{code language="none"}}rpc_async{{/code}} which contains a string in DSN format. This string is the configuration for [[Symfony Messenger>>https://symfony.com/doc/current/messenger.html]], and it points to the asynchronous transport where the RPC Server will be waiting for incoming requests if you have a consumer running ({{code language="none"}}php bin/console messenger:consume rpc_async{{/code}}). For a more detailed understanding of this process, read the [[Symfony Messenger documentation>>https://symfony.com/doc/current/messenger.html]]. 175 - 176 -{{code language="yaml" layout="LINENUMBERS" title="config/packages/ufo_json_rpc.yaml"}} 177 -ufo_json_rpc: 178 - async: 179 - rpc_async: '%env(resolve:RPC_TRANSPORT_DSN)%' 180 - 181 -{{/code}} 182 - 183 -(% class="box warningmessage" %) 184 -((( 185 -This configuration implies that you have an environment variable RPC_TRANSPORT_DSN set, which contains the DSN string. 186 -))) 187 - 188 188 = The {{code language="none"}}docs{{/code}} block = 189 189 190 190 This block configures the generation of documentation when you make a GET request on the RPC Server ... ... @@ -217,65 +217,6 @@ 217 217 key_for_methods: some_custom_key 218 218 {{/code}} 219 219 220 -=== Parameter {{code language="none"}}async_dsn_info{{/code}} === 221 - 222 -Responsible for displaying information about asynchronous transport in the documentation. 223 - 224 -{{code language="yaml" layout="LINENUMBERS" title="config/packages/ufo_json_rpc.yaml"}} 225 -ufo_json_rpc: 226 - async_dsn_info: true # or false 227 -{{/code}} 228 - 229 -==== **Documentation Example** ==== 230 - 231 -{{code language="json" layout="LINENUMBERS" title="GET: /api"}} 232 -{ 233 - "envelope": "JSON-RPC-2.0/UFO-RPC-6", 234 - "contentType": "application/json", 235 - "description": "", 236 - "transport": { 237 - "sync": { 238 - "scheme": "http", 239 - "host": "example.com", 240 - "path": "/api", 241 - "method": "POST" 242 - }, 243 - "async": { 244 - "scheme": "amqp", 245 - "user": "{user}", 246 - "pass": "{pass}", 247 - "host": "async_rabbit", 248 - "port": 5672, 249 - "path": "/%2f/json-rpc" 250 - } 251 - }, 252 - "methods": { 253 - ... 254 - } 255 -} 256 -{{/code}} 257 - 258 -{{info}} 259 -Do not worry about the security of your authorization data contained in the DSN. 260 - 261 -The documenter is designed in such a way that before displaying DSN information, it removes user data and passwords, as well as other sensitive information, such as tokens, secret keys, etc. 262 - 263 -The template for protecting data is {{code language="none"}}/([\w\d_]*(?:secret|access|token|key)[_\w]*)=((?:\w|\d)+(?=&?))/{{/code}}. 264 - 265 -Example: 266 - 267 -{{code language="json" layout="LINENUMBERS" title="RPC_TRANSPORT_DSN=https://sqs.eu-west-3.amazonaws.com/123456789012/messages?access_key=AKIAIOSFODNN7EXAMPLE&secret_key=j17M97ffSVoKI0briFoo9a"}} 268 -{ 269 - "async": { 270 - "scheme": "https", 271 - "host": "sqs.eu-west-3.amazonaws.com", 272 - "path": "/123456789012/messages", 273 - "query": "access_key={access_key}&secret_key={secret_key}" 274 - } 275 -} 276 -{{/code}} 277 -{{/info}} 278 - 279 279 === Parameter {{code language="none"}}validations{{/code}} === 280 280 281 281 Responsible for displaying in the documentation methods additional blocks that indicate data validation requirements. ... ... @@ -300,7 +300,7 @@ 300 300 (% class="box infomessage" %) 301 301 ((( 302 302 In this example, I removed the content of the objects symfony_assertions to simplify the example. 303 -For more information on method validation, see the page **[[Validate procedures>>doc: docs.JsonRpcBundle.add_rpc_service.assertions.WebHome]]**221 +For more information on method validation, see the page **[[Validate procedures>>doc:.add_rpc_service.assertions.WebHome]]** 304 304 ))) 305 305 306 306 {{code language="json" layout="LINENUMBERS" title="GET: /api"}}