Commit Graph

1589 Commits

Author SHA1 Message Date
Qt Submodule Update Bot d5414487f7 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ia22db6af9adf2affe44e96a02997d1af97f98143
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-20 18:46:57 +00:00
Qt Submodule Update Bot f7d883503c Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ic2ece2f793d8e0c9c1fc13b88f30bc6eafa48a29
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-19 11:33:35 +00:00
Qt Submodule Update Bot d6dd1eecd2 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ifca22fc5ae5d3ade7eb2ab1a193900cc2b6f2ba6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-18 16:27:14 +00:00
Paul Wicking 32d24ea773 Doc: Add missing property docs
Task-number: QTBUG-141872
Change-Id: I2114b0a74f0ac2ca604c1d4b645a610252fc9045
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
2025-11-17 15:51:28 +01:00
Paul Wicking 531e8b74bf Doc: Exclude auto-generated protobuf wrappers from docs
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>
2025-11-17 15:51:25 +01:00
Qt Submodule Update Bot 33d1930dfa Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ib1b7f03db271cfbb9d6c8ad5511192692b68ab04
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-15 00:33:23 +00:00
Qt Submodule Update Bot f4f9413bb8 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I0ec8148b1d9cc4d3f6fec0dea2ffa393473922ab
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-14 02:36:16 +00:00
David Boddie e647dd005f Doc: Fix typo
Change-Id: I5dc970cde692c348b98a3fe68a5c90ffa3bbda6f
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
2025-11-11 16:09:32 +01:00
Joerg Bornemann 363998806d CMake: Don't force CONFIG mode for finding the OpenSSL dependency
When CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE, find_package(OpenSSL)
prefers CONFIG mode and may bypass package manager wrappers that only
work in MODULE mode (e.g., vcpkg's wrapper).

This can lead to finding the wrong OpenSSL installation, such as
single-architecture system installations instead of the intended
universal binaries from the package manager, causing linker errors when
building for multiple architectures.

Fix this by finding OpenSSL before setting
CMAKE_FIND_PACKAGE_PREFER_CONFIG to TRUE. This ensures OpenSSL is found
via MODULE mode where package manager wrappers can properly control the
search. When gRPC's config file is loaded, it skips its own OpenSSL
search, using the already-found targets instead.

For test files, backup and restore the original
CMAKE_FIND_PACKAGE_PREFER_CONFIG value to limit the scope of the change.
For example files, keep the change simple without the backup/restore
pattern.

Change-Id: I985560fd5d57fa8036cc2ccb93c01a55e2efe1bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-11-07 16:00:42 +01:00
Eren Bursali b74e433c76 QT_NO_AS_CONST: rename "QT_NO_AS_CONST" to "QT_NO_QASCONST"
QT_NO_AS_CONST got renamed in qtbase.git in commit
03baf08d2bb9

Task-number: QTBUG-141558
Change-Id: I1fe06d22bddd64945a28447730ffcc5cf0d85952
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-11-07 08:43:55 +01:00
Paul Wicking de19ccc5cb Doc: Add missing property docs
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>
2025-11-06 12:46:42 +01:00
Eren Bursali 6187bef6c7 Doc: Add alt text for \image tags for qtgrpc
Adding alt texts that were needed for QDoc

Pick-to: 6.8
Change-Id: I19b8800fc80d62c6d1996a434fb223cfc2a6e445
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-11-06 10:34:45 +00:00
Qt Submodule Update Bot 61da056a12 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Iba336234c9d8cbcba4a0f2b32d2ecc30545ccfa3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-05 23:26:34 +00:00
Qt Submodule Update Bot ef2e00ee5f Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I12930897d56ed2bc095f372bb8493589c78a7e0a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-11-01 18:10:38 +00:00
Qt Submodule Update Bot da5a83eaf1 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I9e3ab588ecdce645619eec847c25bbab068101ac
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-30 23:06:41 +00:00
Qt Submodule Update Bot c623d00814 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I8c861cc9bf1ca8610be509dfcb30ca459dd06751
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-27 18:43:26 +00:00
Qt Submodule Update Bot fb4f3f6237 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ib3ac0a828143d74153406fb48df7f0136c124688
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-24 02:02:25 +00:00
Lucie Gérard 3d2e0bc58f Adapt to reuse version 6
Task-number: QTBUG-140916
Pick-to: 6.8 6.10
Change-Id: I4f8d24364e92e01c006418d0314fa8c7c9f0de91
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-10-20 09:40:45 +02:00
Qt Submodule Update Bot ca304a1fec Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Id8f3f7c372e57fff676b2e4480383535d6db8899
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-09 11:36:41 +00:00
Qt Submodule Update Bot 752ffff2dd Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I9502e1255dbed9f7951d4bd66bef152f456307e7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-10-03 10:52:06 +00:00
Dennis Oberst efaba18e4a QGrpcHttp2Channel: Implement dataframe decompression
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>
2025-10-02 07:41:39 +02:00
Dennis Oberst dbf2b504c7 QGrpcHttp2Channel: Report data loss for incomplete trailing messages
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>
2025-10-02 07:41:35 +02:00
Dennis Oberst 88b73b67b0 QGrpcHttp2Channel: Replace ExpectedData with GrpcDataParser
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>
2025-10-02 07:41:32 +02:00
Dennis Oberst be670fea5b QGrpcOperation: add serverInitialMetadataReceived signal
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>
2025-10-01 12:07:15 +02:00
Dennis Oberst bc052fbd51 Long Live mockserver!
Our current test strategy relies on having a dedicated server running.
While this tests the most 'accurate' flow of the system, it is really
hard to verify the server behavior due to missing flexibility.

Introduce the mockserver to solve this problem. It wraps the low-level
async gRPC server API and allows for non-blocking processing of
operations. This allows it to run nicely together with the Qt Even Loop,
which is blocking.

Provide the server-handling code by using CallbackTags with Lambdas, or
by subclassing the AbstractRpcTag interface.

Change-Id: I086cbd1d6d8542c717ae036bdf54ba96c55afb58
Fixes: QTBUG-139285
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-10-01 12:07:12 +02:00
Dennis Oberst 60446214bb QGrpc{Call,Channel}Options: provide equality operators
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>
2025-10-01 12:07:03 +02:00
Dennis Oberst 30e9066edf QGrpcOperationPrivate: add missing includes
Pick-to: 6.10 6.9 6.8
Change-Id: I446455abf26abc78ad89d1811114263749c08b4f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-10-01 12:05:46 +02:00
Dennis Oberst 4f1b19c584 QGrpcOperation: add private slots for handling context signals
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>
2025-10-01 12:05:39 +02:00
Qt Submodule Update Bot 94e8326137 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I237308db13dd0c12b51dd7ebb47cbb1217a94ca9
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-30 22:12:50 +00:00
Qt Submodule Update Bot d7ebc075d1 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ia7c234855f42a1194441b82f0cddda80fedcc05c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-29 10:46:28 +00:00
Qt Submodule Update Bot 4ae4d7f45b Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I995704b6ac3a261fde3921291135b9d04009a553
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-26 18:22:26 +00:00
Qt Submodule Update Bot 765cf7e078 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ic5b602729fdc0ab9e336d65177f134e97995cd02
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-20 14:14:34 +00:00
Qt Submodule Update Bot 056c41d018 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I620c58612fceed2da1ebdaf220735da0ea886798
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-18 10:38:09 +00:00
Alexey Edelev 44b3d7ca87 Reapply "Enable the use of VCPKG for qtgrpc"
This reverts commit e09bbcbeba.

Change-Id: Ia7127662c72c27660e7b66a2946e606c887d3433
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-17 11:28:04 +02:00
Dennis Oberst 1ea43abdd3 QGrpcOperation: delete rvalue-this version of metadata getters
These should not be called.

Change-Id: I6889df51affce6d1ed53b7033cb500434c1595ce
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-09-16 12:29:42 +00:00
Alexey Edelev 76f8c2ffb8 Avoid checking the protoc availablity when crosscompiling
Move the protocolCompilerAvailableToRun check under the
SKIP_COMMAND_LINE_TESTS guard.

Pick-to: 6.8 6.9 6.10
Change-Id: Ibd2ce706e7d73d368a89f9f486f3f2fc0f59e7e4
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-09-09 10:51:21 +02:00
Alexey Edelev 6de39ba5eb Guard tst_grpc_client_test_common build
The libraty cannot be built if grpc_testserver is missing.

Pick-to: 6.10 6.9 6.8
Change-Id: I34f6a419e2726ec23ac78f0b95f0974df2080547
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-09-09 10:51:18 +02:00
Kai Köhne b00344793d Doc: Move QtGrpc Chat example to Networking category
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>
2025-09-09 07:10:59 +00:00
Dennis Oberst 6f589e1d5c docs: Add common http2-metadata description and distribute it
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>
2025-09-05 17:01:12 +02:00
Dennis Oberst 56999b3605 QGrpcOperation: move Private into separate file
For private access.

Pick-to: 6.10 6.9 6.8
Change-Id: I9d8436c9f283cfe1c2ecb6ba98481ee94d2f5b3e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-09-05 17:01:12 +02:00
Dennis Oberst b86f9cb5d9 QGrpcHttp2Channel: fix illegal access when printing
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>
2025-09-05 17:01:12 +02:00
Qt Submodule Update Bot e95d0041f1 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: I5014b038e7165a62856303b8be5ceb0214f91a27
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-05 13:31:29 +00:00
Dennis Oberst bfa2607a72 GrpcToolsMacros.cmake: continue on invalid files
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>
2025-09-02 15:26:58 +02:00
Dennis Oberst 49c5c7d82c Http2Handler: Modify and add debug logs
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>
2025-09-02 15:26:55 +02:00
Dennis Oberst 15cef4fd14 QGrpcHttp2Channel: Guarantee transportation scheme
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>
2025-09-02 15:26:52 +02:00
Dennis Oberst 3afc1866d2 QGrpcHttp2ChannelPrivate: remove unused serializer
Pick-to: 6.10 6.9 6.8
Change-Id: I7104266217c867d74470317ea02f5db75b5d00f7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-09-02 15:26:49 +02:00
Qt Submodule Update Bot 463205cdf2 Update dependencies on 'dev' in qt/qtgrpc
Change-Id: Ic07e6fed756de50cd37f45d098328f585fe4bcb4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2025-09-01 20:59:19 +00:00
Jerome Pasion c6cd23770d Doc: Add security considerations page
-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>
2025-09-01 17:42:54 +02:00
Jaishree Vyas 49c0107975 Doc: Review QtGRPC chat example
As part of reviewing the application examples and following a structure, this
change covers:
-Language changes
-Follows the strucutre
-Includes \sa link to All Qt Examples

Fixes: QTBUG-137964
Pick-to: 6.10 6.9 6.8
Change-Id: Ic14d7042e6db277c1584b69ba46f7748f53642ab
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2025-09-01 08:45:54 +00:00
Dennis Oberst b2d9291983 QGrpcHttp2Channel: Avoid warning on receiving multiple SETTINGS frames
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>
2025-08-21 13:51:43 +02:00