summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Generate vcpkg manifestHEADdevJoerg Bornemann4 days1-0/+1
| | | | | | | | | Annotate qt_find_package calls for vcpkg.json generation. Pick-to: 6.11 Task-number: QTBUG-73760 Change-Id: I6ddf18493d178374c79f9c12ad8cad4d56363249 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Long Live QGrpcInterceptor!Dennis Oberst11 days12-12/+681
| | | | | | | | | | | | | | | | | | | | | | | This commit implements the new QtGrpc interception mechanism. It is based on the idea of subclassing each provided QGrpc<HookPoint>Interceptor interface that one is interested in and attach those to the channel. Internally, we cache each implemented interfaces and provide the hook-point handlers to the library. Library code should always check for usage before invoking the interceptor engine to follow the zero-overhead principle. In this mechanism, request messages are provided to interceptors as QProtobufMessage objects (before serialization) and responses are provided as QByteArray (before deserialization). This patch provides the implementation and tests. Documentation will be provided as follow-up. Fixes: QTBUG-128338 Change-Id: I50a9bfa7f1c125819b8e7dfcf7132746dd8df18c Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* QGrpcClientBase: protect against same channel attachDennis Oberst11 days1-0/+6
| | | | | | | | Re-attaching the same channel shouldn't be counted as valid. Pick-to: 6.10 6.8 Change-Id: I976d458171938c468dd686c4c3e9197e2ecab7af Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Provide common RPC functionality handlingDennis Oberst11 days3-6/+19
| | | | | | | | | | | | | This commit provides a central place for handling common RPC functionality. This is a prerequisite for interceptors, which benefits from the centralized access. Task-number: QTBUG-128338 Pick-to: 6.10 6.8 Change-Id: I684ac595e4f46cc556cc93c2f798de73753552a1 Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* QProtobufMessage: add qprotobufmessage_cast() and metaObject()Dennis Oberst11 days2-0/+86
| | | | | | | | | | | | | | Provides public access to the internal meta-object via metaObject() and introduces qprotobufmessage_cast, a qobject_cast-like function that relies on it. This is a prerequisite for interceptors, which require run-time type information to inspect and cast messages to their concrete types. Task-number: QTBUG-128338 Change-Id: Idfede87c5f2f2358f2409bc488b6abece4cc718b Reviewed-by: Alexey Edelev <semlanik@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QGrpcOperation: read should fail for nullptr in Release too!Dennis Oberst11 days1-2/+4
| | | | | | | | | Currently the assertion will only take place in debug builds. We shouldn't continue processing on nullptr messages in release builds too! Pick-to: 6.10 6.8 Change-Id: I5d010a4c1589b8d3b5a0e332bef20d60c23d490b Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* QGrpcHttp2Channel: handle immediate cancellation and improve tracingDennis Oberst11 days1-5/+14
| | | | | | | | | | | | | Check if the call got cancelled before sending the initial request, as this can happen. Furthermore improve the tracing and logic: * don't call RST_STREAM on Idle streams. * print warning if state check fails. Pick-to: 6.10 6.8 Change-Id: I902d2fba72a27ea7de58284116a59c1c9ce5d78f Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Enforce emission of QGrpcOperation::finishedDennis Oberst11 days4-64/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | We've given the promise that the QGrpcOperation::finished signal is emitted once during the lifetime of an RPC at multiple places! That implies also the start of the RPC, but as of now this wasn't true. The QGrpcClientBase fails a RPC under some conditions. We move this logic to the QGrpcOperation class now. This patch guarantees that the construction of RPC handlers is successfull and that the finished signal is emitted in the error case. In QGrpcOperation we remove the atomic isFinished flag. We replace it with a more descriptive State, to handle the additional 'Invalid' state. No multithreading is happening in the finished signal emission, so atomic properties are not needed. The 'serializeInitialMessage' is a preemptive move for the upcoming interceptors logic, which will require such centralized handler. [ChangeLog][Important Behavior Changes][QGrpcClientBase/QGrpcOperation] RPC-handlers are now guaranteed to be constructed. The finished signal will now be invoked at least once during the lifetime, as documented. Change-Id: I83bcbcefa1f5533401c71260608327fe621324e2 Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Introduce Descriptor and change construction orderDennis Oberst11 days15-178/+198
| | | | | | | | | | | | | | | | | | | | | The context shouldn't be shared. The previous patch already addresses this in the public API and this patch changes the internal handling. We construct the operation-context now inside the QGpcOperation and provide proper parent<>child handling between them. We teach our users that the finished signal is _always_ emitted for the lifetime of an RPC, but this is not true! During construction, there are checks which can fail, which would return a null operation. To properly fix that we need to have the Context available on construction already (due to QGrpcOperation's API). This makes anyway the most sense logically. This patch doesn't fix that, but is a preparation to change that in the following patches. The same holds true for providing the Descriptor and the channel. This will be required to provide the Interceptors logic. Change-Id: If6c1205ff0fbf3f4f54eb27b83b6c59ffe7df4e5 Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Deprecate semi-private QGrpcOperationContext::argumentDennis Oberst11 days4-15/+19
| | | | | | | | | | | | | | | | | We deprecate the QGrpcOperationContext::argument for the next release. The only users of this class are those implementing our undocumented and private channel API (this is why it's semi-private). These users should adapt their code. This should be a trivial change. It never made sense to store the initial argument in the context, as it could be a large message like 5 MB stored unnecessarily. [ChangeLog][Deprecation Notice][QGrpcOperationContext] Deprecate the argument() method in favor of the new abstract rpc interface. Change-Id: Ic579c04ff8b6ae024539ee5605765410104b618c Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Change arguments for the private channel-rpc interfaceDennis Oberst11 days4-32/+40
| | | | | | | | | | | | | | | | | | | | | | The new interface provides the operationContext as a raw pointer and also contains the initial serialized argument to start the call. We observed that having shared ownership of the context between the channel and the QGrpcOperation is problematic. The latter is owned by the user, and if the QGrpcOperation is destroyed, there is no point in keeping the context alive any longer. Channel implementations should also treat the context as a weak reference and either connect to its destroyed signal or check for validity. This patch provides a better lifetime contract and prepares to remove the unneeded storage overhead of QGrpcOperationContext::argument. [ChangeLog][Important Behavior Changes][QAbstractGrpcChannel] The abstract interface of private RPC functions has changed. Users of this private, undocumented API must adapt their code. Change-Id: I0baa7dc8639ec49fd28ce122476981545a36a0b4 Reviewed-by: Alexey Edelev <semlanik@gmail.com>
* Doc: Add missing property docsPaul Wicking2025-11-171-0/+23
| | | | | | Task-number: QTBUG-141872 Change-Id: I2114b0a74f0ac2ca604c1d4b645a610252fc9045 Reviewed-by: Topi Reinio <topi.reinio@qt.io>
* Doc: Exclude auto-generated protobuf wrappers from docsPaul Wicking2025-11-171-0/+4
| | | | | | | | | | | | | | | Auto-generated wrapper headers in `google/protobuf/` produce undocumented property warnings. These thin wrappers around Google's types should reference upstream protobuf documentation rather than duplicate property semantics. Add an `excludefiles` pattern to skip `*.qpb.h` files during documentation generation. Pick-to: 6.10 6.10.1 Task-number: QTBUG-141872 Change-Id: Icf1371dfe2eb727a889e7182c088390345b12603 Reviewed-by: Topi Reinio <topi.reinio@qt.io>
* Doc: Add missing property docsPaul Wicking2025-11-062-0/+26
| | | | | | | | Pick-to: 6.10 6.8 Task-number: QTBUG-140629 Change-Id: If91c00f72a52bfd0b62790d44cd5e489281a767d Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Add alt text for \image tags for qtgrpcEren Bursali2025-11-061-3/+7
| | | | | | | | Adding alt texts that were needed for QDoc Pick-to: 6.8 Change-Id: I19b8800fc80d62c6d1996a434fb223cfc2a6e445 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* QGrpcHttp2Channel: Implement dataframe decompressionDennis Oberst2025-10-021-6/+55
| | | | | | | | | | | | | | | | | | Implement the missing decompression handling. We were advertising an accepted encoding of GrpcAcceptEncodingValue("identity,deflate,gzip") but only ever handled identity (i.e. no compression) ! We now check the negotiated content-encoding in the initialMetadata to set up the appropriate decompression. Since compression can vary per message, dynamic processing is required. [ChangeLog][QGrpcHttp2Channel] Added missing decompression handling for 'deflate' and 'gzip'. Fixes: QTBUG-129286 Pick-to: 6.10 6.9 6.8 Change-Id: I3ed4af7b21b51c52bccc3e6c314ae166e80c94a8 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: Report data loss for incomplete trailing messagesDennis Oberst2025-10-021-1/+8
| | | | | | | | | | | | | | In case we receive the endStream flag when processing received data, we now return a non-ok QGrpcStatus if there's still unprocessed data in the intermediate container. [ChangeLog][QGrpcHttp2Channel][Important Behavior Changes] finishes the communication with a non-ok QGrpcStatus (DataLoss) when the stream is closed with unprocessed trailing data. Pick-to: 6.10 6.9 6.8 Change-Id: I53d36c012d6cab57f4d8b652518ff5ccd5be24f2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: Replace ExpectedData with GrpcDataParserDennis Oberst2025-10-021-30/+47
| | | | | | | | | | | | We are missing functionality! We are omitting any compressed messages. This patch doesn't add the compression handling but a more structured and sane way of encapsulating the data parsing. Added the compression flag extraction to the parsing. Task-number: QTBUG-129286 Pick-to: 6.10 6.9 6.8 Change-Id: I699fdb6fb0279453a367930e950c2af3e992063d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QGrpcOperation: add serverInitialMetadataReceived signalDennis Oberst2025-10-014-2/+36
| | | | | | | | | | | | | | The initial metadata is received when the call starts, often at a different time then when the RPC finishes. Interceptors provide a way to access this globally for all RPC but we should add this signal for our users who are only interested in specific handlers. [ChangeLog][QGrpcOperation] Added the serverInitialMetadataReceived signal. Change-Id: I362a601675029a21d7721275a1b8174ded07fabf Fixes: QTBUG-139558 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpc{Call,Channel}Options: provide equality operatorsDennis Oberst2025-10-014-0/+31
| | | | | | | | | | | | | | It makes sense to provide the equality operators to these classes. However, omit the otherwise common 'qHash' functionality as it makes no sense to hash a options class. [ChangeLog][QGrpcCallOptions/QGrpcChannelOptions] Made the options classes equality comparable. Task-number: QTBUG-128338 Change-Id: Idb7ff6946dfef373eba32839ac4b3faf2ff4e5c2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcOperationPrivate: add missing includesDennis Oberst2025-10-011-0/+5
| | | | | | Pick-to: 6.10 6.9 6.8 Change-Id: I446455abf26abc78ad89d1811114263749c08b4f Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcOperation: add private slots for handling context signalsDennis Oberst2025-10-012-14/+24
| | | | | | | | | More structured way of handling the code that complements the interceptors patch. Pick-to: 6.10 6.9 6.8 Change-Id: I6660e9a95ff8faef8e50966d912fdf9f1a7967c9 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcOperation: delete rvalue-this version of metadata gettersDennis Oberst2025-09-161-0/+2
| | | | | | | These should not be called. Change-Id: I6889df51affce6d1ed53b7033cb500434c1595ce Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Move QtGrpc Chat example to Networking categoryKai Köhne2025-09-091-1/+3
| | | | | | | | | | | | This is a better place then the 'Application Examples' category that should be reserved for higher-level examples that work out of the box. Also highlight the example in the Networking category. Pick-to: 6.8 6.9 6.10 Task-number: QTBUG-137988 Change-Id: I75f630daeba350043f6d0aa3a90b30bee967e6b1 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* docs: Add common http2-metadata description and distribute itDennis Oberst2025-09-053-7/+19
| | | | | | | | | | | Our documentation of what the QGrpcHttp2Channel should accept as metadata was incomplete. Add the missing bits and give readers a link to the original information, which is coming from RFC 7540. Task-number: QTBUG-139558 Pick-to: 6.10 6.9 6.8 Change-Id: Ie170fd1f5300597b31dd49d47d5e01c469bf6ec3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcOperation: move Private into separate fileDennis Oberst2025-09-053-27/+58
| | | | | | | | For private access. Pick-to: 6.10 6.9 6.8 Change-Id: I9d8436c9f283cfe1c2ecb6ba98481ee94d2f5b3e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: fix illegal access when printingDennis Oberst2025-09-051-1/+1
| | | | | | | | | We are constructing 'hostUri' at this point. Don't use it for printing. Coverity-Id: 894268 Pick-to: 6.10 6.9 6.8 Change-Id: I2b478de2d3865112978202959e1af07b17f7751a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* GrpcToolsMacros.cmake: continue on invalid filesDennis Oberst2025-09-021-1/+1
| | | | | | | | | | | Previously the helper returned early in case no service section was found in the proto file. If we supply multiple files, this function should simply skip those. Otherwise it's not possible to process such a list variable. Pick-to: 6.10 6.9 6.8 Change-Id: Iab31fa81404f2df2ec4ad628810ff7f948b3eb5f Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Http2Handler: Modify and add debug logsDennis Oberst2025-09-021-1/+6
| | | | | | | | | | For understanding the flow better, if needed. Change the log for failed cancellations to be a warning. This information is usefull to see without special logging rules! Pick-to: 6.10 6.9 6.8 Change-Id: I5e30962381c4f476d8e9e1258f5af10c7586942c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: Guarantee transportation schemeDennis Oberst2025-09-021-145/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if TLS or QLocalSocket is explicitly requested but unavailable, we fall back to TCP. This is not a safe approach. This patch asserts on that condition and uses qCFatal to indicate the mismatch instead of silently falling back to another transport. Given the security aspects of this file, this strengthens guarantees by ensuring the requested transport is actually used. Also: Make construction initialization friendly! Separated concerns by splitting the large constructor into smaller segments, achieving the same result through helper functions in the initializer list. Added a SocketType enum to clearly identify the transport method. Since m_isLocalSocket was already removed, this provides more detail without increasing storage. [ChangeLog][QGrpcHttp2Channel][Important Behavior Changes] Requesting TLS or QLocalSocket now fails with a fatal error if the requested transport is unavailable. Fixes: QTBUG-139597 Pick-to: 6.10 6.9 6.8 Change-Id: I2914d8a5764436d08b4502aa7d8cf6c4fdeb60d0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2ChannelPrivate: remove unused serializerDennis Oberst2025-09-021-1/+0
| | | | | | Pick-to: 6.10 6.9 6.8 Change-Id: I7104266217c867d74470317ea02f5db75b5d00f7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Add security considerations pageJerome Pasion2025-09-013-1/+47
| | | | | | | | | | | -A list of basic security topics when implementing gRPC -Add links to other modules and relevant pages. Task-number: QTBUG-138812 Pick-to: 6.9 6.10 Change-Id: I523f07cb516641771eb1457091f381a2e09b0026 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* QGrpcHttp2Channel: Avoid warning on receiving multiple SETTINGS framesDennis Oberst2025-08-211-5/+1
| | | | | | | | | | | | | | | Remove the warning that incorrectly triggers when a second HTTP/2 SETTINGS frame is received. According to RFC, Section 6.5, a SETTINGS frame "MAY be sent at any other time by either endpoint over the lifetime of the connection." Ref: https://www.rfc-editor.org/rfc/rfc7540#section-6.5 Pick-to: 6.10 6.9 6.8 Change-Id: I83b0238405801a853c20f22629b12f67edce26e2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Http2Handler: let finish() stop the deadlineTimerDennis Oberst2025-08-201-4/+1
| | | | | | | | | It's the single point where a RPC finishes and the correct place to stop the timer. Pick-to: 6.10 6.9 6.8 Change-Id: I2965a938da32a8d78ccfb48f7f5ad37f63ee4363 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2ChannelPrivate: remove unused isLocalSocket()Dennis Oberst2025-08-201-12/+0
| | | | | | | | It's not used anywhere in the code Pick-to: 6.10 6.9 6.8 Change-Id: I388800f73f67f9f37f008590c9f190aa091d9c6b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Move the socket error handling to the common placeAlexey Edelev2025-08-151-29/+14
| | | | | | | | | | | Instead of connecting each and every Http2Handler to the socket error, use QGrpcHttp2ChannelPrivate::handleSocketError to iterate over alive Http2Handler and send errors right from this handler. This saves some memory and time on handling errorOccurred signal. Pick-to: 6.10 6.9 6.8 Change-Id: I907e24425aafe3dccca19100d02fe7adffb1fdaa Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* protobuf: fix deserializeList() warnings and improve clarityDennis Oberst2025-08-151-6/+14
| | | | | | | | | | | Fixes a compiler warning from implicit conversion by introducing a safe qsizetype cast. Also improves readability and efficiency by renaming variables and pre-allocating list storage aswell as adding a missing move. Pick-to: 6.10 6.9 6.8 Change-Id: I5eb34621690893e06e68c7b821e93e3462388595 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Allow enums be non-packedAlexey Edelev2025-08-131-1/+1
| | | | | | | | | | | | Repeated enum fields should not ignore the 'packed' protobuf attribute, so if 'packed' is set to 'false', FieldFlag::NonPacked should land to the message field attributes, indicating to serializer the expected output format. Fixes: QTBUG-138683 Pick-to: 6.8 6.9 6.10 Change-Id: I1c2d2bee32b42f60310307e1f3638ba2b3c236a3 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* QAbstractGrpcChannel: Add missing move when starting the RPCDennis Oberst2025-08-081-3/+3
| | | | | | | Coverity-Id: 479433 Pick-to: 6.10 6.9 6.8 Change-Id: Ieb543fbd6643514e4862d3ad524865196acbacb7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Fix incorrect usage of \generatelistTopi Reinio2025-08-062-2/+2
| | | | | | | | | | | | | | | | | | | | | The \generatelist command takes an optional argument that affect how the members are listed, for example, `classesbymodule` which creates an annotated list of the classes in a named C++ module. `groupsbymodule` is not recognized or documented. QDoc falls back to generating a list of all members of a group in this case. While the end result is correct, this relies on an undocumented feature that is likely to change and break. Replace these instances with an explicit \annotatedlist command that produces the same output. Pick-to: 6.10 Task-number: QTBUG-138901 Change-Id: Iffa5720e53177d1b996d49f9a607e2a1fa91bb0a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix botched linking to QImageKai Köhne2025-08-061-3/+2
| | | | | | Pick-to: 6.5 6.8 6.9 6.10 Change-Id: I50ba5ed2628ecb753e18dd22c457e749168b6b01 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Remove unnecessary QObject:: namespace to improve readabilityDennis Oberst2025-08-051-103/+94
| | | | | | | | | | | | | | Removed redundant 'QObject::' namespace to streamline code and enhance readability, especially in lambda handlers. Due to our formatting, all lambda handlers will be unnecessarily aligned to the very right side. Given that connections and lambda handlers are very common in this codebase this improves the readability of those lambda handlers. Pick-to: 6.10 6.9 6.8 Change-Id: I178a838c7702382b4b3845c729d7c11eeeb1c8d1 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
* QGrpcHttp2Channel: add more debug loggingDennis Oberst2025-08-051-2/+25
| | | | | | | | | Easily allows to have a deeper inspection of the system by adding more debug prints, which can be enabled with the logging category. Pick-to: 6.10 6.9 6.8 Change-Id: I86d7f6c0c53c412a79a3d66f515fa1cd6757a023 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: use logging categories and printf style loggingDennis Oberst2025-08-051-31/+48
| | | | | | | | | | Given the complexity of the http2channel implementation it comes natural to extend its logging clarity. This aligns with best practices in Qt development. Also this makes it easier to debug the system remotely. Pick-to: 6.10 6.9 6.8 Change-Id: Idf00020408b678fc6b17a25db538abd5a838bced Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Http2Handler: improve readability for dataReceived handlerDennis Oberst2025-08-051-21/+22
| | | | | | | | | | | 1. Remove nesting by reversing the state check. 2. Split the messageReceived calculation to be outside of the function call. Given that this is an important calculation it should be easily understandable. Pick-to: 6.10 6.9 6.8 Change-Id: Icfaa29a5dc92eb5b1c86469639a3deb90b5aacd0 Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
* QGrpcHttp2Channel: unify socket error handlerDennis Oberst2025-08-051-24/+20
| | | | | | | | De-duplicate the logic for the error handlers. Pick-to: 6.10 6.9 6.8 Change-Id: I1f8745046ba996ba81eb1bf2f5c3882b6c31059b Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
* Http2Handler: Re-order ctor args and rename m_operationDennis Oberst2025-08-051-25/+24
| | | | | | | | | | | | Re-order the argument to the Http2Handler ctor. The parent should come first. Furthermore rename the m_operation to m_context as I think context is a more fitting name for this important member. This improves the readability and makes it easier to follow the code. Pick-to: 6.10 6.9 6.8 Change-Id: I396e205ec345d80a8cf2cfebe43625f72d39ac6e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpcHttp2Channel: implement filterServerMetadata optionDennis Oberst2025-08-051-2/+17
| | | | | | | | | | | | | | | | | | | Implement the filtering of internal and reserved keys for the server metadata. gRPC over HTTP2 responses are well defined and such information shouldn't be provided to users. At least not by default. Ref: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses This patch changes the filtering to be applied by default. [ChangeLog][QGrpcHttp2Channel/QGrpcOperation][Important Behavior Changes] QGrpcOperation::serverInitialMetadata() and QGrpcOperation::serverTrailingMetadata() no longer include any internal gRPC or HTTP/2 pseudo‑headers by default. Fixes: QTBUG-138363 Change-Id: I4af9e8abe60799e817f47faa5de4c2d0e41854be Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpc{Call,Channel}Options: add 'filterServerMetadata'Dennis Oberst2025-08-056-0/+97
| | | | | | | | | | | | | | | | This option enables to control the filtering of the received server metadata. Both options provide it as optional<bool>, so that QAbstractGrpcChannel implementations should choose a reasonable default. This has not been provided to the QQml*Options, as there is currently no available API to access the server metadata. [ChangeLog][QGrpc{Call,Channel}Options] Added the filterServerMetadata property. Task-number: QTBUG-138363 Change-Id: I325a3b4f6e68d63f0828a6deb1a7be883247614b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QGrpc{Call,Channel}Options: provide noexcept guarantees to metadata()Dennis Oberst2025-08-054-67/+26
| | | | | | | | | | | | | | | | | | | | | Before, we did a lazy initialization in the deprecated noexcept getters to provide a way of not storing the metadata twice. There is just no way to preserve correctness whilst providing this option. Whilst const-ref return values provide the most efficient way to access them, it also most tightly constrains the implementation. Let that be a lesson ... We also remove the free-standing 'operator==' as we're comparing with the matching containers now, there is no need for them (They should also not be provided like this from QtGrpc, even though private). Amends: 778371b8ea4fd34f1ee09e9206c3b42a99be7e1a. Pick-to: 6.10 Change-Id: I05c4a1f7d2eab00f41ebcad54d9a096b2dcdf540 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>