Merge branch 'codex/myteamspeak-account': myTeamSpeak account sign-in

Conflicts with the channel banners on main, both kept:
- crates/proto/UPSTREAM.md: myTeamSpeak's local patch is number 14, after
  the channel banners' 13.
- voelin-core/src/voice.rs: both test modules.
- ui/app.slint: the mobile shell hides behind the account prompt and keeps
  the channel chat's banner.
- ui/shells/common.slint: the user card counts a signed-in account as named
  and shows our avatar, the person icon only without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEpqsPES27Eacue91u3d2Q
This commit is contained in:
Claude committed 2026-10-04 17:55:31 +00:00
commit 64fa161cd6
185 files changed
+52751 -217

No files matched your search

Generated
+234
View File
@@ -3502,6 +3502,19 @@ dependencies = [
"tower-service",
]
[[package]]
name = "hyper-timeout"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
dependencies = [
"hyper",
"hyper-util",
"pin-project-lite",
"tokio",
"tower-service",
]
[[package]]
name = "hyper-util"
version = "0.1.21"
@@ -4864,6 +4877,12 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "multimap"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
[[package]]
name = "multiversion_no_op"
version = "1.0.0"
@@ -5842,6 +5861,7 @@ checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629"
dependencies = [
"digest 0.11.3",
"hmac 0.13.0",
"sha2 0.11.0",
]
[[package]]
@@ -6320,6 +6340,27 @@ dependencies = [
"prost-derive",
]
[[package]]
name = "prost-build"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042"
dependencies = [
"heck",
"itertools 0.14.0",
"log",
"multimap",
"petgraph",
"prettyplease",
"prost",
"prost-types",
"pulldown-cmark",
"pulldown-cmark-to-cmark",
"regex",
"syn 2.0.119",
"tempfile",
]
[[package]]
name = "prost-derive"
version = "0.14.4"
@@ -6333,6 +6374,79 @@ dependencies = [
"syn 2.0.119",
]
[[package]]
name = "prost-types"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a"
dependencies = [
"prost",
]
[[package]]
name = "protoc-bin-vendored"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1c381df33c98266b5f08186583660090a4ffa0889e76c7e9a5e175f645a67fa"
dependencies = [
"protoc-bin-vendored-linux-aarch_64",
"protoc-bin-vendored-linux-ppcle_64",
"protoc-bin-vendored-linux-s390_64",
"protoc-bin-vendored-linux-x86_32",
"protoc-bin-vendored-linux-x86_64",
"protoc-bin-vendored-macos-aarch_64",
"protoc-bin-vendored-macos-x86_64",
"protoc-bin-vendored-win32",
]
[[package]]
name = "protoc-bin-vendored-linux-aarch_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c350df4d49b5b9e3ca79f7e646fde2377b199e13cfa87320308397e1f37e1a4c"
[[package]]
name = "protoc-bin-vendored-linux-ppcle_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a55a63e6c7244f19b5c6393f025017eb5d793fd5467823a099740a7a4222440c"
[[package]]
name = "protoc-bin-vendored-linux-s390_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dba5565db4288e935d5330a07c264a4ee8e4a5b4a4e6f4e83fad824cc32f3b0"
[[package]]
name = "protoc-bin-vendored-linux-x86_32"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8854774b24ee28b7868cd71dccaae8e02a2365e67a4a87a6cd11ee6cdbdf9cf5"
[[package]]
name = "protoc-bin-vendored-linux-x86_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b38b07546580df720fa464ce124c4b03630a6fb83e05c336fea2a241df7e5d78"
[[package]]
name = "protoc-bin-vendored-macos-aarch_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89278a9926ce312e51f1d999fee8825d324d603213344a9a706daa009f1d8092"
[[package]]
name = "protoc-bin-vendored-macos-x86_64"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81745feda7ccfb9471d7a4de888f0652e806d5795b61480605d4943176299756"
[[package]]
name = "protoc-bin-vendored-win32"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95067976aca6421a523e491fce939a3e65249bac4b977adee0ee9771568e8aa3"
[[package]]
name = "pulldown-cmark"
version = "0.13.4"
@@ -6344,6 +6458,15 @@ dependencies = [
"unicase",
]
[[package]]
name = "pulldown-cmark-to-cmark"
version = "22.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84bbb29c624230c4bd1047bbdb2aa47e41c860e9665ce62ba9504eebe91bf867"
dependencies = [
"pulldown-cmark",
]
[[package]]
name = "pxfm"
version = "0.1.30"
@@ -7139,7 +7262,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634"
dependencies = [
"aws-lc-rs",
"log",
"once_cell",
"ring",
"rustls-pki-types",
"rustls-webpki",
"subtle",
@@ -7256,6 +7381,20 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "schema-api"
version = "0.1.0"
dependencies = [
"prost",
"prost-build",
"prost-types",
"protoc-bin-vendored",
"thiserror 2.0.21",
"tonic",
"tonic-prost",
"tonic-prost-build",
]
[[package]]
name = "scoped-tls"
version = "1.0.1"
@@ -8715,6 +8854,76 @@ version = "1.1.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
[[package]]
name = "tonic"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef"
dependencies = [
"async-trait",
"axum",
"base64 0.22.1",
"bytes",
"h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"rustls-native-certs",
"socket2",
"sync_wrapper",
"tokio",
"tokio-rustls",
"tokio-stream",
"tower",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tonic-build"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c68f61875ac5293cf72e6c8cf0158086428c82c37229e98c840878f1706b0322"
dependencies = [
"prettyplease",
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "tonic-prost"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0"
dependencies = [
"bytes",
"prost",
"tonic",
]
[[package]]
name = "tonic-prost-build"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "654e5643eff75d7f8c99197ce1440ed19a3474eada74c12bbac488b2cafdae27"
dependencies = [
"prettyplease",
"proc-macro2",
"prost-build",
"prost-types",
"quote",
"syn 2.0.119",
"tempfile",
"tonic-build",
]
[[package]]
name = "tower"
version = "0.5.3"
@@ -8723,9 +8932,12 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4"
dependencies = [
"futures-core",
"futures-util",
"indexmap",
"pin-project-lite",
"slab",
"sync_wrapper",
"tokio",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
@@ -9099,6 +9311,7 @@ dependencies = [
"rand 0.10.3",
"rug",
"serde",
"serde_json",
"sha-1",
"sha2 0.10.9",
"thiserror 2.0.21",
@@ -9108,6 +9321,7 @@ dependencies = [
"tracing-subscriber",
"tsproto-packets",
"tsproto-types",
"zeroize",
]
[[package]]
@@ -9500,6 +9714,7 @@ dependencies = [
"voelin-gateway-proto",
"voelin-media",
"voelin-model",
"voelin-myts",
"voelin-observer",
"voelin-platform",
"voelin-query",
@@ -9603,6 +9818,24 @@ dependencies = [
"serde_json",
]
[[package]]
name = "voelin-myts"
version = "0.1.0"
dependencies = [
"aes 0.9.3",
"aes-gcm",
"base64 0.22.1",
"ctr 0.10.1",
"pbkdf2",
"reqwest",
"schema-api",
"subtle",
"thiserror 2.0.21",
"tokio",
"tsproto",
"zeroize",
]
[[package]]
name = "voelin-observer"
version = "0.1.0"
@@ -9698,6 +9931,7 @@ dependencies = [
"voelin-core",
"voelin-gateway-proto",
"voelin-model",
"voelin-myts",
"voelin-platform",
"voelin-query",
"voelin-store",
+3 -1
View File
@@ -2,7 +2,7 @@
resolver = "3"
# third_party: vendored crates patched in below (not workspace members, so
# their own tests and dev-dependencies stay out of our builds).
exclude = ["fuzz", "third_party"]
exclude = ["fuzz", "third_party", "third_party/schema-api"]
members = [
"crates/proto/tsproto-types",
"crates/proto/tsproto-structs",
@@ -17,6 +17,7 @@ members = [
"crates/voelin-gateway-proto",
"crates/voelin-media",
"crates/voelin-model",
"crates/voelin-myts",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
@@ -37,6 +38,7 @@ default-members = [
"crates/voelin-gateway",
"crates/voelin-gateway-proto",
"crates/voelin-model",
"crates/voelin-myts",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
+836 -9
View File
@@ -53,6 +53,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
## schema-api
The account client uses message bindings and session helpers from the local
schema-api 0.1.0 snapshot vendored under third_party/schema-api. The supplied
snapshot has no declared license or license file; no MIT or Apache license is
implied for it or its supplied schemas. See its VOELIN-PATCH.md for provenance.
## Native libraries
- Opus (libopus), compiled into the app: BSD-3-Clause, Copyright 2001-2023
@@ -175,12 +182,12 @@ the crate's authors are listed as its copyright holders.
| License | Crates |
|---|---|
| MIT License | 654 |
| Apache License 2.0 | 31 |
| MIT License | 657 |
| Apache License 2.0 | 34 |
| Unicode License v3 | 26 |
| ISC License | 24 |
| BSD 3-Clause "New" or "Revised" License | 22 |
| LicenseRef-Slint-Royalty-free-2.0 | 12 |
| ISC License | 8 |
| BSD 2-Clause "Simplified" License | 3 |
| zlib License | 3 |
| Boost Software License 1.0 | 2 |
@@ -398,6 +405,284 @@ Used by: flagset 0.4.7, hound 3.5.1
````
Used by: ring 0.17.14
````text
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Licenses for support code
-------------------------
Parts of the TLS test suite are under the Go license. This code is not included
in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so
distributing code linked against BoringSSL does not trigger this license:
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
BoringSSL uses the Chromium test infrastructure to run a continuous build,
trybots etc. The scripts which manage this, and the script for generating build
metadata, are under the Chromium license. Distributing code linked against
BoringSSL does not trigger this license.
Copyright 2015 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
````
Used by: moka 0.12.16
````text
@@ -1019,7 +1304,7 @@ Used by: cpal 0.18.2, imgref 1.12.3, self_cell 1.3.0, unicode-linebreak 0.1.5
````
Used by: gethostname 1.1.0, prost-derive 0.14.4, prost 0.14.4
Used by: gethostname 1.1.0, prost-derive 0.14.4, prost-types 0.14.4, prost 0.14.4, ring 0.17.14
````text
Apache License
@@ -1796,7 +2081,7 @@ Standard text, used by:
- openh264 0.9.8: Ralf Biedert <rb@xr.io> (https://github.com/ralfbiedert/openh264-rs)
````text
Copyright (c) <year> <owner>
Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -2009,7 +2294,7 @@ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
````
@@ -2078,7 +2363,7 @@ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
````
@@ -2090,7 +2375,7 @@ Standard text, used by:
- sonora-aec3 0.2.0 (https://github.com/dignifiedquire/sonora)
````text
Copyright (c) <year> <owner>.
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -2233,6 +2518,84 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
### ISC License
Used by: ring 0.17.14
````text
/* Copyright (c) 2014, Intel Corporation.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef OPENSSL_HEADER_EC_ECP_NISTZ384_H
#define OPENSSL_HEADER_EC_ECP_NISTZ384_H
#include "../../limbs/limbs.h"
#define P384_LIMBS (384u / LIMB_BITS)
typedef struct {
Limb X[P384_LIMBS];
Limb Y[P384_LIMBS];
Limb Z[P384_LIMBS];
} P384_POINT;
typedef struct {
Limb X[P384_LIMBS];
Limb Y[P384_LIMBS];
} P384_POINT_AFFINE;
#endif // OPENSSL_HEADER_EC_ECP_NISTZ384_H
````
Used by: ring 0.17.14
````text
// Copyright 2015-2016 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//! EdDSA Signatures.
use super::ops::ELEM_LEN;
use crate::digest;
pub mod signing;
pub mod verification;
/// The length of an Ed25519 public key.
pub const ED25519_PUBLIC_KEY_LEN: usize = ELEM_LEN;
pub fn eddsa_digest(signature_r: &[u8], public_key: &[u8], msg: &[u8]) -> digest::Digest {
let mut ctx = digest::Context::new(&digest::SHA512);
ctx.update(signature_r);
ctx.update(public_key);
ctx.update(msg);
ctx.finish()
}
````
Used by: untrusted 0.7.1, untrusted 0.9.0
````text
@@ -2252,6 +2615,397 @@ Used by: untrusted 0.7.1, untrusted 0.9.0
````
Used by: ring 0.17.14
````text
// Copyright 2015-2022 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use crate::limb::Limb;
#[derive(Clone, Copy)]
#[repr(transparent)]
pub struct N0([Limb; 2]);
impl N0 {
#[cfg(feature = "alloc")]
pub(super) const LIMBS_USED: usize = 64 / crate::limb::LIMB_BITS;
#[inline]
pub const fn precalculated(n0: u64) -> Self {
#[cfg(target_pointer_width = "64")]
{
Self([n0, 0])
}
#[cfg(target_pointer_width = "32")]
{
Self([n0 as Limb, (n0 >> crate::limb::LIMB_BITS) as Limb])
}
}
}
````
Used by: ring 0.17.14
````text
// Copyright 2015-2025 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use crate::{bb, error};
#[deprecated(
note = "To be removed. Internal function not intended for external use with no promises regarding side channels."
)]
pub fn verify_slices_are_equal(a: &[u8], b: &[u8]) -> Result<(), error::Unspecified> {
bb::verify_slices_are_equal(a, b)
}
````
Used by: ring 0.17.14
````text
// Copyright 2016 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//! Elliptic curve operations and schemes using Curve25519.
pub mod ed25519;
pub mod x25519;
mod ops;
mod scalar;
````
Used by: ring 0.17.14
````text
// Copyright 2016-2024 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use crate::error::{KeyRejected, Unspecified};
impl From<untrusted::EndOfInput> for Unspecified {
fn from(source: untrusted::EndOfInput) -> Self {
super::erase(source)
}
}
impl From<core::array::TryFromSliceError> for Unspecified {
fn from(source: core::array::TryFromSliceError) -> Self {
super::erase(source)
}
}
impl From<KeyRejected> for Unspecified {
fn from(source: KeyRejected) -> Self {
super::erase(source)
}
}
````
Used by: ring 0.17.14
````text
// Copyright 2018 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//! Serialization and deserialization.
#[doc(hidden)]
pub mod der;
#[cfg(feature = "alloc")]
mod writer;
#[cfg(feature = "alloc")]
pub(crate) mod der_writer;
pub(crate) mod positive;
pub use self::positive::Positive;
#[cfg(feature = "alloc")]
pub(crate) use self::writer::TooLongError;
````
Used by: ring 0.17.14
````text
// Copyright 2019-2024 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use super::BlockLen;
pub(super) use self::{
sha2_32::{block_data_order_32, State32, SHA256_BLOCK_LEN},
sha2_64::{block_data_order_64, State64, SHA512_BLOCK_LEN},
};
pub(super) const CHAINING_WORDS: usize = 8;
#[cfg(any(
all(target_arch = "aarch64", target_endian = "little"),
all(target_arch = "arm", target_endian = "little"),
target_arch = "x86_64"
))]
#[macro_use]
mod ffi;
pub(super) mod fallback;
mod sha2_32;
mod sha2_64;
````
Used by: ring 0.17.14
````text
// Copyright 2024 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
// TODO(MSRV 1.76): Replace with `core::ptr::from_mut`.
#[allow(dead_code)]
#[inline(always)]
pub fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
r
}
// TODO(MSRV 1.76): Replace with `core::ptr::from_ref`.
#[allow(dead_code)]
#[inline(always)]
pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
r
}
````
Used by: ring 0.17.14
````text
// Copyright 2024 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//! Integration tests for non-public APIs.
mod bits_tests;
````
Used by: ring 0.17.14
````text
// Copyright 2024 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
pub use self::{
array::Array,
base::{IndexError, Overlapping},
partial_block::PartialBlock,
};
mod array;
mod base;
mod partial_block;
````
Used by: ring 0.17.14
````text
// Copyright 2025 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![cfg(all(target_arch = "aarch64", target_endian = "little"))]
pub(in super::super) mod mont;
````
Used by: ring 0.17.14
````text
// Copyright 2025 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![cfg(target_arch = "x86_64")]
pub(in super::super::super) mod mont;
````
Used by: ring 0.17.14
````text
// Copyright 2025 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
mod storage;
pub(super) use self::storage::{AlignedStorage, LIMBS_PER_CHUNK};
````
Used by: ring 0.17.14
````text
// Copyright 2025 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
pub(super) mod aarch64;
pub(super) mod x86_64;
````
Used by: aws-lc-sys 0.45.0
````text
@@ -2593,6 +3347,25 @@ THIS SOFTWARE.
````
Used by: ring 0.17.14
````text
Copyright 2015-2025 Brian Smith.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
````
Used by: libloading 0.8.9
````text
@@ -7899,6 +8672,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
Used by: tonic 0.14.6
````text
Copyright (c) 2025 Lucio Franco
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
````
Used by: secret-service 5.2.0
````text
@@ -9760,6 +10558,7 @@ Standard text, used by:
- str0m-proto 0.7.0: Martin Algesten <martin@algesten.se> (https://github.com/algesten/str0m)
- taffy 0.10.1: Alice Cecile <alice.i.cecile@gmail.com>, Johnathan Kelley <jkelleyrtp@gmail.com>, Nico Burns <nico@nicoburns.com> (https://github.com/DioxusLabs/taffy)
- tauri-winrt-notification 0.7.3: allenbenz, Tauri Programme within The Commons Conservancy (https://github.com/tauri-apps/winrt-notification)
- tonic-prost 0.14.6: Lucio Franco <luciofranco14@gmail.com> (https://github.com/hyperium/tonic)
- tract-extra 0.23.8: Mathieu Poumeyrol <kali@zoy.org> (https://github.com/sonos/tract)
- tract-transformers 0.23.8: Mathieu Poumeyrol <kali@zoy.org>, Louis Chouraki <louis.chouraki@sonos.com> (https://github.com/sonos/tract)
- windows-collections 0.2.0 (https://github.com/microsoft/windows-rs)
@@ -10725,6 +11524,34 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
Used by: hyper-timeout 0.5.2
````text
The MIT License (MIT)
Copyright (c) 2016 The weldr Project Developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
Used by: same-file 1.0.6, winapi-util 0.1.11
@@ -11327,7 +12154,7 @@ Mozilla Public License Version 2.0
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
+7
View File
@@ -53,6 +53,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
````
## schema-api
The account client uses message bindings and session helpers from the local
schema-api 0.1.0 snapshot vendored under third_party/schema-api. The supplied
snapshot has no declared license or license file; no MIT or Apache license is
implied for it or its supplied schemas. See its VOELIN-PATCH.md for provenance.
## Native libraries
- Opus (libopus), compiled into the app: BSD-3-Clause, Copyright 2001-2023
+12
View File
@@ -117,3 +117,15 @@ against or offered back to upstream.
cannot drop the whole channel list; its numbers are those of
`HostBannerMode` (the server's `channeledit` documentation: 0 as it is,
1 stretched, 2 scaled keeping the aspect ratio).
14. **myTeamSpeak connection identity** (`tsproto/src/myts.rs`,
`tsclientlib/src/myts.rs`, `tsclientlib/src/lib.rs`). Validated, redacted account
credentials retain the original raw signing scalar and validate again when
deserialized from a credential store. Connection-bound account proofs use the
negotiated shared IV and the official raw-scalar signing construction, not
Ed25519 seed expansion. `clientinit` and `updatemytsid` carry the six official
case-sensitive proof fields; clearing an account sends only an empty
`myTeamspeakId`. Connection options retain the latest account for reconnects;
callers cancel and rebuild an in-flight attempt when its snapshot changes.
Tests cover an independent signature vector, persistence validation/redaction,
wire field names, clearing and reconnect snapshot replacement. The account
UUID and the ordinary server identity remain separate.
+21 -2
View File
@@ -44,6 +44,7 @@ use tsproto_packets::packets::{InCommandBuf, OutCommand, OutPacket, PacketType};
#[cfg(feature = "audio")]
pub mod audio;
mod myts;
pub mod prelude;
pub mod resolver;
pub mod sync;
@@ -382,9 +383,11 @@ impl Connection {
address: address.into(),
local_address: None,
identity: None,
myts_identity: None,
server: None,
name: "TeamSpeakUser".into(),
version: Version::Windows_3_X_X__1,
metadata: Cow::Borrowed(""),
hardware_id: "923f136fb1e22ae6ce95e60255529c00,d13231b1bc33edfecfb9169cc7a63bcc".into(),
channel: None,
channel_password: None,
@@ -536,7 +539,7 @@ impl Connection {
.as_ref()
.map(|p| tsproto_types::crypto::encode_password(p.as_bytes()))
.unwrap_or_default();
let packet = c2s::OutClientInitMessage::new(&mut iter::once(c2s::OutClientInitPart {
let mut packet = c2s::OutClientInitMessage::new(&mut iter::once(c2s::OutClientInitPart {
name: Cow::Borrowed(options.name.as_ref()),
version: Cow::Borrowed(client_version),
platform: Cow::Borrowed(client_platform),
@@ -549,7 +552,7 @@ impl Connection {
default_channel: Cow::Borrowed(options.channel.as_deref().unwrap_or_default()),
default_channel_password: Cow::Borrowed(default_channel_password.as_ref()),
password: Cow::Borrowed(password.as_ref()),
metadata: "".into(),
metadata: Cow::Borrowed(options.metadata.as_ref()),
version_sign: Cow::Borrowed(client_version_sign.as_ref()),
client_key_offset: counter,
phonetic_name: "".into(),
@@ -564,6 +567,13 @@ impl Connection {
security_hash: None,
}));
// Voelin patch: account proof is bound to this transport's negotiated IV.
// The generated legacy client_myteamspeak_id field stays absent.
if let Some(identity) = &options.myts_identity {
let params = client.params.as_ref().ok_or(Error::InitserverParamsMissing)?;
identity.proof(&params.shared_iv).write_to(&mut packet);
}
client.send_packet(packet.into_packet()).map_err(Error::SendClientinit)?;
match tokio::time::timeout(
@@ -1711,9 +1721,11 @@ pub struct ConnectOptions {
address: ServerAddress,
local_address: Option<SocketAddr>,
identity: Option<Identity>,
myts_identity: Option<tsproto::myts::Identity>,
server: Option<UidBuf>,
name: Cow<'static, str>,
version: Version,
metadata: Cow<'static, str>,
hardware_id: Cow<'static, str>,
channel: Option<Cow<'static, str>>,
channel_password: Option<Cow<'static, str>>,
@@ -1853,6 +1865,13 @@ impl ConnectOptions {
self
}
/// Application metadata, independently of the signed compatibility version.
/// Voelin patch: carries the actual application name/build to the server.
pub fn metadata<S: Into<Cow<'static, str>>>(mut self, metadata: S) -> Self {
self.metadata = metadata.into();
self
}
/// The hardware ID (HWID) of the client.
///
/// # Default
+91
View File
@@ -0,0 +1,91 @@
//! Voelin patch: connection-bound myTeamSpeak proof and live account changes.
use tsproto::myts::Identity;
use tsproto_packets::packets::{Direction, Flags, OutCommand, PacketType};
use crate::{ConnectOptions, Connection, ConnectionState, Error, MessageHandle, Result};
impl ConnectOptions {
/// Snapshot the account credential for the initial connection and reconnects.
/// This is separate from the server identity and account profile UUID.
pub fn myts_identity(mut self, identity: Option<Identity>) -> Self {
self.myts_identity = identity;
self
}
}
impl Connection {
/// Publish a connection-bound account proof, or clear the account identity.
///
/// Always updates the reconnect options, even if currently disconnected or
/// sending fails. A running connection attempt owns its previous snapshot:
/// callers must cancel and rebuild that attempt after `NotConnected`.
/// Await the returned handle's `StreamItem::MessageResult` for server acceptance.
pub fn update_myts_identity(&mut self, identity: Option<Identity>) -> Result<MessageHandle> {
self.options.myts_identity = identity;
let iv = match &self.state {
ConnectionState::Connected { con, .. } => {
con.client.params.as_ref().ok_or(Error::InitserverParamsMissing)?.shared_iv
}
_ => return Err(Error::NotConnected),
};
let packet = update_packet(self.options.myts_identity.as_ref(), &iv);
self.send_command_with_result(packet)
}
}
fn update_packet(identity: Option<&Identity>, iv: &[u8; 64]) -> OutCommand {
let mut packet =
OutCommand::new(Direction::C2S, Flags::empty(), PacketType::Command, "updatemytsid");
if let Some(identity) = identity {
identity.proof(iv).write_to(&mut packet);
} else {
// Empty arguments are serialized without '=' by the existing writer.
packet.write_arg("myTeamspeakId", &"");
}
packet
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn clear_contains_no_previous_account_proof() {
let packet = update_packet(None, &[0; 64]).into_packet();
assert_eq!(packet.content(), b"updatemytsid myTeamspeakId");
}
#[test]
fn update_uses_current_connection_challenge() {
// Scalar one and the standard compressed Edwards base point.
let mut private = [0; 32];
private[0] = 1;
let mut public = [0x66; 32];
public[0] = 0x58;
let identity = Identity::new(vec![1; 33], 42, public, private, vec![2; 65]).unwrap();
let first = update_packet(Some(&identity), &[0; 64]).into_packet();
let second = update_packet(Some(&identity), &[1; 64]).into_packet();
assert_ne!(first.content(), second.content());
let wire = std::str::from_utf8(first.content()).unwrap();
assert!(wire.starts_with("updatemytsid myTeamspeakId="));
assert!(wire.contains(" acTime=42 "));
assert!(!wire.contains("client_myteamspeak_id"));
assert_eq!(wire.split(' ').count(), 7);
}
#[test]
fn failed_update_still_replaces_reconnect_snapshot() {
// Building opens no socket until the connection future is polled.
let mut private = [0; 32];
private[0] = 1;
let mut public = [0x66; 32];
public[0] = 0x58;
let identity = Identity::new(vec![1; 33], 42, public, private, vec![2; 65]).unwrap();
let mut connection =
Connection::build("localhost").myts_identity(Some(identity)).connect().unwrap();
assert!(connection.options.myts_identity.is_some());
assert!(matches!(connection.update_myts_identity(None), Err(Error::NotConnected)));
assert!(connection.options.myts_identity.is_none());
}
}
+2
View File
@@ -43,8 +43,10 @@ tsproto-packets = { path = "../tsproto-packets", version = "0.1" }
tsproto-types = { path = "../tsproto-types", version = "0.1" }
quicklz = "0.3"
crypto-bigint = "0.6"
zeroize = "1"
[dev-dependencies]
serde_json = "1"
anyhow = "1"
criterion = "0.8"
once_cell = "1"
+1
View File
@@ -26,6 +26,7 @@ pub mod client;
pub mod connection;
pub mod license;
pub mod log;
pub mod myts;
pub mod packet_codec;
pub mod resend;
pub mod utils;
+247
View File
@@ -0,0 +1,247 @@
//! Validated myTeamSpeak signing credentials and connection-bound public proofs.
//!
//! Serializing an [`Identity`] exports its private key. Persist it only in a
//! credential store, never application settings, diagnostics or packet logs.
use std::fmt;
use base64::prelude::*;
use curve25519_dalek::{constants::ED25519_BASEPOINT_TABLE, scalar::Scalar};
use serde::{Deserialize, Deserializer, Serialize};
use sha2::{Digest, Sha256, Sha512};
use thiserror::Error;
use tsproto_packets::packets::OutCommand;
use zeroize::Zeroize;
/// An account identity; distinct from the account UUID and server identity.
#[derive(Clone, Serialize)]
pub struct Identity {
myts_id: Vec<u8>,
creation_time: u64,
public_key: [u8; 32],
private_key: [u8; 32],
public_signature: Vec<u8>,
}
#[derive(Debug, Error)]
pub enum IdentityError {
#[error("myTeamSpeak identity must contain 33 bytes")]
InvalidId,
#[error("myTeamSpeak public signature must contain 65 to 4096 bytes")]
InvalidSignature,
#[error("myTeamSpeak private key is zero or does not match its public key")]
InvalidKeyPair,
}
impl fmt::Debug for Identity {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("Identity([REDACTED])") }
}
impl Drop for Identity {
fn drop(&mut self) { self.private_key.zeroize(); }
}
impl<'de> Deserialize<'de> for Identity {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct Stored {
myts_id: Vec<u8>,
creation_time: u64,
public_key: [u8; 32],
private_key: [u8; 32],
public_signature: Vec<u8>,
}
let mut stored = Stored::deserialize(deserializer)?;
let result = Self::new(
stored.myts_id,
stored.creation_time,
stored.public_key,
stored.private_key,
stored.public_signature,
);
stored.private_key.zeroize();
result.map_err(serde::de::Error::custom)
}
}
impl Identity {
/// `creation_time` is the voice protocol's decimal `acTime` integer,
/// byte-swapped from the account service's numeric creation timestamp.
pub fn new(
myts_id: Vec<u8>, creation_time: u64, public_key: [u8; 32], mut private_key: [u8; 32],
public_signature: Vec<u8>,
) -> Result<Self, IdentityError> {
let result = (|| {
if myts_id.len() != 33 {
return Err(IdentityError::InvalidId);
}
if !(65..=4096).contains(&public_signature.len()) {
return Err(IdentityError::InvalidSignature);
}
let mut scalar = Scalar::from_bytes_mod_order(private_key);
let valid = scalar != Scalar::ZERO
&& (ED25519_BASEPOINT_TABLE * &scalar).compress().to_bytes() == public_key;
scalar.zeroize();
if !valid {
return Err(IdentityError::InvalidKeyPair);
}
Ok(Self { myts_id, creation_time, public_key, private_key, public_signature })
})();
private_key.zeroize();
result
}
pub fn id(&self) -> String { BASE64_STANDARD.encode(&self.myts_id) }
/// Sign this connection's challenge with the original raw private scalar.
/// This is not Ed25519's seed expansion: the account already stores a scalar.
pub fn proof(&self, shared_iv: &[u8; 64]) -> Proof {
let mut challenge = Sha256::new();
challenge.update([0x30, 0x08, 0, 0, 0, 0]);
challenge.update(shared_iv);
let mut message = challenge.finalize().to_vec();
message.extend_from_slice(b"MyTeamSpeakID");
let mut nonce_hash = Sha512::new();
nonce_hash.update(self.private_key);
nonce_hash.update(&message);
let mut nonce = Scalar::from_bytes_mod_order_wide(&nonce_hash.finalize().into());
let public_nonce = (ED25519_BASEPOINT_TABLE * &nonce).compress().to_bytes();
let mut hash = Sha512::new();
hash.update(public_nonce);
hash.update(self.public_key);
hash.update(&message);
let challenge = Scalar::from_bytes_mod_order_wide(&hash.finalize().into());
let mut scalar = Scalar::from_bytes_mod_order(self.private_key);
let mut response = challenge * scalar + nonce;
let mut signature = [0; 64];
signature[..32].copy_from_slice(&public_nonce);
signature[32..].copy_from_slice(response.as_bytes());
scalar.zeroize();
nonce.zeroize();
response.zeroize();
Proof {
myteamspeak_id: self.id(),
creation_time: self.creation_time,
public_key: BASE64_STANDARD.encode(self.public_key),
auth_signature: BASE64_STANDARD.encode(signature),
public_signature: BASE64_STANDARD.encode(&self.public_signature[..64]),
public_signature_certificate: BASE64_STANDARD.encode(&self.public_signature[64..]),
}
}
}
/// Public, connection-bound authentication values. Never contains private keys.
#[derive(Clone)]
pub struct Proof {
pub myteamspeak_id: String,
pub creation_time: u64,
pub public_key: String,
pub auth_signature: String,
pub public_signature: String,
pub public_signature_certificate: String,
}
impl fmt::Debug for Proof {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str("Proof([REDACTED])") }
}
impl Proof {
/// Append the official case-sensitive wire fields to an outgoing command.
pub fn write_to(&self, packet: &mut OutCommand) {
packet.write_arg("myTeamspeakId", &self.myteamspeak_id);
packet.write_arg("acTime", &self.creation_time);
packet.write_arg("userPubKey", &self.public_key);
packet.write_arg("authSign", &self.auth_signature);
packet.write_arg("pubSign", &self.public_signature);
packet.write_arg("pubSignCert", &self.public_signature_certificate);
}
}
#[cfg(test)]
mod tests {
use super::*;
use tsproto_packets::packets::{Direction, Flags, PacketType};
fn hex<const N: usize>(value: &str) -> [u8; N] {
let mut bytes = [0; N];
for (i, byte) in bytes.iter_mut().enumerate() {
*byte = u8::from_str_radix(&value[i * 2..i * 2 + 2], 16).unwrap();
}
bytes
}
fn identity() -> Identity {
Identity::new(
vec![7; 33],
123456,
hex("ce92350b547b6cf028df0618bf9aba55f949930059308d83ebd727e13472ed99"),
std::array::from_fn(|i| i as u8 + 1),
vec![9; 65],
)
.unwrap()
}
#[test]
fn raw_scalar_signature_matches_independent_vector() {
// Python integer Edwards arithmetic + hashlib, independent of dalek.
let proof = identity().proof(&std::array::from_fn(|i| i as u8));
let expected = hex::<64>(
"d56e1808e1ded53e20fc2849f016603c88eefe0494d75e9b869653e2bacaa495c562b571289d88a561c0f4b568cf90cc515b557b6d4321962e94ccf85f105a08",
);
assert_eq!(BASE64_STANDARD.decode(proof.auth_signature).unwrap(), expected);
assert_ne!(
identity().proof(&[0; 64]).auth_signature,
identity().proof(&[1; 64]).auth_signature
);
}
#[test]
fn credentials_roundtrip_validate_and_redact() {
let identity = identity();
let stored = serde_json::to_value(&identity).unwrap();
let restored: Identity = serde_json::from_value(stored.clone()).unwrap();
assert_eq!(serde_json::to_value(&restored).unwrap(), stored);
assert_eq!(
identity.proof(&[0; 64]).auth_signature,
restored.proof(&[0; 64]).auth_signature
);
assert_eq!(format!("{:?}", restored), "Identity([REDACTED])");
assert_eq!(format!("{:?}", restored.proof(&[0; 64])), "Proof([REDACTED])");
for field in ["myts_id", "public_signature", "public_key", "private_key"] {
let mut invalid = stored.clone();
invalid[field] = serde_json::json!([]);
assert!(serde_json::from_value::<Identity>(invalid).is_err(), "{}", field);
}
for private in [vec![0; 32], vec![1; 32]] {
let mut invalid = stored.clone();
invalid["private_key"] = serde_json::json!(private);
assert!(serde_json::from_value::<Identity>(invalid).is_err());
}
for length in [64, 4097] {
let mut invalid = stored.clone();
invalid["public_signature"] = serde_json::json!(vec![9; length]);
assert!(serde_json::from_value::<Identity>(invalid).is_err());
}
}
#[test]
fn proof_writes_exact_public_wire_fields() {
let mut command =
OutCommand::new(Direction::C2S, Flags::empty(), PacketType::Command, "clientinit");
identity().proof(&[0; 64]).write_to(&mut command);
let packet = command.into_packet();
let wire = std::str::from_utf8(packet.content()).unwrap();
let fields: Vec<_> =
wire.split(' ').skip(1).map(|field| field.split('=').next().unwrap()).collect();
assert_eq!(fields, [
"myTeamspeakId",
"acTime",
"userPubKey",
"authSign",
"pubSign",
"pubSignCert"
]);
assert!(!wire.contains("private"));
}
}
+1
View File
@@ -57,6 +57,7 @@ tsproto-packets = { path = "../proto/tsproto-packets" }
tsproto-types = { path = "../proto/tsproto-types" }
[dev-dependencies]
voelin-myts = { path = "../voelin-myts" }
# `process`: the browser interop test drives Chromium through Node.js.
tokio = { version = "1", features = ["macros", "net", "process", "rt-multi-thread", "test-util"] }
+12 -2
View File
@@ -63,6 +63,7 @@ pub mod settings;
pub mod stream;
#[cfg(feature = "media")]
pub mod studio;
pub mod versions;
mod voice;
mod web;
@@ -70,7 +71,7 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;
use tokio::sync::{broadcast, mpsc};
use tokio::sync::{broadcast, mpsc, watch};
pub use voelin_audio::settings::TransmitMode;
pub use voelin_audio::{AudioSettings, ProcessingSettings, VadSettings};
use voelin_model::{
@@ -101,6 +102,8 @@ pub type SessionId = u64;
/// What the UI asks for.
#[derive(Clone, Debug)]
pub enum Command {
/// Main account proof for every current and future voice connection.
SetMytsIdentity(Option<Arc<tsproto::myts::Identity>>),
ConnectVoice {
session: SessionId,
options: Box<VoiceOptions>,
@@ -812,6 +815,7 @@ async fn run(
// Before any command: a contact set meanwhile would be lost.
contacts.load().await;
let mut sessions: HashMap<SessionId, session::SessionHandle> = HashMap::new();
let (myts_identity, _) = watch::channel(None);
let mut current = shared.current();
// Pruning: at start, then hourly (and when the setting changes).
let mut prune = tokio::time::interval(std::time::Duration::from_secs(3600));
@@ -856,6 +860,10 @@ async fn run(
},
};
let id = match command {
Command::SetMytsIdentity(identity) => {
myts_identity.send_replace(identity);
continue;
}
Command::SetAudioSettings(new) => {
settings = (*new).clone();
for s in sessions.values() {
@@ -931,6 +939,7 @@ async fn run(
frames.clone(),
settings.clone(),
engine.clone(),
myts_identity.subscribe(),
);
if let Some(profiles) = &srtp_profiles {
s.send(Command::SetSrtpProfiles(profiles.clone()));
@@ -1008,7 +1017,8 @@ fn command_session(command: &Command) -> SessionId {
| Command::DeleteOfflineMessage { session, .. }
| Command::SetOfflineMessageRead { session, .. }
| Command::CloseSession { session } => *session,
Command::SetAudioSettings(_)
Command::SetMytsIdentity(_)
| Command::SetAudioSettings(_)
| Command::SetSrtpProfiles(_)
| Command::TestMicrophone { .. }
| Command::SetSetting { .. }
+10 -2
View File
@@ -86,9 +86,12 @@ impl SessionHandle {
frames: broadcast::Sender<StreamFrame>,
audio_settings: AudioSettings,
shared: Shared,
myts_identity: watch::Receiver<Option<Arc<tsproto::myts::Identity>>>,
) -> Self {
let (tx, rx) = mpsc::unbounded_channel();
tokio::spawn(Session::new(id, events, frames, audio_settings, shared).run(rx));
tokio::spawn(
Session::new(id, events, frames, audio_settings, shared, myts_identity).run(rx),
);
Self { tx }
}
@@ -171,6 +174,7 @@ struct OwnStream {
}
struct Session {
myts_identity: watch::Receiver<Option<Arc<tsproto::myts::Identity>>>,
id: SessionId,
events: broadcast::Sender<Event>,
state: SessionState,
@@ -244,11 +248,13 @@ impl Session {
frames: broadcast::Sender<StreamFrame>,
audio_settings: AudioSettings,
shared: Shared,
myts_identity: watch::Receiver<Option<Arc<tsproto::myts::Identity>>>,
) -> Self {
let (sources_tx, sources_rx) = mpsc::unbounded_channel();
let Shared { settings, history, cache, contacts } = shared;
let contacts_rx = Some(contacts.watch());
Self {
myts_identity,
cache,
contacts,
contacts_rx,
@@ -381,6 +387,7 @@ impl Session {
self.forward(audio_rx, move |e| SourceEvent::Audio(generation, e));
}
let link = VoiceLink {
myts_identity: self.myts_identity.clone(),
session: self.id,
events: self.events.clone(),
settings: self.settings.clone(),
@@ -691,7 +698,8 @@ impl Session {
self.voice_request(Some(request), VoiceCmd::OfflineFlag { request, id, read });
}
// Engine-wide.
Command::CloseSession { .. }
Command::SetMytsIdentity(_)
| Command::CloseSession { .. }
| Command::TestMicrophone { .. }
| Command::SetSetting { .. }
| Command::ResetSetting { .. }
+175
View File
@@ -0,0 +1,175 @@
//! Known signed client versions.
//!
//! `clientinit` must carry a `client_version_sign` produced by TeamSpeak's
//! private key, so a client can only claim versions from this list of captured
//! signatures (the `Versions.csv` declaration file).
use anyhow::{Context, Result, bail};
use base64::prelude::*;
use tsclientlib::Version;
const VERSIONS_CSV: &str = include_str!("../../proto/tsproto-structs/declarations/Versions.csv");
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct KnownVersion {
pub version: String,
pub platform: String,
pub signature: String,
}
impl KnownVersion {
pub fn to_version(&self) -> Result<Version> {
let signature = BASE64_STANDARD
.decode(&self.signature)
.with_context(|| format!("invalid signature for {}@{}", self.platform, self.version))?;
Ok(Version::Custom {
platform: self.platform.clone(),
version: self.version.clone(),
signature,
})
}
}
pub fn known_versions() -> Vec<KnownVersion> {
VERSIONS_CSV
.lines()
.skip(1)
.filter(|l| !l.trim().is_empty())
.filter_map(|l| {
// The version string contains no commas, the signature is base64.
let mut parts = l.splitn(3, ',');
Some(KnownVersion {
version: parts.next()?.to_string(),
platform: parts.next()?.to_string(),
signature: parts.next()?.trim().to_string(),
})
})
.collect()
}
/// Resolve a `--client-version` argument.
///
/// Accepts `default` (the core native-platform default), an index into [`known_versions`],
/// or `<platform>@<version>` with the exact strings from `voelinctl versions`.
pub fn resolve(spec: &str) -> Result<Option<Version>> {
if spec == "default" {
return Ok(None);
}
let versions = known_versions();
if let Ok(i) = spec.parse::<usize>() {
let Some(v) = versions.get(i) else {
bail!("version index {i} out of range (0..{})", versions.len());
};
return v.to_version().map(Some);
}
let Some((platform, version)) = spec.split_once('@') else {
bail!("expected `default`, an index or `<platform>@<version>`, got {spec:?}");
};
match versions.iter().find(|v| v.platform == platform && v.version == version) {
Some(v) => v.to_version().map(Some),
None => bail!("unknown client version {spec:?}, see `voelinctl versions`"),
}
}
/// The signed compatibility tuple for the native operating system.
///
/// The generic version retains the library's minimum-version compatibility.
/// Its version, platform and signature must stay together: the signature does
/// not authorize renaming the client or changing its platform.
///
/// Unsupported operating systems return an error rather than claiming another
/// platform. Product identity belongs in [`client_metadata`], not this tuple.
pub fn native_version() -> Result<Version> {
compatibility_version(std::env::consts::OS)
}
fn compatibility_version(os: &str) -> Result<Version> {
let platform = match os {
"linux" => "Linux",
"windows" => "Windows",
"macos" => "OS X",
"android" => "Android",
"ios" => "iOS",
_ => bail!("no signed compatibility version for operating system {os:?}"),
};
known_versions()
.into_iter()
.find(|version| version.platform == platform && version.version.contains("3.6"))
.with_context(|| format!("missing signed compatibility version for {platform}"))?
.to_version()
}
/// Truthful product identity, separate from the signed compatibility tuple.
pub fn client_metadata() -> String {
serde_json::json!({
"name": "Voelin",
"version": env!("CARGO_PKG_VERSION"),
"platform": std::env::consts::OS,
})
.to_string()
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn native_platform_preserves_complete_signed_tuple() {
for (os, platform) in [
("linux", "Linux"),
("windows", "Windows"),
("macos", "OS X"),
("android", "Android"),
("ios", "iOS"),
] {
let version = compatibility_version(os).unwrap();
assert_eq!(version.get_platform(), platform);
assert_eq!(version.get_version_string(), "3.?.? [Build: 5680278000]");
assert_eq!(version.get_signature().len(), 64);
let known = known_versions()
.into_iter()
.find(|known| {
known.platform == platform && known.version == version.get_version_string()
})
.unwrap();
assert_eq!(version, known.to_version().unwrap());
}
assert!(compatibility_version("freebsd").is_err());
assert!(compatibility_version("unknown").is_err());
match compatibility_version(std::env::consts::OS) {
Ok(expected) => assert_eq!(native_version().unwrap(), expected),
Err(_) => assert!(native_version().is_err()),
}
}
#[test]
fn metadata_identifies_voelin_without_changing_signed_version() {
let metadata: serde_json::Value = serde_json::from_str(&client_metadata()).unwrap();
assert_eq!(metadata["name"], "Voelin");
assert_eq!(metadata["version"], env!("CARGO_PKG_VERSION"));
assert_eq!(metadata["platform"], std::env::consts::OS);
}
#[test]
fn parses_all_rows() {
let versions = known_versions();
assert!(versions.len() > 50);
for v in &versions {
let signature = BASE64_STANDARD.decode(&v.signature).unwrap();
assert_eq!(signature.len(), 64, "{v:?}");
}
}
#[test]
fn resolves_specs() {
assert!(resolve("default").unwrap().is_none());
let by_index = resolve("0").unwrap().unwrap();
let first = &known_versions()[0];
let by_name = resolve(&format!("{}@{}", first.platform, first.version)).unwrap().unwrap();
assert_eq!(by_index, by_name);
assert_eq!(by_name.get_platform(), first.platform);
assert!(resolve("Nope@1.0").is_err());
assert!(resolve("100000").is_err());
assert!(resolve("garbage").is_err());
}
}
+210 -33
View File
@@ -8,11 +8,12 @@
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use base64::Engine as _;
use futures::prelude::*;
use tokio::sync::{broadcast, mpsc};
use tokio::sync::{broadcast, mpsc, watch};
use tokio::task::AbortHandle;
use tokio::time::{Instant, timeout};
use tracing::{debug, info, warn};
@@ -39,7 +40,7 @@ pub struct VoiceOptions {
pub address: String,
pub nickname: String,
pub identity: Option<Identity>,
/// Signed client version; `None` for the library default.
/// Signed compatibility version; `None` selects the native platform's tuple.
pub client_version: Option<Version>,
pub server_password: Option<String>,
/// Channel path to join, e.g. `Lobby/Sub`.
@@ -68,6 +69,7 @@ impl VoiceOptions {
/// Where a voice connection reports answers the session does not need to see.
#[derive(Clone)]
pub(crate) struct VoiceLink {
pub myts_identity: watch::Receiver<Option<Arc<tsproto::myts::Identity>>>,
pub session: SessionId,
pub events: broadcast::Sender<Event>,
pub settings: SharedSettings,
@@ -224,6 +226,8 @@ fn now_ms() -> i64 {
}
enum Input {
MytsIdentityChanged,
AccountSourceClosed,
Item(Option<Result<StreamItem, tsclientlib::Error>>),
Cmd(Option<VoiceCmd>),
Tick,
@@ -231,6 +235,7 @@ enum Input {
/// A command waiting for the server's answer.
enum Pending {
MytsIdentity(Instant),
Stream(Request),
FileList {
request: RequestId,
@@ -343,35 +348,55 @@ async fn run_inner(
commands: &mut mpsc::UnboundedReceiver<VoiceCmd>,
events: &mpsc::UnboundedSender<VoiceEvent>,
) -> anyhow::Result<()> {
let mut builder = Connection::build(options.address.clone()).name(options.nickname.clone());
let version = match &options.client_version {
Some(version) => version.clone(),
None => crate::versions::native_version()?,
};
let mut builder = Connection::build(options.address.clone())
.name(options.nickname.clone())
.version(version)
.metadata(crate::versions::client_metadata());
if let Some(identity) = &options.identity {
builder = builder.identity(identity.clone());
}
if let Some(version) = &options.client_version {
builder = builder.version(version.clone());
}
if let Some(pw) = &options.server_password {
builder = builder.password(pw.clone());
}
if let Some(channel) = &options.channel {
builder = builder.channel(channel.clone());
}
let mut con = builder.connect()?;
// Wait for the initial state.
let connected = timeout(Duration::from_secs(30), async {
con.events()
.try_filter(|e| future::ready(matches!(e, StreamItem::BookEvents(_))))
.next()
.await
let mut identity = link.myts_identity.clone();
// A changed account invalidates an in-flight handshake. Drop that connection
// and take a fresh snapshot before publishing any connected state.
let mut con = timeout(Duration::from_secs(30), async {
loop {
let snapshot = identity.borrow_and_update().as_deref().cloned();
let mut con = builder.clone().myts_identity(snapshot).connect()?;
let connected = tokio::select! {
biased;
changed = identity.changed() => {
changed.map_err(|_| anyhow::anyhow!("account source closed"))?;
continue;
}
connected = async {
con.events()
.try_filter(|e| future::ready(matches!(e, StreamItem::BookEvents(_))))
.next().await
} => connected,
};
match connected {
Some(Ok(_)) => {}
Some(Err(e)) => return Err(anyhow::Error::from(e)),
None => anyhow::bail!("connection closed"),
}
if identity.has_changed().unwrap_or(true) {
continue;
}
return Ok(con);
}
})
.await
.map_err(|_| anyhow::anyhow!("timed out while connecting"))?;
match connected {
Some(Ok(_)) => {}
Some(Err(e)) => return Err(e.into()),
None => anyhow::bail!("connection closed"),
}
.map_err(|_| anyhow::anyhow!("timed out while connecting"))??;
let server_uid = {
let state = con.get_state()?;
let flavor = ServerFlavor::from_version_string(&state.server.version);
@@ -409,15 +434,25 @@ async fn run_inner(
let mut tick = tokio::time::interval(Duration::from_millis(250));
let result = loop {
let input = {
let mut stream = voice.con.events();
tokio::select! {
item = stream.next() => Input::Item(item),
cmd = commands.recv() => Input::Cmd(cmd),
_ = tick.tick() => Input::Tick,
}
};
// Check on every turn so busy command/audio queues cannot delay expiry.
if voice.pending.values().any(|pending| {
matches!(pending, Pending::MytsIdentity(started)
if started.elapsed() >= Duration::from_secs(10))
}) {
break Err(anyhow::anyhow!("myTeamSpeak account update timed out"));
}
let input = next_input(&mut voice.con.events(), commands, &mut tick, &mut identity).await;
match input {
Input::AccountSourceClosed => break Err(anyhow::anyhow!("account source closed")),
Input::MytsIdentityChanged => {
let snapshot = identity.borrow_and_update().as_deref().cloned();
match voice.con.update_myts_identity(snapshot) {
Ok(handle) => {
voice.pending.insert(handle, Pending::MytsIdentity(Instant::now()));
}
Err(e) => break Err(anyhow::anyhow!("myTeamSpeak account update: {e}")),
}
}
Input::Item(None) => break Err(anyhow::anyhow!("connection closed")),
Input::Item(Some(Err(e))) => break Err(e.into()),
Input::Item(Some(Ok(item))) => {
@@ -438,10 +473,52 @@ async fn run_inner(
for (_, job) in voice.jobs.drain() {
job.report()(TransferState::Failed("disconnected".into()));
}
let disconnect = shutdown_connection(voice.con).await;
result?;
voice.con.disconnect(DisconnectOptions::new())?;
let _ =
timeout(Duration::from_secs(3), voice.con.events().for_each(|_| future::ready(()))).await;
disconnect?;
Ok(())
}
async fn next_input(
stream: &mut (impl Stream<Item = Result<StreamItem, tsclientlib::Error>> + Unpin),
commands: &mut mpsc::UnboundedReceiver<VoiceCmd>,
tick: &mut tokio::time::Interval,
identity: &mut watch::Receiver<Option<Arc<tsproto::myts::Identity>>>,
) -> Input {
tokio::select! {
biased;
changed = identity.changed() => if changed.is_ok() {
Input::MytsIdentityChanged
} else {
Input::AccountSourceClosed
},
input = async {
// Keep account changes first without starving network or timers when
// the audio command queue remains ready.
tokio::select! {
cmd = commands.recv() => Input::Cmd(cmd),
_ = tick.tick() => Input::Tick,
item = stream.next() => Input::Item(item),
}
} => input,
}
}
async fn shutdown_connection(mut con: Connection) -> Result<(), tsclientlib::Error> {
// disconnect() also returns Ok while Connecting. Never poll that stale
// handshake: dropping it is the cancellation boundary for logout.
if con.get_state().is_err() {
return Ok(());
}
con.disconnect(DisconnectOptions::new())?;
let _ = timeout(Duration::from_secs(3), async {
while con.get_state().is_ok() {
if con.events().next().await.is_none() {
break;
}
}
})
.await;
Ok(())
}
@@ -496,7 +573,13 @@ impl Voice {
StreamItem::MessageEvent(msg) => self.message_event(&msg),
StreamItem::MessageResult(handle, result) => {
if let Some(pending) = self.pending.remove(&handle) {
self.answered(pending, result.map_err(|e| e.error));
if matches!(pending, Pending::MytsIdentity(_)) {
result.map_err(|e| {
anyhow::anyhow!("myTeamSpeak account update: {}", e.error)
})?;
} else {
self.answered(pending, result.map_err(|e| e.error));
}
}
}
StreamItem::FileDownload(handle, download) => {
@@ -714,7 +797,7 @@ impl Voice {
};
self.link.emit(Event::OfflineMessage { session, request, result });
}
Pending::Quiet => {}
Pending::Quiet | Pending::MytsIdentity(_) => {}
Pending::Report(what) => {
if let Err(e) = result {
let _ = self.events.send(VoiceEvent::Error(format!("{what}: {e}")));
@@ -1021,3 +1104,97 @@ mod image_download_tests {
assert_eq!(image_download_time(cache::MAX_PICTURE_BYTES), Duration::from_secs(30 + 2048));
}
}
#[cfg(test)]
mod account_tests {
use super::*;
#[tokio::test(start_paused = true)]
async fn account_priority_preserves_ready_network_and_timer_progress() {
let (account, mut identity) = watch::channel(None);
let (commands, mut receiver) = mpsc::unbounded_channel();
for _ in 0..512 {
commands.send(VoiceCmd::SetInputMuted(false)).unwrap();
}
let mut stream = futures::stream::poll_fn(|_| {
std::task::Poll::Ready(Some(Err(tsclientlib::Error::NotConnected)))
});
let mut tick = tokio::time::interval(Duration::from_millis(1));
account.send_replace(None);
assert!(matches!(
next_input(&mut stream, &mut receiver, &mut tick, &mut identity).await,
Input::MytsIdentityChanged
));
identity.borrow_and_update();
let (mut network, mut timers, mut audio) = (0, 0, 0);
for _ in 0..512 {
tokio::time::advance(Duration::from_millis(1)).await;
match next_input(&mut stream, &mut receiver, &mut tick, &mut identity).await {
Input::Item(_) => network += 1,
Input::Tick => timers += 1,
Input::Cmd(_) => audio += 1,
_ => panic!("unexpected account change"),
}
}
assert!(network > 0 && timers > 0 && audio > 0);
}
#[tokio::test]
async fn shutdown_never_polls_a_connecting_connection() {
let server = tokio::net::UdpSocket::bind("127.0.0.1:0").await.unwrap();
let mut con =
Connection::build(server.local_addr().unwrap().to_string()).connect().unwrap();
assert!(matches!(con.update_myts_identity(None), Err(tsclientlib::Error::NotConnected)));
// tsclientlib returns Ok here despite retaining its Connecting future.
assert!(con.disconnect(DisconnectOptions::new()).is_ok());
timeout(Duration::from_millis(100), shutdown_connection(con)).await.unwrap().unwrap();
let mut packet = [0; 2048];
assert!(matches!(server.try_recv_from(&mut packet), Err(error)
if error.kind() == std::io::ErrorKind::WouldBlock));
}
#[tokio::test]
async fn account_change_cancels_pending_handshake() {
// A silent UDP peer keeps the handshake in flight without an external server.
let server = tokio::net::UdpSocket::bind("127.0.0.1:0").await.unwrap();
let (account, identity) = watch::channel(None);
let (events, _) = broadcast::channel(8);
let link = VoiceLink {
session: 1,
events,
settings: SharedSettings::new(crate::settings::Settings::default()),
myts_identity: identity,
};
let (_commands, commands) = mpsc::unbounded_channel();
let (events, mut received) = mpsc::unbounded_channel();
let task = tokio::spawn(run(
VoiceOptions::new(server.local_addr().unwrap().to_string(), "account-test"),
link,
commands,
events,
));
let mut packet = [0; 2048];
let (_, first) =
timeout(Duration::from_secs(5), server.recv_from(&mut packet)).await.unwrap().unwrap();
// A logout/clear notification must cancel the old socket and restart.
account.send_replace(None);
let second = timeout(Duration::from_secs(5), async {
loop {
let (_, peer) = server.recv_from(&mut packet).await.unwrap();
if peer != first {
break peer;
}
}
})
.await
.unwrap();
assert_ne!(first, second);
// Losing the account authority fails closed immediately, not after connect timeout.
drop(account);
timeout(Duration::from_secs(2), task).await.unwrap().unwrap();
assert!(
matches!(received.recv().await, Some(VoiceEvent::Disconnected(Some(reason))) if reason == "account source closed")
);
assert!(received.try_recv().is_err());
}
}
+149
View File
@@ -0,0 +1,149 @@
//! Opt-in account + isolated server interoperability check. No keys are saved.
//! Requires VOELIN_MYTS_LIVE=1, EMAIL/PASSWORD/DEVICE_ID and optional OTP under
//! the VOELIN_MYTS_ prefix; TEST_TS3/TEST_TS6 and QUERY_TS3/QUERY_TS6 give
//! loopback voice/query addresses. QUERY_PASSWORD authenticates local query.
#![cfg(not(target_os = "android"))]
use std::{sync::Arc, time::Duration};
use anyhow::{Context, Result, bail, ensure};
use tokio::{sync::broadcast, time::timeout};
use voelin_core::{Command, Engine, Event, VoiceOptions, VoiceState};
use voelin_myts::{Client, ServerIdentity};
use voelin_query::{Command as QueryCommand, QueryClient, Row};
fn env(name: &str) -> Result<String> {
std::env::var(format!("VOELIN_MYTS_{name}")).with_context(|| format!("missing {name}"))
}
async fn connected(events: &mut broadcast::Receiver<Event>, session_id: u64) -> Result<u16> {
timeout(Duration::from_secs(35), async {
loop {
match events.recv().await? {
Event::State { session, state }
if session == session_id && state.voice == VoiceState::Connected =>
{
if let Some(id) = state.own_client {
return Ok(id);
}
}
Event::Error { message, .. } => bail!("engine: {message}"),
_ => {}
}
}
})
.await?
}
async fn info(query: &QueryClient, client: u16) -> Result<Row> {
query
.send(&QueryCommand::new("clientinfo").arg("clid", client))
.await?
.into_iter()
.next()
.context("clientinfo missing")
}
async fn wait_id(query: &QueryClient, client: u16, expected: &str) -> Result<()> {
timeout(Duration::from_secs(12), async {
loop {
let row = info(query, client).await?;
if row.get("client_myteamspeak_id") == Some(expected) {
return Ok(());
}
tokio::time::sleep(Duration::from_millis(200)).await;
}
})
.await
.context("server did not report the expected myTS association")?
}
async fn server(identity: Arc<ServerIdentity>, kind: &str) -> Result<()> {
let address = env(&format!("TEST_{kind}"))?;
let query_address = env(&format!("QUERY_{kind}"))?;
// This test is deliberately limited to caller-owned loopback test servers.
ensure!(address.starts_with("127.0.0.1:"), "voice endpoint must be loopback");
ensure!(query_address.starts_with("127.0.0.1:"), "query endpoint must be loopback");
let (query, _) = QueryClient::connect(&voelin_query::Connect {
transport: if kind == "TS3" {
voelin_query::Transport::Raw
} else {
voelin_query::Transport::Ssh
},
addr: query_address,
user: "serveradmin".into(),
secret: Some(env("QUERY_PASSWORD")?),
server_id: Some(1),
server_port: None,
line: voelin_query::LineOptions { rate_limit: None, ..Default::default() },
})
.await?;
let engine = Engine::start();
let mut events = engine.subscribe();
let result = async {
engine.send(Command::SetMytsIdentity(Some(identity.clone())));
for session in 1..=2 {
engine.send(Command::ConnectVoice {
session,
options: Box::new(VoiceOptions::new(&address, format!("myts-proof-{session}"))),
});
let client = connected(&mut events, session).await?;
let row = info(&query, client).await?;
let version = voelin_core::versions::native_version()?;
ensure!(row.get("client_platform") == Some(version.get_platform()), "wrong platform");
ensure!(
row.get("client_version") == Some(version.get_version_string()),
"wrong version"
);
let metadata: serde_json::Value =
serde_json::from_str(row.get("client_meta_data").context("missing metadata")?)?;
ensure!(metadata["name"] == "Voelin", "wrong client metadata");
ensure!(metadata["platform"] == std::env::consts::OS, "wrong metadata platform");
eprintln!("{kind}: native platform/Voelin metadata passed");
wait_id(&query, client, &identity.id()).await?;
eprintln!("{kind}: signed clientinit myTS ID passed");
// Two fresh connections prove the signature is bound to each handshake.
engine.send(Command::SetMytsIdentity(None));
wait_id(&query, client, "").await?;
engine.send(Command::SetMytsIdentity(Some(identity.clone())));
wait_id(&query, client, &identity.id()).await?;
eprintln!("{kind}: live clear and reattach passed");
engine.send(Command::CloseSession { session });
}
Ok(())
}
.await;
engine.send(Command::SetMytsIdentity(None));
for session in 1..=2 {
engine.send(Command::CloseSession { session });
}
query.quit().await;
result
}
#[tokio::test(flavor = "multi_thread")]
#[ignore = "requires owner-authorized account and isolated loopback servers"]
async fn authenticated_account_and_server_lifecycle() -> Result<()> {
ensure!(env("LIVE")? == "1", "explicit live opt-in required");
let client = Client::new()?;
let login = client
.login(&env("EMAIL")?, &env("PASSWORD")?, env("OTP").ok().as_deref(), &env("DEVICE_ID")?)
.await?;
// Capture every result before deleting the newly created remote session.
let result = async {
client.validate_session(&login.token).await?;
let identity = Arc::new(login.identity.context("server identity unlock failed")?);
let mut failures = Vec::new();
for kind in ["TS3", "TS6"] {
if let Err(error) = server(identity.clone(), kind).await {
failures.push(format!("{kind}: {error:#}"));
}
}
ensure!(failures.is_empty(), "{}", failures.join("; "));
Ok(())
}
.await;
let logout = client.logout(&login.token).await;
logout.context("remote test session revocation failed")?;
result
}
+30
View File
@@ -0,0 +1,30 @@
[package]
name = "voelin-myts"
version = "0.1.0"
description = "Bounded myTeamSpeak account HTTP client"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
[dependencies]
# Reuse the workspace's existing crypto crates for the account wire credential.
base64 = "0.22"
aes = "0.9"
aes-gcm = { version = "0.11", features = ["zeroize"] }
ctr = "0.10"
subtle = "2.6"
zeroize = "1.9"
tsproto = { path = "../proto/tsproto" }
pbkdf2 = { version = "0.13", features = ["sha2"] }
schema-api = { path = "../../third_party/schema-api", default-features = false }
reqwest = { version = "0.13.5", default-features = false, features = ["rustls", "http2"] }
thiserror = "2.0.21"
tokio = { version = "1.53.1", features = ["rt", "time"] }
[dev-dependencies]
tokio = { version = "1.53.1", features = ["rt-multi-thread", "macros", "net", "io-util"] }
[lints]
workspace = true
+202
View File
@@ -0,0 +1,202 @@
//! Authenticated account-key unwrap; plaintext keys never leave this module
//! except inside the validated, redacted protocol identity.
use aes_gcm::{Aes256Gcm, KeyInit, aead::AeadInOut};
use ctr::cipher::{KeyIvInit, StreamCipher};
use pbkdf2::sha2::{Digest, Sha512};
use schema_api::api;
use subtle::ConstantTimeEq;
use tsproto::myts::Identity;
use zeroize::Zeroizing;
/// Static, non-secret explanation for a usable login without a server identity.
#[derive(Clone, Copy, Debug, PartialEq, Eq, thiserror::Error)]
pub enum IdentityError {
#[error("sign in with your password to unlock the server identity")]
PasswordRequired,
#[error("the account did not provide a server identity")]
Missing,
#[error("the account uses an unsupported encryption-key version")]
UnsupportedKeyVersion,
#[error("the account encryption key has an invalid format")]
InvalidRootKey,
#[error("the account encryption key could not be authenticated")]
RootAuthentication,
#[error("the account server identity has an invalid format")]
InvalidIdentity,
#[error("the account private key could not be verified")]
PrivateKeyIntegrity,
}
pub(crate) fn encryption_key(email: &str, password: &str) -> Zeroizing<[u8; 32]> {
let salt = Zeroizing::new(format!("{}ts3Encryption{password}", email.to_ascii_lowercase()));
Zeroizing::new(pbkdf2::pbkdf2_hmac_array::<Sha512, 32>(
password.as_bytes(),
salt.as_bytes(),
10_000,
))
}
fn unwrap_root(wrapped: &[u8], key: &[u8; 32]) -> Result<Zeroizing<[u8; 32]>, IdentityError> {
match wrapped.first() {
None => return Err(IdentityError::InvalidRootKey),
Some(2) => {}
Some(_) => return Err(IdentityError::UnsupportedKeyVersion),
}
if wrapped.len() != 61 {
return Err(IdentityError::InvalidRootKey);
}
let mut plaintext = Zeroizing::new([0; 32]);
plaintext.copy_from_slice(&wrapped[29..]);
let cipher = Aes256Gcm::new(key.into());
cipher
.decrypt_inout_detached(
wrapped[17..29].try_into().map_err(|_| IdentityError::InvalidRootKey)?,
b"",
plaintext.as_mut_slice().into(),
wrapped[1..17].try_into().map_err(|_| IdentityError::InvalidRootKey)?,
)
.map_err(|_| IdentityError::RootAuthentication)?;
Ok(plaintext)
}
fn unwrap_private(wrapped: &[u8], root: &[u8; 32]) -> Result<Zeroizing<[u8; 32]>, IdentityError> {
if wrapped.len() != 112 {
return Err(IdentityError::InvalidIdentity);
}
let mut plaintext = Zeroizing::new([0; 32]);
plaintext.copy_from_slice(&wrapped[16..48]);
let mut cipher = ctr::Ctr128LE::<aes::Aes256>::new(
root.into(),
wrapped[..16].try_into().map_err(|_| IdentityError::InvalidIdentity)?,
);
cipher.apply_keystream(plaintext.as_mut_slice());
let digest = Zeroizing::new(<[u8; 64]>::from(Sha512::digest(plaintext.as_slice())));
if !bool::from(digest.as_slice().ct_eq(&wrapped[48..])) {
return Err(IdentityError::PrivateKeyIntegrity);
}
Ok(plaintext)
}
pub(crate) fn decrypt(
response: &api::LoginSession,
key: &[u8; 32],
) -> Result<Identity, IdentityError> {
let data = response.myts_id_data.as_ref().ok_or(IdentityError::Missing)?;
let encrypted = data.user_private_key.as_ref().ok_or(IdentityError::Missing)?;
let public_key =
data.user_public_key.as_slice().try_into().map_err(|_| IdentityError::InvalidIdentity)?;
let root = unwrap_root(&response.key, key)?;
let private = unwrap_private(&encrypted.encrypted_user_private_key, &root)?;
Identity::new(
data.my_teamspeak_id.clone(),
// The HTTP schema uses the numeric timestamp; the voice protocol's
// decimal acTime represents its byte-swapped integer. The server
// verifies pubKey || acTime.to_le_bytes() || myTS ID. The official
// login-to-storage boundary performs this same conversion.
data.account_creation_time.swap_bytes(),
public_key,
*private,
data.public_signature.clone(),
)
.map_err(|_| IdentityError::InvalidIdentity)
}
#[cfg(test)]
mod tests {
use super::*;
// Independent Python hashlib + cryptography AESGCM/AES-ECB fixtures.
// CTR is assembled by incrementing the counter as a little-endian integer.
const ROOT: &str = "0201123b3434c3b04a2b6713e5a14c5f10000102030405060708090a0be7012a4987a157ece9103814f297d77cae6a2084730d7e049895cb0ba2334178";
const PRIVATE: &str = "000102030405060708090a0b0c0d0e0f7a4f26742cde57b1d8077f162eee88bd3afe99c66443d961cd28a368ac98cc2f887af58a36202e05c4c1cfec5bf6c61fad66bca851536004074b31f1b56e4ac93d9c9fc20dc59e01fecab23063ef341b2d2d75c4e8e4fa1e9ba958658260e336";
fn hex(s: &str) -> Vec<u8> {
s.as_bytes()
.chunks_exact(2)
.map(|pair| u8::from_str_radix(std::str::from_utf8(pair).unwrap(), 16).unwrap())
.collect()
}
#[test]
fn independent_password_root_and_private_vectors() {
let key = encryption_key("User@Example.TEST", "password");
assert_eq!(
key.as_slice(),
hex("81ccdf8e98030891e11700e5d76dfa6c52ff01121f668ab6a5525742ed18c5ca")
);
let root = unwrap_root(&hex(ROOT), &key).unwrap();
assert_eq!(root.as_slice(), (0..32).collect::<Vec<u8>>());
let private = unwrap_private(&hex(PRIVATE), &root).unwrap();
assert_eq!(private.as_slice(), (32..64).collect::<Vec<u8>>());
}
#[test]
fn decrypts_response_and_rejects_a_mismatched_public_key() {
let key = encryption_key("user@example.test", "password");
let mut response = api::LoginSession {
key: hex(ROOT),
myts_id_data: Some(api::MyTeamSpeakIdData {
// Independently computed scalar multiplication using affine Edwards arithmetic.
user_public_key: hex(
"e67b030457ea1be59391ea3f28748d12abe417fef0f7bb6ad68e54e836eda6c4",
),
user_private_key: Some(api::my_team_speak_id_data::UserPrivateKey {
encrypted_user_private_key: hex(PRIVATE),
// Never trust this alternate server plaintext field.
decrypted_user_private_key: vec![0; 32],
}),
account_creation_time: 123,
my_teamspeak_id: vec![1; 33],
public_signature: vec![2; 65],
}),
..Default::default()
};
let identity = decrypt(&response, &key).unwrap();
assert_eq!(identity.id(), "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB");
assert_eq!(identity.proof(&[0; 64]).creation_time, 123u64.swap_bytes());
response.myts_id_data.as_mut().unwrap().user_public_key[0] ^= 1;
assert_eq!(decrypt(&response, &key).unwrap_err(), IdentityError::InvalidIdentity);
}
#[test]
fn every_authenticated_root_byte_is_checked() {
let key = encryption_key("user@example.test", "password");
for index in 1..61 {
let mut wrapped = hex(ROOT);
wrapped[index] ^= 1;
assert_eq!(unwrap_root(&wrapped, &key).unwrap_err(), IdentityError::RootAuthentication);
}
assert_eq!(
unwrap_root(&hex(ROOT), &[0; 32]).unwrap_err(),
IdentityError::RootAuthentication
);
}
#[test]
fn every_private_item_byte_is_checked() {
let root = std::array::from_fn(|i| i as u8);
for index in 0..112 {
let mut wrapped = hex(PRIVATE);
wrapped[index] ^= 1;
assert_eq!(
unwrap_private(&wrapped, &root).unwrap_err(),
IdentityError::PrivateKeyIntegrity
);
}
}
#[test]
fn missing_unsupported_and_malformed_are_explicit() {
assert_eq!(
decrypt(&api::LoginSession::default(), &[0; 32]).unwrap_err(),
IdentityError::Missing
);
assert_eq!(unwrap_root(&[], &[0; 32]).unwrap_err(), IdentityError::InvalidRootKey);
assert_eq!(unwrap_root(&[1], &[0; 32]).unwrap_err(), IdentityError::UnsupportedKeyVersion);
for size in [1, 60, 62] {
let mut wrapped = vec![0; size];
wrapped[0] = 2;
assert_eq!(unwrap_root(&wrapped, &[0; 32]).unwrap_err(), IdentityError::InvalidRootKey);
}
for size in [0, 111, 113] {
assert_eq!(
unwrap_private(&vec![0; size], &[0; 32]).unwrap_err(),
IdentityError::InvalidIdentity
);
}
}
}
+233
View File
@@ -0,0 +1,233 @@
//! Account sessions over the custom myTeamSpeak HTTP transport.
//!
//! Requests use the official client's method envelope and password derivation.
//! No requests or credentials are logged.
mod identity;
mod transport;
pub use identity::IdentityError;
pub use tsproto::myts::Identity as ServerIdentity;
use zeroize::{Zeroize, Zeroizing};
use base64::{Engine as _, engine::general_purpose::STANDARD};
pub use schema_api::SessionToken;
use schema_api::{api, session, wire};
use std::fmt;
/// Owned account login result. Credential fields are redacted in Debug output.
#[derive(Clone)]
pub struct Login {
pub token: SessionToken,
pub uuid: String,
pub username: String,
pub renewal: Option<Renewal>,
/// Validated server identity, or why this session cannot associate with servers.
pub identity: Result<ServerIdentity, IdentityError>,
}
/// Server-provided alternative login material, stored only in a secret store.
#[derive(Clone)]
pub struct Renewal {
pub token: String,
pub otp_token: String,
pub device_id: String,
}
impl fmt::Debug for Login {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Login([REDACTED])")
}
}
impl fmt::Debug for Renewal {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Renewal([REDACTED])")
}
}
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("account transport failed")]
Transport(#[from] reqwest::Error),
#[error("invalid account response")]
Decode(#[from] schema_api::prost::DecodeError),
#[error(transparent)]
Session(#[from] session::SessionError),
#[error(transparent)]
Status(#[from] session::CommonStatusError),
#[error("account request exceeds size limit")]
RequestTooLarge,
#[error("account response exceeds size limit")]
ResponseTooLarge,
#[error("account request timed out")]
Timeout,
#[error("account endpoint returned HTTP {0}")]
Http(u16),
#[error("account endpoint returned an unsupported content type")]
ContentType,
#[error("account credential preparation failed")]
CredentialPreparation,
#[error("renewal requires both a renewal token and an auth token")]
MissingRenewalCredentials,
}
impl Error {
pub fn status_code(&self) -> Option<i32> {
match self {
Self::Status(status) | Self::Session(session::SessionError::Api(status)) => {
Some(status.code)
}
_ => None,
}
}
pub fn is_otp_required(&self) -> bool {
self.status_code() == Some(api::ErrorCommon::ErrorAuthRequiresOtp as i32)
}
/// Only the explicit expired-session status permits an automatic renewal.
pub fn is_invalid_session(&self) -> bool {
self.status_code() == Some(api::ErrorCommon::ErrorSessionExpired as i32)
}
}
#[derive(Clone)]
pub struct Client {
transport: transport::Transport,
}
impl Client {
pub fn new() -> Result<Self, Error> {
Ok(Self { transport: transport::Transport::new()? })
}
/// Sign in with the user's password; the protocol credential is derived
/// internally, off the async runtime's worker threads.
pub async fn login(
&self,
email: &str,
password: &str,
otp: Option<&str>,
device: &str,
) -> Result<Login, Error> {
self.login_with_otp_renewal(email, password, otp, device, "").await
}
/// Password login on a remembered device. The OTP renewal token must belong
/// to this account and device; an explicit one-time code takes precedence.
pub async fn login_with_otp_renewal(
&self,
email: &str,
password: &str,
otp: Option<&str>,
device: &str,
otp_renewal: &str,
) -> Result<Login, Error> {
// Check before copying caller-controlled strings into protobuf allocations.
transport::check_input_size(&[
email,
password,
otp.unwrap_or_default(),
device,
otp_renewal,
])?;
let mut request = api::LoginData {
email: email.into(),
password: password.into(),
otp: otp.unwrap_or_default().into(),
device_id: device.into(),
otp_renewal_token: if device.is_empty() || otp.is_some_and(|code| !code.is_empty()) {
String::new()
} else {
otp_renewal.into()
},
device_name: "Voelin".into(),
..Default::default()
};
let (request, encryption_key) = tokio::task::spawn_blocking(move || {
let password = Zeroizing::new(std::mem::take(&mut request.password));
let encryption_key = identity::encryption_key(&request.email, &password);
request.password = login_password(&request.email, &password);
(request, encryption_key)
})
.await
.map_err(|_| Error::CredentialPreparation)?;
self.login_call("login", &wire::encode(&request), Some(encryption_key)).await
}
/// `auth` is the schema's auth_token, not an OTP or device identifier.
/// The official client requires both credentials. Password login does not
/// supply an auth token; callers must not invent one or pass an empty value.
pub async fn login_with_renewal(&self, renewal: &str, auth: &str) -> Result<Login, Error> {
if renewal.is_empty() || auth.is_empty() {
return Err(Error::MissingRenewalCredentials);
}
transport::check_input_size(&[renewal, auth])?;
let request =
api::RenewalTokenLogin { renewal_token: renewal.into(), auth_token: auth.into() };
self.login_call("loginWithRenewalToken", &wire::encode(&request), None).await
}
async fn login_call(
&self,
method: &str,
body: &[u8],
encryption_key: Option<Zeroizing<[u8; 32]>>,
) -> Result<Login, Error> {
let bytes = self.transport.call("authentication", method, body).await?;
let response: api::LoginSession = wire::decode(bytes)?;
let token = SessionToken::try_from(&response)?;
let (response, identity) = tokio::task::spawn_blocking(move || {
let identity = match encryption_key {
Some(key) => identity::decrypt(&response, &key),
None => Err(IdentityError::PasswordRequired),
};
(response, identity)
})
.await
.map_err(|_| Error::CredentialPreparation)?;
Ok(Login {
token,
identity,
uuid: response.uuid,
username: response.username,
renewal: response.alternative_login_info.map(|info| Renewal {
token: info.renewal_token,
otp_token: info.otp_renewal_token,
device_id: info.device_id,
}),
})
}
pub async fn validate_session(&self, token: &SessionToken) -> Result<(), Error> {
let response = self.session_call("session", token).await?;
Ok(session::validate_session_status(&response)?)
}
pub async fn logout(&self, token: &SessionToken) -> Result<(), Error> {
let response = self.session_call("deleteSession", token).await?;
Ok(session::validate_deleted_session_status(&response)?)
}
async fn session_call(
&self,
method: &str,
token: &SessionToken,
) -> Result<api::LoginStatus, Error> {
transport::check_input_size(&[token.as_str()])?;
let bytes = self
.transport
.call("session", method, &wire::encode(&api::Session::from(token)))
.await?;
Ok(wire::decode(bytes)?)
}
}
fn login_password(email: &str, password: &str) -> String {
// Official client's classic-locale bytewise lowercase is ASCII-only.
// These are wire-protocol constants, not configurable password policy.
let salt = Zeroizing::new(format!("{}ts3Login{password}", email.to_ascii_lowercase()));
let mut derived = pbkdf2::pbkdf2_hmac_array::<pbkdf2::sha2::Sha512, 48>(
password.as_bytes(),
salt.as_bytes(),
10_000,
);
let encoded = STANDARD.encode(derived);
derived.zeroize();
encoded
}
#[cfg(test)]
mod tests;
+359
View File
@@ -0,0 +1,359 @@
use super::*;
use std::time::Duration;
use tokio::{
io::{AsyncReadExt, AsyncWriteExt},
net::TcpListener,
};
async fn mock(
status: u16,
extra_headers: &str,
body: Vec<u8>,
) -> (Client, tokio::task::JoinHandle<(String, Vec<u8>)>) {
mock_typed(status, "application/ts3cloud", extra_headers, body).await
}
async fn mock_typed(
status: u16,
content_type: &str,
extra_headers: &str,
body: Vec<u8>,
) -> (Client, tokio::task::JoinHandle<(String, Vec<u8>)>) {
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let client = Client {
transport: transport::Transport::mock(
format!("http://{}", listener.local_addr().unwrap()),
Duration::from_secs(2),
),
};
let extra_headers = extra_headers.to_owned();
let content_type = content_type.to_owned();
let task = tokio::spawn(async move {
let (mut stream, _) = listener.accept().await.unwrap();
let mut request = Vec::new();
let end = loop {
let mut byte = [0];
stream.read_exact(&mut byte).await.unwrap();
request.push(byte[0]);
if request.ends_with(b"\r\n\r\n") {
break request.len();
}
assert!(request.len() < 8192);
};
let headers = String::from_utf8(request[..end].to_vec()).unwrap();
let length: usize = headers
.lines()
.find_map(|line| {
line.to_ascii_lowercase().strip_prefix("content-length: ").map(str::to_owned)
})
.unwrap()
.parse()
.unwrap();
let mut request_body = vec![0; length];
stream.read_exact(&mut request_body).await.unwrap();
let response = format!(
"HTTP/1.1 {status} Test\r\nContent-Type: {content_type}\r\nContent-Length: {}\r\nConnection: close\r\n{extra_headers}\r\n",
body.len()
);
let _ = stream.write_all(response.as_bytes()).await;
let _ = stream.write_all(&body).await;
(headers, request_body)
});
(client, task)
}
fn success() -> api::LoginSession {
api::LoginSession {
error: 200,
session: "session-secret".into(),
uuid: "account-uuid".into(),
username: "user".into(),
alternative_login_info: Some(api::login_session::AlternativeLoginInformation {
renewal_token: "renewal-secret".into(),
otp_renewal_token: "otp-secret".into(),
device_id: "device".into(),
}),
..Default::default()
}
}
#[test]
fn login_password_matches_independent_vectors_without_normalizing_passwords() {
for email in ["User@Example.TEST", "user@example.test"] {
assert_eq!(
login_password(email, "password"),
"5SG5V/18cFF2iHUFXNrFLrmLeAtbjg0sLgKpSMTZe9W8G/rPorrJyY6uJDm98ICk"
);
}
assert_eq!(
login_password("Case@Example.TEST", " Pässword "),
"NssDyxUbagUiUJS/7Mh7YCeMmF+w3BiAO8uLCgKW0nkH0hQLWYEjuLlV5P28GHNS"
);
assert_eq!(
login_password("éMAIL@Example.TEST", "páss"),
"x6kph1Mku46TD2/zDER1UbqU0w6WV27J6W8t1CNmnDv1JELm6MPKlTyh9Mj+REjB"
);
}
#[tokio::test]
async fn protobuf_response_accepts_the_services_json_content_type() {
let (client, server) = mock_typed(200, "application/json", "", wire::encode(&success())).await;
let login = client.login("mail", "password", None, "device").await.unwrap();
assert_eq!(login.token.as_str(), "session-secret");
server.await.unwrap();
}
#[tokio::test]
async fn login_uses_official_method_prefix_instead_of_a_header() {
let (client, server) = mock(200, "", wire::encode(&success())).await;
client.login("mail", "password", None, "device").await.unwrap();
let (headers, body) = server.await.unwrap();
assert!(body.starts_with(b"\x05login"));
assert!(!headers.to_ascii_lowercase().contains("x-rpc-method"));
let request: api::LoginData = wire::decode(&body[6..]).unwrap();
assert_eq!(request.email, "mail");
// Independent Python hashlib.pbkdf2_hmac fixture with synthetic credentials.
assert_eq!(
request.password,
"TRd/AoYKGWZQ+grEk+YpdbXvhzGyZCyaA358SI+/q99VuAVHz1kByIEF5sNDSqEu"
);
}
#[tokio::test]
async fn login_roundtrip_keeps_credentials_in_body_and_redacts_results() {
let (client, server) = mock(200, "", wire::encode(&success())).await;
let login = client.login("mail", "password-secret", Some("123456"), "device").await.unwrap();
assert_eq!(login.token.as_str(), "session-secret");
assert_eq!(login.username, "user");
assert_eq!(login.uuid, "account-uuid");
assert_eq!(login.identity.as_ref().unwrap_err(), &IdentityError::Missing);
assert!(!format!("{login:?}").contains("secret"));
let renewal = login.renewal.unwrap();
assert_eq!(renewal.token, "renewal-secret");
assert_eq!(renewal.otp_token, "otp-secret");
assert_eq!(renewal.device_id, "device");
assert!(!format!("{renewal:?}").contains("secret"));
let (headers, body) = server.await.unwrap();
assert!(headers.starts_with("POST /authentication HTTP/1.1"));
assert!(headers.to_lowercase().contains("content-type: application/ts3cloud"));
assert!(body.starts_with(b"\x05login"));
assert!(!headers.contains("password-secret"));
let data: api::LoginData = wire::decode(&body[6..]).unwrap();
assert_eq!(data.email, "mail");
assert_eq!(data.password, "MQU48au/lEdA0Hd/DNJ09/M4ZJgqYL5Q+PRF7OILYbUkZWHIpGw4c/kW4t4/Qofk");
assert_eq!(data.otp, "123456");
assert_eq!(data.device_id, "device");
assert!(!data.skip_session);
}
#[tokio::test]
async fn login_requires_explicit_success_nonempty_token_and_preserves_status() {
for code in [0, 202, 208, 98765] {
let mut response = success();
response.error = code;
let (client, server) = mock(200, "", wire::encode(&response)).await;
let error = client.login("e", "p", None, "d").await.unwrap_err();
assert_eq!(error.status_code(), Some(code));
assert_eq!(error.is_otp_required(), code == 208);
server.await.unwrap();
}
let mut response = success();
response.session.clear();
let (client, server) = mock(200, "", wire::encode(&response)).await;
assert!(matches!(
client.login("e", "p", None, "d").await,
Err(Error::Session(session::SessionError::EmptyToken))
));
server.await.unwrap();
}
#[tokio::test]
async fn remembered_otp_requires_a_device_and_yields_to_an_explicit_code() {
for (device, otp, expected_token) in
[("device", None, "otp-renewal"), ("", None, ""), ("device", Some("123456"), "")]
{
let (client, server) = mock(200, "", wire::encode(&success())).await;
client
.login_with_otp_renewal("mail", "password", otp, device, "otp-renewal")
.await
.unwrap();
let (_, body) = server.await.unwrap();
let request: api::LoginData = wire::decode(&body[6..]).unwrap();
assert_eq!(request.otp_renewal_token, expected_token);
assert_eq!(request.device_id, device);
assert_eq!(request.otp, otp.unwrap_or_default());
assert!(!request.password.is_empty());
assert_ne!(request.password, "password");
}
}
#[tokio::test]
async fn renewal_encodes_exact_tokens_and_rejects_missing_credentials_before_network() {
{
let auth = "auth-secret";
let (client, server) = mock(200, "", wire::encode(&success())).await;
let login = client.login_with_renewal("renewal-secret", auth).await.unwrap();
assert_eq!(login.identity.unwrap_err(), IdentityError::PasswordRequired);
let (headers, body) = server.await.unwrap();
assert!(headers.starts_with("POST /authentication HTTP/1.1"));
assert!(body.starts_with(b"\x15loginWithRenewalToken"));
let request: api::RenewalTokenLogin = wire::decode(&body[22..]).unwrap();
assert_eq!(request.renewal_token, "renewal-secret");
assert_eq!(request.auth_token, auth);
}
let client = Client {
transport: transport::Transport::mock("http://127.0.0.1:1".into(), Duration::from_secs(1)),
};
for (renewal, auth) in [("", "auth"), ("renewal", ""), ("", "")] {
assert!(matches!(
client.login_with_renewal(renewal, auth).await,
Err(Error::MissingRenewalCredentials)
));
}
}
#[tokio::test]
async fn session_validation_and_deletion_have_distinct_success_statuses() {
let token = SessionToken::new("secret").unwrap();
for (logout, code, valid) in [
(false, 102, true),
(false, 103, false),
(false, 104, false),
(false, 204, false),
(true, 204, true),
(true, 102, false),
] {
let (client, server) =
mock(200, "", wire::encode(&api::LoginStatus { error: code, ..Default::default() }))
.await;
let result = if logout {
client.logout(&token).await
} else {
client.validate_session(&token).await
};
assert_eq!(result.is_ok(), valid);
if let Err(error) = result {
assert_eq!(error.is_invalid_session(), code == 103);
}
let (headers, body) = server.await.unwrap();
assert!(headers.starts_with("POST /session HTTP/1.1"));
let prefix: &[u8] = if logout { b"\x0ddeleteSession" } else { b"\x07session" };
assert!(body.starts_with(prefix));
assert_eq!(wire::decode::<api::Session>(&body[prefix.len()..]).unwrap().session, "secret");
}
}
#[tokio::test]
async fn transport_rejects_http_redirects_oversize_and_malformed_data() {
for (status, body) in
[(302, vec![]), (500, vec![]), (200, vec![0; transport::MAX_BODY + 1]), (200, vec![0xff])]
{
let (client, server) = mock(status, "Location: http://127.0.0.1:1/leak\r\n", body).await;
let error = client.login("e", "p", None, "d").await.unwrap_err();
match status {
302 | 500 => assert!(matches!(error, Error::Http(code) if code == status)),
_ => assert!(matches!(error, Error::ResponseTooLarge | Error::Decode(_))),
}
server.await.unwrap();
}
let client = Client {
transport: transport::Transport::mock("http://127.0.0.1:1".into(), Duration::from_secs(1)),
};
assert!(matches!(
client.login("e", &"x".repeat(transport::MAX_BODY), None, "d").await,
Err(Error::RequestTooLarge)
));
assert!(matches!(client.login("e", "p", None, "d").await, Err(Error::Transport(_))));
}
#[tokio::test]
async fn transport_bounds_chunked_responses_and_slow_servers() {
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let client = Client {
transport: transport::Transport::mock(
format!("http://{}", listener.local_addr().unwrap()),
Duration::from_secs(2),
),
};
let server = tokio::spawn(async move {
let (mut stream, _) = listener.accept().await.unwrap();
let mut request = [0; 1024];
let _ = stream.read(&mut request).await;
stream.write_all(b"HTTP/1.1 200 OK\r\nContent-Type: application/ts3cloud\r\nTransfer-Encoding: chunked\r\n\r\n10001\r\n").await.unwrap();
let _ = stream.write_all(&vec![0; transport::MAX_BODY + 1]).await;
let _ = stream.write_all(b"\r\n0\r\n\r\n").await;
});
assert!(matches!(client.login("e", "p", None, "d").await, Err(Error::ResponseTooLarge)));
server.await.unwrap();
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let client = Client {
transport: transport::Transport::mock(
format!("http://{}", listener.local_addr().unwrap()),
Duration::from_millis(25),
),
};
assert!(matches!(client.login("e", "p", None, "d").await, Err(Error::Timeout)));
}
#[tokio::test]
async fn transport_rejects_wrong_content_type_and_encoded_overhead() {
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let client = Client {
transport: transport::Transport::mock(
format!("http://{}", listener.local_addr().unwrap()),
Duration::from_secs(2),
),
};
let server = tokio::spawn(async move {
let (mut stream, _) = listener.accept().await.unwrap();
let mut request = [0; 1024];
let _ = stream.read(&mut request).await;
stream
.write_all(b"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nContent-Length: 0\r\n\r\n")
.await
.unwrap();
});
assert!(matches!(client.login("e", "p", None, "d").await, Err(Error::ContentType)));
server.await.unwrap();
// The method prefix counts towards the request bound too.
assert!(matches!(
client.transport.call("authentication", "login", &vec![0; transport::MAX_BODY - 5]).await,
Err(Error::RequestTooLarge)
));
}
#[tokio::test]
#[ignore = "owner-authorized live account check; explicit credentials and opt-in required"]
async fn owner_live_login_validate_logout() {
assert_eq!(
std::env::var("VOELIN_MYTS_LIVE").as_deref(),
Ok("1"),
"explicit live opt-in required"
);
let email = std::env::var("VOELIN_MYTS_EMAIL").expect("email required");
let password = std::env::var("VOELIN_MYTS_PASSWORD").expect("password required");
let device = std::env::var("VOELIN_MYTS_DEVICE_ID").expect("device ID required");
let otp = std::env::var("VOELIN_MYTS_OTP").ok();
let client = Client::new().unwrap();
let login =
client.login(&email, &password, otp.as_deref(), &device).await.expect("live login failed");
let validation = client.validate_session(&login.token).await;
let logout = client.logout(&login.token).await;
validation.expect("live validation failed");
logout.expect("live logout failed");
}
#[tokio::test]
async fn unsupported_identity_encryption_preserves_successful_account_login() {
let mut response = success();
response.key = vec![1];
response.myts_id_data = Some(api::MyTeamSpeakIdData {
user_public_key: vec![0; 32],
user_private_key: Some(Default::default()),
..Default::default()
});
let (client, server) = mock(200, "", wire::encode(&response)).await;
let login = client.login("mail", "password", None, "device").await.unwrap();
assert_eq!(login.token.as_str(), "session-secret");
assert_eq!(login.identity.unwrap_err(), IdentityError::UnsupportedKeyVersion);
server.await.unwrap();
}
+107
View File
@@ -0,0 +1,107 @@
use crate::Error;
use std::time::Duration;
pub(crate) const MAX_BODY: usize = 64 * 1024;
const TIMEOUT: Duration = Duration::from_secs(20);
const CONTENT_TYPE: &str = "application/ts3cloud";
pub(crate) fn check_input_size(fields: &[&str]) -> Result<(), Error> {
if fields
.iter()
.try_fold(0usize, |sum, field| sum.checked_add(field.len()))
.is_none_or(|size| size > MAX_BODY)
{
return Err(Error::RequestTooLarge);
}
Ok(())
}
#[derive(Clone)]
pub(crate) struct Transport {
client: reqwest::Client,
base: String,
timeout: Duration,
}
impl Transport {
pub(crate) fn new() -> Result<Self, Error> {
Ok(Self {
client: reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.connect_timeout(Duration::from_secs(10))
.timeout(TIMEOUT)
.user_agent("Voelin/0.1")
.build()?,
base: "https://clientapi.myteamspeak.com".into(),
timeout: TIMEOUT,
})
}
#[cfg(test)]
pub(crate) fn mock(base: String, timeout: Duration) -> Self {
Self {
client: reqwest::Client::builder()
.no_proxy()
.redirect(reqwest::redirect::Policy::none())
.build()
.unwrap(),
base,
timeout,
}
}
pub(crate) async fn call(
&self,
service: &str,
method: &str,
body: &[u8],
) -> Result<Vec<u8>, Error> {
// teamprotobufrpc prefixes the protobuf with a single-byte method-name
// length and the method bytes. Both official desktop clients use this
// envelope; HTTP responses contain only the protobuf message.
if method.len() > 127 || body.len() > MAX_BODY - method.len() - 1 {
return Err(Error::RequestTooLarge);
}
let mut request_body = Vec::with_capacity(1 + method.len() + body.len());
request_body.push(method.len() as u8);
request_body.extend_from_slice(method.as_bytes());
request_body.extend_from_slice(body);
tokio::time::timeout(self.timeout, async {
let mut response = self
.client
.post(format!("{}/{service}", self.base))
.header(reqwest::header::CONTENT_TYPE, CONTENT_TYPE)
.body(request_body)
.send()
.await?;
if !response.status().is_success() {
return Err(Error::Http(response.status().as_u16()));
}
if response.content_length().is_some_and(|length| length > MAX_BODY as u64) {
return Err(Error::ResponseTooLarge);
}
// The live service labels binary protobuf replies application/json.
// Accept that observed label; callers still decode and validate protobuf.
if response
.headers()
.get(reqwest::header::CONTENT_TYPE)
.and_then(|value| value.to_str().ok())
.and_then(|value| value.split(';').next())
.is_none_or(|value| {
!value.trim().eq_ignore_ascii_case(CONTENT_TYPE)
&& !value.trim().eq_ignore_ascii_case("application/json")
}) {
return Err(Error::ContentType);
}
let mut bytes = Vec::new();
while let Some(chunk) = response.chunk().await? {
if chunk.len() > MAX_BODY - bytes.len() {
return Err(Error::ResponseTooLarge);
}
bytes.extend_from_slice(&chunk);
}
Ok(bytes)
})
.await
.map_err(|_| Error::Timeout)?
}
}
+1
View File
@@ -49,6 +49,7 @@ tsclientlib = { path = "../proto/tsclientlib" }
# Desktop: the keyring for passwords, stream media with libvpx, OpenH264, X11
# and PipeWire, global hotkeys through the portal and X11.
[target.'cfg(not(target_os = "android"))'.dependencies]
voelin-myts = { path = "../voelin-myts" }
slint = { version = "1.18", features = ["renderer-software"] }
voelin-core = { path = "../voelin-core", default-features = false, features = ["media-desktop"] }
voelin-platform = { path = "../voelin-platform" }
File diff suppressed because it is too large. Load diff
+29 -4
View File
@@ -97,6 +97,9 @@ fn default_secrets() -> Box<dyn Secrets> {
#[cfg(not(target_os = "android"))]
impl Secrets for FallbackSecrets {
fn get(&self, key: &str) -> voelin_store::Result<Option<String>> {
if key.starts_with("myts/") {
return self.keyring.get(key);
}
match self.memory.get(key)? {
Some(v) => Ok(Some(v)),
None => Ok(self.keyring.get(key).unwrap_or(None)),
@@ -104,6 +107,9 @@ impl Secrets for FallbackSecrets {
}
fn set(&self, key: &str, value: &str) -> voelin_store::Result<()> {
if key.starts_with("myts/") {
return self.keyring.set(key, value);
}
if let Err(error) = self.keyring.set(key, value) {
warn!(%error, "keyring unavailable, keeping the secret for this session only");
return self.memory.set(key, value);
@@ -112,6 +118,9 @@ impl Secrets for FallbackSecrets {
}
fn delete(&self, key: &str) -> voelin_store::Result<()> {
if key.starts_with("myts/") {
return self.keyring.delete(key);
}
let _ = self.keyring.delete(key);
self.memory.delete(key)
}
@@ -407,6 +416,10 @@ impl Models {
}
pub(crate) struct App {
#[cfg(not(target_os = "android"))]
pub runtime: tokio::runtime::Handle,
#[cfg(not(target_os = "android"))]
pub myts: crate::myts::Account,
pub ui: slint::Weak<MainWindow>,
pub store: Store,
pub secrets: Box<dyn Secrets>,
@@ -646,6 +659,10 @@ pub fn run(options: RunOptions) -> Result<()> {
let mut video = Video::new(&dir, settings.openh264);
video.set_decoder_preference(decoder_preference(&prefs));
let app = App {
#[cfg(not(target_os = "android"))]
runtime: runtime.clone(),
#[cfg(not(target_os = "android"))]
myts: Default::default(),
ui: ui.as_weak(),
store,
secrets: options.secrets.unwrap_or_else(default_secrets),
@@ -701,6 +718,8 @@ pub fn run(options: RunOptions) -> Result<()> {
app.refresh_home();
app.refresh_notices();
app.refresh_pages();
#[cfg(not(target_os = "android"))]
app.start_myts();
if app.demo {
app.start_demo();
}
@@ -760,16 +779,22 @@ pub fn run(options: RunOptions) -> Result<()> {
/// Open a file or folder with the desktop's default application.
pub(crate) fn open_path(path: &Path) -> std::io::Result<()> {
let mut child = desktop_opener(path.as_os_str()).spawn()?;
// Reap it without blocking the UI.
std::thread::spawn(move || child.wait());
Ok(())
}
/// Build an argument-based desktop opener; never pass a target through a shell.
pub(crate) fn desktop_opener(target: &std::ffi::OsStr) -> std::process::Command {
#[cfg(windows)]
let mut command = std::process::Command::new("explorer");
#[cfg(target_os = "macos")]
let mut command = std::process::Command::new("open");
#[cfg(not(any(windows, target_os = "macos")))]
let mut command = std::process::Command::new("xdg-open");
let mut child = command.arg(path).spawn()?;
// Reap it without blocking the UI.
std::thread::spawn(move || child.wait());
Ok(())
command.arg(target);
command
}
pub(crate) fn model<T: Clone + 'static>(items: Vec<T>) -> ModelRc<T> {
+20
View File
@@ -6,6 +6,26 @@ use crate::app::{Bridge, MainWindow, with_app};
pub(super) fn wire(ui: &MainWindow) {
let bridge = ui.global::<Bridge>();
#[cfg(not(target_os = "android"))]
{
bridge.on_myts_login(|email, password, otp| {
with_app(|app| {
app.myts_login(email.to_string(), password.to_string(), otp.to_string())
});
});
bridge.on_myts_logout(|| {
with_app(|app| app.myts_logout());
});
bridge.on_myts_dismiss(|| {
with_app(|app| app.myts_dismiss());
});
bridge.on_myts_retry(|| {
with_app(|app| app.myts_retry());
});
bridge.on_myts_portal(|action| {
with_app(|app| app.myts_portal(action));
});
}
bridge.on_open_settings(|| {
with_app(|app| app.open_settings());
});
+25
View File
@@ -168,6 +168,31 @@ pub(crate) fn start(ui: &MainWindow, switches: &Switches) -> Running {
for open in &switches.open {
let (what, arg) = open.split_once(':').unwrap_or((open.as_str(), ""));
match what {
"login" if switches.demo_ui => {
let bridge = ui.global::<Bridge>();
let mut account = bridge.get_myts();
account.available = true;
account.prompt = arg != "account";
if arg == "account" {
account.signed_in = true;
account.username = "Alex Example".into();
account.email = "alex@example.test".into();
account.uuid = "00000000-0000-0000-0000-000000000001".into();
account.myts_id = "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB".into();
account.identity_status = 1;
nav.invoke_open_settings(SettingsSection::Account);
}
account.otp_required = arg == "otp";
account.can_forget = arg == "saved" || arg == "account";
account.status = if arg == "otp" {
3
} else if arg == "saved" {
2
} else {
0
};
bridge.set_myts(account);
}
"home" => nav.invoke_show(Page::Home),
"server" => nav.invoke_show(Page::Server),
"settings" => nav.invoke_open_settings(section(arg)),
+2
View File
@@ -15,6 +15,8 @@ mod images;
mod inbox;
mod members;
mod messages;
#[cfg(not(target_os = "android"))]
mod myts;
mod previews;
mod servers;
mod settings;
+710
View File
@@ -0,0 +1,710 @@
//! Desktop account state. Only the UI thread mutates state or persists credentials.
use serde::{Deserialize, Serialize};
use slint::ComponentHandle;
use std::sync::Arc;
use voelin_myts::{Client, Login, ServerIdentity, SessionToken};
use voelin_store::Secrets;
use crate::app::{App, Bridge, MytsForm, later};
// One keyring item makes session replacement atomic: a failed write cannot
// combine a new session with another account's renewal material.
const KEY: &str = "myts/session";
#[derive(Default, Serialize, Deserialize)]
struct Saved {
session: String,
email: String,
username: String,
#[serde(default)]
uuid: String,
renewal_token: String,
device_id: String,
#[serde(default)]
otp_token: String,
// Private account identity belongs in the same secret-store transaction.
#[serde(default)]
identity: Option<ServerIdentity>,
}
#[derive(Default)]
pub(crate) struct Account {
saved: Option<Saved>,
signed_in: bool,
busy: bool,
otp_required: bool,
status: i32,
persistence_status: i32,
generation: u64,
started: bool,
prompt: bool,
// Also set after a failed read/delete so the user can retry clearing.
can_forget: bool,
identity_failed: bool,
}
impl Account {
fn load(&mut self, secrets: &dyn Secrets) {
match read_saved(secrets) {
Ok(saved) => {
self.saved = saved;
self.can_forget = false;
self.status = 0;
self.persistence_status = 0;
self.identity_failed = false;
}
Err(()) => {
self.can_forget = true;
self.persistence_status = 1;
}
}
}
fn restored(&mut self) {
self.signed_in = true;
self.prompt = false;
self.otp_required = false;
}
fn device_for(&self, email: &str) -> (String, String) {
self.saved
.as_ref()
.filter(|s| s.email.eq_ignore_ascii_case(email.trim()))
.map(|s| (s.device_id.clone(), s.otp_token.clone()))
.unwrap_or_default()
}
fn accept(&mut self, secrets: &dyn Secrets, login: Login, email: String) {
self.identity_failed = login.identity.is_err();
let (renewal_token, device_id, otp_token) = login
.renewal
.map(|renewal| (renewal.token, renewal.device_id, renewal.otp_token))
.unwrap_or_default();
let saved = Saved {
session: login.token.into_inner(),
email,
username: login.username,
uuid: login.uuid,
renewal_token,
device_id,
otp_token,
identity: login.identity.ok(),
};
self.persistence_status = if save(secrets, &saved) {
0
} else {
// Remove an older credential after a replacement failed. Do not
// silently sign back into the previous account on next startup.
let cleared = secrets.delete(KEY).is_ok();
if cleared { 5 } else { 6 }
};
self.status = 0;
self.saved = Some(saved);
self.restored();
}
fn revocation_failed(&mut self, generation: u64) {
if self.generation == generation && !self.signed_in && !self.busy && !self.can_forget {
self.status = 9;
}
}
fn form(&self) -> MytsForm {
let identity = self.identity();
MytsForm {
available: true,
prompt: self.prompt,
signed_in: self.signed_in,
email: self.saved.as_ref().map(|s| s.email.as_str()).unwrap_or_default().into(),
username: self.saved.as_ref().map(|s| s.username.as_str()).unwrap_or_default().into(),
uuid: self.saved.as_ref().map(|s| s.uuid.as_str()).unwrap_or_default().into(),
myts_id: identity.map(ServerIdentity::id).unwrap_or_default().into(),
identity_status: if !self.signed_in {
0
} else if identity.is_some() {
1
} else if self.identity_failed {
3
} else {
2
},
status: self.status,
persistence_status: self.persistence_status,
busy: self.busy,
otp_required: self.otp_required,
can_forget: self.can_forget || self.saved.is_some(),
}
}
fn identity(&self) -> Option<&ServerIdentity> {
self.saved.as_ref().filter(|_| self.signed_in).and_then(|s| s.identity.as_ref())
}
fn begin(&mut self) -> Option<u64> {
if self.busy {
return None;
}
self.generation += 1;
self.busy = true;
self.status = 0;
Some(self.generation)
}
fn finish(&mut self, generation: u64) -> bool {
if self.generation != generation {
return false;
}
self.busy = false;
true
}
fn forget(&mut self, secrets: &dyn Secrets) -> bool {
self.generation += 1;
self.busy = false;
self.signed_in = false;
self.prompt = true;
self.saved = None;
self.identity_failed = false;
self.otp_required = false;
let cleared = secrets.delete(KEY).is_ok();
self.persistence_status = if cleared { 0 } else { 8 };
self.can_forget = !cleared;
cleared
}
}
fn login_error_status(error: &voelin_myts::Error) -> i32 {
match error.status_code() {
Some(208) => 3,
Some(209) => 14,
Some(203) => 13,
Some(202) => 16,
Some(103 | 206 | 207) => 15,
_ if matches!(error, voelin_myts::Error::Http(429)) => 17,
_ => 4,
}
}
// Fixed official routes only. Neither the session nor an email goes in a URL.
fn portal_url(action: i32) -> Option<&'static str> {
match action {
0 => Some("https://www.myteamspeak.com/register"),
1 => Some("https://www.myteamspeak.com/forgot-password"),
2 => Some("https://www.myteamspeak.com/my-account"),
3 => Some("https://www.myteamspeak.com/resend-activation"),
4 => Some("https://www.myteamspeak.com/my-account/change-username"),
5 => Some("https://www.myteamspeak.com/my-account/change-email"),
6 => Some("https://www.myteamspeak.com/my-account/change-password"),
7 => Some("https://www.myteamspeak.com/my-account/change-2fa"),
8 => Some("https://www.myteamspeak.com/my-account/manage-account"),
9 => Some("https://www.myteamspeak.com/my-account/manage-data"),
_ => None,
}
}
fn read_saved(secrets: &dyn Secrets) -> Result<Option<Saved>, ()> {
secrets
.get(KEY)
.map_err(|_| ())?
.map(|value| {
let saved: Saved = serde_json::from_str(&value).map_err(|_| ())?;
SessionToken::new(saved.session.clone()).map_err(|_| ())?;
Ok(saved)
})
.transpose()
}
fn save(secrets: &dyn Secrets, saved: &Saved) -> bool {
serde_json::to_string(saved).ok().is_some_and(|value| secrets.set(KEY, &value).is_ok())
}
impl App {
fn publish_myts_identity(&self) {
self.engine.send(voelin_core::Command::SetMytsIdentity(
self.myts.identity().cloned().map(Arc::new),
));
}
pub(crate) fn refresh_myts(&self) {
let Some(ui) = self.ui.upgrade() else {
return;
};
ui.global::<Bridge>().set_myts(self.myts.form());
}
pub(crate) fn start_myts(&mut self) {
if self.myts.started {
return;
}
self.myts.started = true;
if self.demo_ui {
self.refresh_myts();
return;
}
self.myts.prompt = true;
self.myts_retry();
}
pub(crate) fn myts_dismiss(&mut self) {
self.myts.prompt = false;
self.refresh_myts();
}
pub(crate) fn myts_portal(&mut self, action: i32) {
let Some(url) = portal_url(action).filter(|_| !self.myts.busy) else {
return;
};
let generation = self.myts.generation;
self.runtime.spawn(async move {
let opened = tokio::task::spawn_blocking(move || {
crate::app::desktop_opener(std::ffi::OsStr::new(url))
.status()
.is_ok_and(|status| status.success())
})
.await
.unwrap_or(false);
later(move |app| {
if app.myts.generation == generation && !app.myts.busy {
app.myts.status = if opened { 11 } else { 10 };
app.refresh_myts();
}
});
});
}
pub(crate) fn myts_retry(&mut self) {
if self.demo_ui || self.myts.busy {
return;
}
if self.myts.saved.is_none() {
self.myts.load(self.secrets.as_ref());
}
let Some(saved) = self.myts.saved.as_ref() else {
self.refresh_myts();
return;
};
let token = SessionToken::new(saved.session.clone()).expect("validated stored token");
let generation = self.myts.begin().expect("startup is idle");
self.refresh_myts();
self.runtime.spawn(async move {
// Password login does not provide the separate auth token required
// by loginWithRenewalToken. Expiry requires a fresh password login.
let result = async { Client::new()?.validate_session(&token).await }.await;
later(move |app| {
if !app.myts.finish(generation) {
return;
}
let was_signed_in = app.myts.signed_in;
match result {
Ok(()) => app.myts.restored(),
Err(error) => {
app.myts.otp_required =
error.is_otp_required() || error.status_code() == Some(209);
app.myts.status = 2;
if error.is_invalid_session() {
app.myts.signed_in = false;
app.myts.status = 15;
}
}
}
if was_signed_in != app.myts.signed_in {
app.publish_myts_identity();
}
app.refresh_myts();
});
});
}
pub(crate) fn myts_login(&mut self, email: String, password: String, otp: String) {
if email.trim().is_empty() || password.is_empty() || self.myts.signed_in {
return;
}
let (device, otp_renewal) = self.myts.device_for(&email);
let Some(generation) = self.myts.begin() else {
return;
};
self.refresh_myts();
self.runtime.spawn(async move {
let result = async {
Client::new()?
.login_with_otp_renewal(
email.trim(),
&password,
(!otp.is_empty()).then_some(otp.as_str()),
&device,
&otp_renewal,
)
.await
}
.await;
later(move |app| {
if !app.myts.finish(generation) {
app.discard_myts_login(result.ok());
return;
}
match result {
Ok(login) => {
app.myts.accept(app.secrets.as_ref(), login, email.trim().to_owned());
app.publish_myts_identity();
}
Err(error) => {
app.myts.otp_required =
error.is_otp_required() || error.status_code() == Some(209);
app.myts.status = login_error_status(&error);
}
}
app.refresh_myts();
});
});
}
// A canceled login can still have created a remote session. Revoke it,
// never publish or save it after a sign-out/replacement.
fn discard_myts_login(&self, login: Option<Login>) {
if let Some(login) = login {
let generation =
(!self.myts.busy && !self.myts.signed_in).then_some(self.myts.generation);
self.runtime.spawn(async move {
let result = async { Client::new()?.logout(&login.token).await }.await;
if result.is_err() {
// Static diagnostic: no credential, account, response body or URL.
tracing::warn!("canceled account sign-in session could not be revoked");
later(move |app| {
if let Some(generation) = generation {
app.myts.revocation_failed(generation);
}
app.refresh_myts();
});
}
});
}
}
pub(crate) fn myts_logout(&mut self) {
let token =
self.myts.saved.as_ref().and_then(|s| SessionToken::new(s.session.clone()).ok());
let cleared = self.myts.forget(self.secrets.as_ref());
self.publish_myts_identity();
self.myts.status = if cleared { 7 } else { 0 };
if let Some(token) = token {
let generation = self.myts.generation;
self.myts.busy = true;
self.runtime.spawn(async move {
let result = async { Client::new()?.logout(&token).await }.await;
later(move |app| {
if !app.myts.finish(generation) {
return;
}
if result.is_err() && cleared {
app.myts.status = 9;
}
app.refresh_myts();
});
});
}
self.refresh_myts();
}
}
#[cfg(test)]
mod tests {
use super::*;
use voelin_store::MemorySecrets;
fn login(name: &str) -> Login {
Login {
token: SessionToken::new(format!("{name}-session")).unwrap(),
uuid: format!("{name}-uuid"),
username: name.into(),
identity: Ok(server_identity()),
renewal: Some(voelin_myts::Renewal {
token: format!("{name}-renewal"),
otp_token: format!("{name}-otp"),
device_id: format!("{name}-device"),
}),
}
}
fn server_identity() -> ServerIdentity {
let mut private = [0; 32];
private[0] = 1;
let mut public = [0x66; 32];
public[0] = 0x58; // Compressed Ed25519 basepoint for scalar one.
ServerIdentity::new(vec![1; 33], 1, public, private, vec![2; 65]).unwrap()
}
#[test]
fn primary_account_persists_restores_after_validation_and_signout_returns_to_login() {
let secrets = MemorySecrets::default();
let mut account = Account { prompt: true, ..Default::default() };
account.load(&secrets);
assert!(account.form().prompt);
assert!(!account.form().signed_in);
account.accept(&secrets, login("Alice"), "alice@example.test".into());
assert!(!account.form().prompt);
assert!(account.form().signed_in);
assert_eq!(account.form().identity_status, 1);
assert!(account.identity().is_some());
assert_eq!(account.form().uuid, "Alice-uuid");
let mut restarted = Account { prompt: true, ..Default::default() };
restarted.load(&secrets);
assert!(restarted.identity().is_none(), "unvalidated cache cannot authenticate servers");
assert!(!restarted.form().signed_in, "cached profile is not validated yet");
let generation = restarted.begin().unwrap();
assert!(restarted.finish(generation));
restarted.restored();
assert!(restarted.identity().is_some());
assert!(!restarted.form().prompt);
assert_eq!(restarted.form().username, "Alice");
assert!(restarted.forget(&secrets));
assert!(restarted.form().prompt);
assert_eq!(restarted.form().username, "");
assert_eq!(restarted.form().uuid, "");
assert!(!restarted.form().signed_in);
assert!(restarted.identity().is_none());
assert_eq!(restarted.form().myts_id, "");
}
#[test]
fn switching_primary_account_never_reuses_another_accounts_device_material() {
let secrets = MemorySecrets::default();
let mut account = Account::default();
account.accept(&secrets, login("Alice"), "alice@example.test".into());
assert_eq!(
account.device_for(" ALICE@example.test "),
("Alice-device".into(), "Alice-otp".into())
);
assert_eq!(account.device_for("bob@example.test"), Default::default());
account.forget(&secrets);
assert_eq!(account.device_for("alice@example.test"), Default::default());
let mut bob = login("Bob");
bob.renewal = None;
account.accept(&secrets, bob, "bob@example.test".into());
let saved = read_saved(&secrets).unwrap().unwrap();
assert_eq!(saved.uuid, "Bob-uuid");
assert_eq!(saved.email, "bob@example.test");
assert!(saved.renewal_token.is_empty());
assert!(saved.otp_token.is_empty());
assert!(saved.device_id.is_empty());
}
#[test]
fn missing_server_key_keeps_login_but_never_reuses_previous_identity() {
let secrets = MemorySecrets::default();
let mut account = Account::default();
account.accept(&secrets, login("Alice"), "alice@example.test".into());
assert!(account.identity().is_some());
account.forget(&secrets);
let mut bob = login("Bob");
bob.identity = Err(voelin_myts::IdentityError::Missing);
account.accept(&secrets, bob, "bob@example.test".into());
assert!(account.signed_in);
assert!(account.identity().is_none());
assert_eq!(account.form().identity_status, 3);
assert!(account.form().myts_id.is_empty());
assert!(read_saved(&secrets).unwrap().unwrap().identity.is_none());
}
#[test]
fn corrupted_persisted_private_identity_cannot_be_restored() {
let secrets = MemorySecrets::default();
let mut account = Account::default();
account.accept(&secrets, login("Alice"), "alice@example.test".into());
let mut value: serde_json::Value =
serde_json::from_str(&secrets.get(KEY).unwrap().unwrap()).unwrap();
value["identity"]["private_key"] = serde_json::json!(vec![0u8; 32]);
secrets.set(KEY, &value.to_string()).unwrap();
assert!(read_saved(&secrets).is_err());
let mut restored = Account::default();
restored.load(&secrets);
assert!(restored.identity().is_none());
assert_eq!(restored.form().persistence_status, 1);
}
#[test]
fn keyring_retry_and_legacy_bundle_do_not_claim_a_validated_account() {
let secrets = MemorySecrets::default();
secrets.set(KEY, r#"{"session":"legacy","email":"a@example.test","username":"A","renewal_token":"r","device_id":"d"}"#).unwrap();
let mut account = Account { prompt: true, ..Default::default() };
account.load(&Unavailable);
assert_eq!(account.form().persistence_status, 1);
account.load(&secrets);
assert_eq!(account.status, 0);
assert_eq!(account.form().persistence_status, 0);
assert!(!account.can_forget);
assert!(!account.signed_in);
assert!(account.prompt);
assert_eq!(account.form().uuid, "");
account.restored();
assert_eq!(account.form().identity_status, 2);
assert!(account.identity().is_none());
assert_eq!(account.saved.unwrap().otp_token, "");
}
#[test]
fn login_survives_keyring_failure_with_visible_session_only_status() {
let mut account = Account { prompt: true, ..Default::default() };
account.accept(&Unavailable, login("Alice"), "alice@example.test".into());
assert!(account.signed_in);
assert!(!account.prompt);
assert_eq!(account.form().persistence_status, 6);
assert!(account.form().can_forget);
assert_eq!(account.form().username, "Alice");
let generation = account.begin().unwrap();
assert!(account.finish(generation));
account.restored();
assert_eq!(
account.form().persistence_status,
6,
"validation must not hide failed persistence"
);
account.status = 11;
assert_eq!(
account.form().persistence_status,
6,
"opening management must retain the warning"
);
account.forget(&Unavailable);
account.status = 11;
assert_eq!(
account.form().persistence_status,
8,
"failed deletion must remain visible after browser launch"
);
account.forget(&MemorySecrets::default());
assert_eq!(account.form().persistence_status, 0);
}
#[test]
fn portal_actions_are_fixed_official_https_destinations() {
for action in 0..10 {
let url = portal_url(action).unwrap();
assert!(url.starts_with("https://www.myteamspeak.com/"));
assert!(!url.contains(['?', '#', '@']));
}
assert!(portal_url(-1).is_none());
assert!(portal_url(10).is_none());
assert_eq!(portal_url(1), Some("https://www.myteamspeak.com/forgot-password"));
assert_eq!(login_error_status(&voelin_myts::Error::Http(429)), 17);
assert_eq!(login_error_status(&voelin_myts::Error::Timeout), 4);
}
#[test]
fn failed_late_session_revocation_reports_signed_out_without_overwriting_new_login() {
let mut account = Account::default();
let old = account.begin().unwrap();
account.forget(&MemorySecrets::default());
assert!(!account.finish(old));
let signed_out = account.generation;
account.revocation_failed(signed_out);
assert_eq!(account.status, 9);
let new = account.begin().unwrap();
account.revocation_failed(signed_out);
account.revocation_failed(new);
assert_eq!(account.status, 0);
assert!(account.busy);
account.finish(new);
account.signed_in = true;
account.revocation_failed(new);
assert_eq!(account.status, 0);
}
#[test]
fn form_exposes_signed_out_busy_otp_and_signed_in_states_without_tokens() {
let mut account = Account::default();
assert!(account.form().available);
assert!(!account.form().signed_in);
assert!(!account.form().can_forget);
let generation = account.begin().unwrap();
assert!(account.form().busy);
account.finish(generation);
account.otp_required = true;
account.status = 3;
assert!(account.form().otp_required);
assert_eq!(account.form().status, 3);
account.saved = Some(Saved {
session: "secret session".into(),
email: "a@example.test".into(),
username: "Name".into(),
..Default::default()
});
account.signed_in = true;
account.otp_required = false;
let form = account.form();
assert!(form.signed_in);
assert!(form.can_forget);
assert_eq!(form.username, "Name");
assert_eq!(form.email, "a@example.test");
assert!(!form.otp_required);
}
#[test]
fn persistence_roundtrip_and_logout_delete_all_material() {
let secrets = MemorySecrets::default();
let saved = Saved {
session: "session".into(),
email: "email".into(),
renewal_token: "renewal".into(),
device_id: "device".into(),
username: "name".into(),
otp_token: "otp renewal".into(),
uuid: "account-uuid".into(),
identity: Some(server_identity()),
};
assert!(save(&secrets, &saved));
let loaded = read_saved(&secrets).unwrap().unwrap();
assert_eq!(loaded.session, "session");
assert_eq!(loaded.renewal_token, "renewal");
assert_eq!(loaded.email, "email");
assert_eq!(loaded.identity.unwrap().id(), server_identity().id());
let loaded = read_saved(&secrets).unwrap().unwrap();
let mut account = Account { saved: Some(loaded), signed_in: true, ..Default::default() };
assert!(account.forget(&secrets));
assert!(read_saved(&secrets).unwrap().is_none());
assert!(!account.signed_in);
}
#[test]
fn single_operation_and_logout_prevent_stale_resurrection() {
let mut account = Account::default();
let generation = account.begin().unwrap();
assert!(account.begin().is_none());
account.forget(&MemorySecrets::default());
assert!(!account.finish(generation));
let replacement = account.begin().unwrap();
assert!(!account.finish(generation));
assert!(account.busy);
assert!(account.finish(replacement));
}
struct Unavailable;
impl Secrets for Unavailable {
fn get(&self, _: &str) -> voelin_store::Result<Option<String>> {
Err(voelin_store::Error::Secrets("locked".into()))
}
fn set(&self, _: &str, _: &str) -> voelin_store::Result<()> {
Err(voelin_store::Error::Secrets("locked".into()))
}
fn delete(&self, _: &str) -> voelin_store::Result<()> {
Err(voelin_store::Error::Secrets("locked".into()))
}
}
#[test]
fn keyring_failure_is_visible_and_logout_still_clears_memory() {
assert!(read_saved(&Unavailable).is_err());
assert!(!save(&Unavailable, &Saved::default()));
let mut account =
Account { saved: Some(Saved::default()), signed_in: true, ..Default::default() };
assert!(!account.forget(&Unavailable));
assert!(account.saved.is_none());
assert!(!account.signed_in);
assert!(account.can_forget);
}
#[test]
fn malformed_or_empty_session_is_not_used() {
let secrets = MemorySecrets::default();
secrets.set(KEY, "broken").unwrap();
assert!(read_saved(&secrets).is_err());
assert!(save(&secrets, &Saved::default()));
assert!(read_saved(&secrets).is_err());
}
}
+9
View File
@@ -120,6 +120,15 @@ impl App {
return;
}
let mut options = VoiceOptions::new(&b.address, &b.nickname);
if let Some(spec) = &b.client_version {
match voelin_core::versions::resolve(spec) {
Ok(version) => options.client_version = version,
Err(error) => {
self.set_status(format!("Invalid client compatibility version: {error}"));
return;
}
}
}
options.identity = Some(self.identity_for(Some(b.id)));
options.server_password = self.secrets.get(&b.server_password_key()).ok().flatten();
options.channel = channel;
+20 -16
View File
@@ -9,6 +9,7 @@ import "assets/fonts/Inter-Bold.ttf";
import "assets/fonts/Inter-Italic.ttf";
import { Palette } from "std-widgets.slint";
import { LoginPage } from "screens/account.slint";
import { Theme } from "theme.slint";
import { Icons } from "icons.slint";
import { Bridge } from "bridge.slint";
@@ -112,7 +113,7 @@ export component MainWindow inherits Window {
keys := FocusScope {
// Ctrl+K: search.
capture-key-pressed(event) => {
if event.modifiers.control && (event.text == "k" || event.text == "K") && root.chrome {
if event.modifiers.control && (event.text == "k" || event.text == "K") && root.chrome && !Bridge.myts.prompt {
Nav.open-search("");
return accept;
}
@@ -125,9 +126,11 @@ export component MainWindow inherits Window {
padding-right: root.safe-area-insets.right;
padding-bottom: max(root.safe-area-insets.bottom, root.keyboard-inset);
if !root.chrome: StreamViewer { }
if Bridge.myts.prompt: LoginPage { }
if !Nav.narrow && root.chrome: DesktopShell {
if !Bridge.myts.prompt && !root.chrome: StreamViewer { }
if !Bridge.myts.prompt && !Nav.narrow && root.chrome: DesktopShell {
context: Nav.page == Page.settings ? @tr("Settings") : Nav.page == Page.studio ? @tr("Stream Studio") : "";
if Nav.page == Page.home: Sidebar {
HomeNav { }
@@ -213,7 +216,7 @@ export component MainWindow inherits Window {
}
}
if Nav.narrow && root.chrome: MobileShell {
if !Bridge.myts.prompt && Nav.narrow && root.chrome: MobileShell {
property <bool> channel-chat: Nav.page == Page.server && !Nav.phone-voice
&& Nav.mobile-tab == MobileTab.chat && !Bridge.viewer-open
&& Bridge.current-tab >= 0 && Bridge.current-tab < Bridge.tabs.length
@@ -288,11 +291,12 @@ export component MainWindow inherits Window {
x: (parent.width - self.width) / 2;
y: parent.height - self.height - (Nav.narrow ? 140px : 96px);
text: Bridge.status-text;
visible: self.shown && !Bridge.myts.prompt;
widest: min(560px, parent.width - 32px);
}
// The member card of the members panel, over everything.
if Bridge.member-card.open: Rectangle {
if !Bridge.myts.prompt && (Bridge.member-card.open): Rectangle {
TouchArea {
clicked => { Bridge.open-member(-1); }
}
@@ -302,7 +306,7 @@ export component MainWindow inherits Window {
}
}
if Nav.emoji-open: Rectangle {
if !Bridge.myts.prompt && (Nav.emoji-open): Rectangle {
// Clicks outside the picker close it.
TouchArea {
clicked => { Nav.emoji-open = false; }
@@ -328,7 +332,7 @@ export component MainWindow inherits Window {
}
// The bell's panel, under the bell (the phone: the whole width).
if Nav.notifications-open: Rectangle {
if !Bridge.myts.prompt && (Nav.notifications-open): Rectangle {
TouchArea {
clicked => { Nav.notifications-open = false; }
}
@@ -340,39 +344,39 @@ export component MainWindow inherits Window {
}
}
if Nav.search-open: SearchPalette { }
if !Bridge.myts.prompt && (Nav.search-open): SearchPalette { }
if Nav.lightbox-open: Lightbox { }
if !Bridge.myts.prompt && (Nav.lightbox-open): Lightbox { }
if Nav.event-form-open: EventDialog {
if !Bridge.myts.prompt && (Nav.event-form-open): EventDialog {
form <=> Nav.event-form;
done => { Nav.event-form-open = false; }
}
if Nav.offline-form-open: OfflineDialog {
if !Bridge.myts.prompt && (Nav.offline-form-open): OfflineDialog {
done => { Nav.offline-form-open = false; }
}
if Nav.topic-form-open: TopicDialog {
if !Bridge.myts.prompt && (Nav.topic-form-open): TopicDialog {
done => { Nav.topic-form-open = false; }
}
if Nav.bookmark-open: BookmarkDialog {
if !Bridge.myts.prompt && (Nav.bookmark-open): BookmarkDialog {
form <=> Nav.bookmark-form;
join: Nav.join-open;
done => { Nav.bookmark-open = false; }
}
if Nav.share-open: ShareDialog {
if !Bridge.myts.prompt && (Nav.share-open): ShareDialog {
form <=> Nav.share-form;
done => { Nav.share-open = false; }
}
if Nav.client-open: ClientAudioDialog {
if !Bridge.myts.prompt && (Nav.client-open): ClientAudioDialog {
done => { Nav.client-open = false; }
}
if Nav.about-open: AboutDialog {
if !Bridge.myts.prompt && (Nav.about-open): AboutDialog {
done => { Nav.about-open = false; }
}
}
+23
View File
@@ -767,6 +767,22 @@ export struct AdvancedForm {
}
// Who we are (My Account page).
export struct MytsForm {
prompt: bool,
uuid: string,
myts-id: string,
identity-status: int,
available: bool,
signed_in: bool,
email: string,
username: string,
status: int,
persistence-status: int,
busy: bool,
otp_required: bool,
can_forget: bool,
}
export struct AccountForm {
nickname: string,
identity: string,
@@ -1092,6 +1108,13 @@ export global Bridge {
// Settings pages: a section was shown (its data is loaded then).
callback settings-section(int);
in property <AccountForm> account;
in property <MytsForm> myts;
in property <string> primary-name: myts.signed-in ? (myts.username != "" ? myts.username : myts.email) : nickname != "" ? nickname : app-name;
callback myts-dismiss();
callback myts-retry();
callback myts-portal(int);
callback myts-login(string, string, string);
callback myts-logout();
in property <[IdentityItem]> identities;
in property <[string]> identity-names;
in property <[BookmarkIdentity]> bookmark-identities;
+204
View File
@@ -0,0 +1,204 @@
// Shared account form for first launch and Settings → My Account.
import { Theme } from "../theme.slint";
import { Icons } from "../icons.slint";
import { Bridge } from "../bridge.slint";
import { Button, TextField, Field, Card, ScrollView } from "../components/index.slint";
component Note inherits Text {
// Keep wrapped account copy in the card’s layout bounds.
min-height: self.preferred-height;
color: Theme.text-secondary;
font-size: Theme.font-sm;
wrap: word-wrap;
}
component LoginForm inherits VerticalLayout {
spacing: Theme.space-3;
property <string> otp-text;
function submit() {
if !Bridge.myts.busy && email.text != "" && password.text != "" && (!Bridge.myts.otp-required || otp-text != "") {
Bridge.myts-login(email.text, password.text, otp-text);
password.clear();
otp-text = "";
}
}
Field {
label: @tr("Email");
email := TextField {
text: Bridge.myts.email;
placeholder: @tr("Email");
enabled: !Bridge.myts.busy;
accepted(_) => { root.submit(); }
}
}
Field {
label: @tr("Password");
password := TextField {
placeholder: @tr("Password");
input-type: InputType.password;
enabled: !Bridge.myts.busy;
accepted(_) => { root.submit(); }
}
}
if Bridge.myts.otp-required: Field {
label: @tr("One-time code");
TextField {
text <=> root.otp-text;
placeholder: @tr("One-time code");
input-type: InputType.password;
enabled: !Bridge.myts.busy;
accepted(_) => { root.submit(); }
}
}
Button {
text: @tr("Sign in");
enabled: !Bridge.myts.busy && email.text != "" && password.text != "" && (!Bridge.myts.otp-required || root.otp-text != "");
clicked => { root.submit(); }
}
Button {
text: @tr("Create account in browser");
enabled: !Bridge.myts.busy;
clicked => { Bridge.myts-portal(0); }
}
Button {
text: @tr("Forgot password?");
enabled: !Bridge.myts.busy;
clicked => { Bridge.myts-portal(1); }
}
Note { text: @tr("Registration and password recovery open the official myTeamSpeak website. Return here to sign in when finished."); }
}
export component AccountCard inherits Card {
title: @tr("myTeamSpeak");
icon: Icons.user;
property <string> account-status: Bridge.myts.status == 2 ? @tr("Saved session could not be validated. Your saved credentials were retained; sign in again or clear them.") :
Bridge.myts.status == 3 ? @tr("Enter your password again and the one-time code.") :
Bridge.myts.status == 4 ? @tr("Sign-in failed. Check your credentials and connection; the experimental service may be unavailable.") :
Bridge.myts.status == 7 ? @tr("Signed out.") :
Bridge.myts.status == 9 ? @tr("Signed out and saved credentials cleared. Remote session revocation failed.") :
Bridge.myts.status == 10 ? @tr("Could not open your browser. Visit myteamspeak.com to manage your account.") :
Bridge.myts.status == 11 ? @tr("Account website opened in your browser. When finished, return here and sign in again to apply changes.") :
Bridge.myts.status == 13 ? @tr("Your email address has not been verified. Activate your account using the link in your email, or request a new activation email.") :
Bridge.myts.status == 14 ? @tr("The one-time code was not accepted. Enter your password and a new code.") :
Bridge.myts.status == 15 ? @tr("Your saved session has expired. Sign in again.") :
Bridge.myts.status == 16 ? @tr("Email or password was not accepted. Check your details and try again.") :
Bridge.myts.status == 17 ? @tr("Too many requests. Wait a while before trying again.") : "";
if !Bridge.myts.available: Note { text: @tr("Account sign-in is available on desktop."); }
if Bridge.myts.available && !Bridge.myts.signed-in: LoginForm { }
if Bridge.myts.signed-in: VerticalLayout {
spacing: Theme.space-3;
Note { text: @tr("Primary account"); }
Text {
text: Bridge.primary-name;
color: Theme.text;
font-size: Theme.font-lg;
font-weight: Theme.weight-semibold;
wrap: word-wrap;
}
Note { text: Bridge.myts.email; }
if Bridge.myts.uuid != "": Field {
label: @tr("Account ID");
TextField {
text: Bridge.myts.uuid;
read-only: true;
label: @tr("Account ID");
}
}
if Bridge.myts.myts-id != "": Field {
label: @tr("myTS ID");
TextField {
text: Bridge.myts.myts-id;
read-only: true;
label: @tr("myTS ID");
}
}
if Bridge.myts.identity-status == 1: Note {
text: @tr("Your account identity is available for authentication on voice servers.");
}
if Bridge.myts.identity-status == 2: Note {
text: @tr("Sign out and sign in with your password to enable your myTS ID on voice servers.");
}
if Bridge.myts.identity-status == 3: Note {
text: @tr("Signed in, but the account identity could not be unlocked. Voice servers will not receive your myTS ID. Try signing in again; older account encryption may be unsupported.");
}
Note { text: @tr("This is your main app profile. Server identities and server nicknames are managed separately."); }
Note { text: @tr("Account management opens the official website. Check which account is signed in there. Sign in again here after making changes."); }
Button {
text: @tr("Manage account in browser");
enabled: !Bridge.myts.busy;
clicked => { Bridge.myts-portal(2); }
}
for action in [
{ text: @tr("Change username"), portal: 4 },
{ text: @tr("Change email"), portal: 5 },
{ text: @tr("Change password"), portal: 6 },
{ text: @tr("Two-factor authentication"), portal: 7 },
{ text: @tr("Manage account deletion"), portal: 8 },
{ text: @tr("Export account data"), portal: 9 },
]: Button {
text: action.text;
small: true;
enabled: !Bridge.myts.busy;
clicked => { Bridge.myts-portal(action.portal); }
}
}
if Bridge.myts.busy: Note { text: @tr("Contacting account service…"); }
if root.account-status != "": Note { text: root.account-status; }
if Bridge.myts.persistence-status == 1: Note {
text: @tr("Saved account credentials could not be read. Unlock the keyring or clear the saved session.");
}
if Bridge.myts.persistence-status == 5: Note {
text: @tr("Account credentials could not be saved. This session will not be restored after restarting.");
}
if Bridge.myts.persistence-status == 6: Note {
text: @tr("Account credentials could not be saved, and older credentials could not be removed. Unlock your keyring and clear the saved session.");
}
if Bridge.myts.persistence-status == 8: Note {
text: @tr("Signed out locally, but saved credentials could not be removed. Unlock your keyring and clear the saved session again.");
}
if Bridge.myts.status == 13: Button {
text: @tr("Resend activation email in browser");
enabled: !Bridge.myts.busy;
clicked => { Bridge.myts-portal(3); }
}
if Bridge.myts.can-forget && !Bridge.myts.busy: Button {
text: Bridge.myts.signed-in ? @tr("Check session") : @tr("Retry saved session");
clicked => { Bridge.myts-retry(); }
}
if Bridge.myts.can-forget || Bridge.myts.busy: Button {
text: Bridge.myts.busy ? @tr("Cancel and clear session") : Bridge.myts.signed-in ? @tr("Sign out") : @tr("Clear saved session");
clicked => { Bridge.myts-logout(); }
}
}
export component LoginPage inherits ScrollView {
VerticalLayout {
width: root.visible-width;
padding: Theme.space-4;
spacing: Theme.space-5;
alignment: start;
HorizontalLayout {
Rectangle { horizontal-stretch: 1; }
VerticalLayout {
max-width: 480px;
horizontal-stretch: 1;
spacing: Theme.space-4;
Text {
text: @tr("Welcome to {}", Bridge.app-name);
color: Theme.text;
font-size: Theme.font-xl;
font-weight: Theme.weight-semibold;
wrap: word-wrap;
}
Note { text: @tr("Sign in to make your myTeamSpeak account your main profile."); }
AccountCard { }
Button {
text: @tr("Continue without an account");
clicked => { Bridge.myts-dismiss(); }
}
Note { text: @tr("You can connect to servers without an account and sign in later in Settings → My Account."); }
}
Rectangle { horizontal-stretch: 1; }
}
}
}
+2 -1
View File
@@ -144,7 +144,8 @@ export component YouPage inherits ScrollView {
alignment: center;
horizontal-stretch: 1;
Text {
text: Bridge.nickname != "" ? Bridge.nickname : Bridge.app-name;
text: Bridge.primary-name;
overflow: elide;
color: Theme.text;
font-size: Theme.font-lg;
font-weight: Theme.weight-semibold;
@@ -3,6 +3,7 @@
// (encoding, SRTP, history, cache, logs, every setting); and the rows the
// sections share.
import { AccountCard } from "account.slint";
import { Theme } from "../theme.slint";
import { Icons } from "../icons.slint";
import { Bridge, IdentityItem, LayerItem, AudioSourceItem, ConfigItem, PermItem, SettingItem, EncoderItem } from "../bridge.slint";
@@ -168,6 +169,7 @@ component CopyField inherits Field {
export component AccountSection inherits VerticalLayout {
alignment: start;
spacing: Theme.space-5;
AccountCard { }
Card {
title: @tr("Identity in use");
icon: Icons.id-card;
@@ -219,21 +221,6 @@ export component AccountSection inherits VerticalLayout {
text: @tr("Servers know you by this id: your groups and permissions belong to it. Your nickname is set per server, in the server's bookmark.");
}
}
Card {
title: @tr("myTeamSpeak");
icon: Icons.info;
Hint {
text: @tr("{} does not sign in to myTeamSpeak, TeamSpeak's account service: it has no public API, and its terms do not allow using the private one. To use identities synchronised there, sign in once with the official client, then import them under Profiles: they are read from its settings, never written.", Bridge.app-name);
}
HorizontalLayout {
alignment: start;
Button {
icon: Icons.download;
text: @tr("Import identities");
clicked => { Nav.open-settings(SettingsSection.profiles); }
}
}
}
}
// Use as default, export, delete.
+1 -1
View File
@@ -1136,7 +1136,7 @@ export component SettingsPage inherits Rectangle {
: s == SettingsSection.keybinds ? @tr("How your voice goes out, and the keys for it.")
: s == SettingsSection.streaming ? @tr("Defaults of your streams, their layers and their sound.")
: s == SettingsSection.privacy ? @tr("Who can reach you, blocked people, what the app keeps.")
: s == SettingsSection.account ? @tr("Who servers see when you connect.")
: s == SettingsSection.account ? @tr("Your main account and server identity.")
: s == SettingsSection.profiles ? @tr("Your identities: each is a unique id on every server.")
: s == SettingsSection.devices ? @tr("Microphones, speakers, cameras and screens.")
: s == SettingsSection.notifications ? @tr("What the bell and the desktop tell you.")
+5 -5
View File
@@ -164,7 +164,7 @@ export component VoiceButtons inherits HorizontalLayout {
}
}
// Who we are on the current server, and the voice buttons.
// The primary app profile, with current server voice status and controls.
export component UserCard inherits Rectangle {
min-height: 60px;
border-radius: Theme.radius-lg;
@@ -179,10 +179,10 @@ export component UserCard inherits Rectangle {
alignment: center;
Avatar {
size: 38px;
initials: Bridge.nickname != "" ? "" : "?";
initials: Bridge.myts.signed-in || Bridge.nickname != "" ? "" : "?";
image: Bridge.own-avatar;
tint: Theme.accent;
label: Bridge.nickname;
label: Bridge.primary-name;
// Green ring while our voice goes out.
speaking: Bridge.transmitting;
status: Bridge.voice-connected ? Status.online : Bridge.observing ? Status.info : Status.offline;
@@ -190,7 +190,7 @@ export component UserCard inherits Rectangle {
source: Icons.user;
size: 20px;
tint: #ffffff;
visible: Bridge.nickname != "" && Bridge.own-avatar.width == 0;
visible: (Bridge.myts.signed-in || Bridge.nickname != "") && Bridge.own-avatar.width == 0;
}
}
}
@@ -198,7 +198,7 @@ export component UserCard inherits Rectangle {
alignment: center;
horizontal-stretch: 1;
Text {
text: Bridge.nickname != "" ? Bridge.nickname : Bridge.app-name;
text: Bridge.primary-name;
color: Theme.text;
font-weight: Theme.weight-semibold;
overflow: elide;
+10 -5
View File
@@ -1,9 +1,11 @@
# Translations
The UI is translated with Slint's gettext-based translations: strings in
The UI uses Slint's gettext-based translation markers: strings in
`.slint` files are marked with `@tr(...)`, extracted into a `.pot` template,
translated in `.po` files, and **compiled into the binary** (Slint's bundled
translations). Nothing is loaded at runtime, so there is no dependency on
translated in `.po` files, and can be **compiled into the binary** (Slint's bundled
translations). The repository currently has a `.pot` template but no `.po`
translations; bundled translations are not enabled yet. Nothing needs to be
loaded at runtime, so there is no dependency on
GNU gettext (LGPL) and it works the same on Linux, Windows and Android.
## Marking strings
@@ -68,7 +70,9 @@ MSYS2 or Git for Windows' bundled tools).
```sh
# 1. Extract the template after changing strings
slint-tr-extractor --package-name voelin-ui crates/voelin-ui/ui/*.slint -o crates/voelin-ui/lang/voelin-ui.pot
mkdir -p crates/voelin-ui/lang
rg --files crates/voelin-ui/ui -g '*.slint' | sort | \
xargs slint-tr-extractor --package-name voelin-ui -o crates/voelin-ui/lang/voelin-ui.pot
# 2. Update every translation (new strings empty, changed ones fuzzy)
for po in crates/voelin-ui/lang/*/LC_MESSAGES/voelin-ui.po; do
@@ -91,7 +95,8 @@ translatable yet.
## Bundling and language selection
`crates/voelin-ui/build.rs` compiles the translations into the binary:
Once the first `.po` translation exists, configure `crates/voelin-ui/build.rs`
to compile translations into the binary:
```rust
slint_build::compile_with_config(
+14 -4
View File
@@ -10,6 +10,12 @@ private key.**
Voelin can import identities from the official clients so that switching does
not mean starting over, and export them back so they are never trapped here.
The myTeamSpeak account has a separate signing identity. After password sign-in,
Voelin can authenticate its `myTS ID` on voice servers without replacing the
P-256 identity that owns server permissions. The primary account applies to all
voice connections and is cleared on sign-out. See
[the account protocol notes](research/myteamspeak.md#authenticated-account-identity-on-voice-servers).
## The unique ids
Both generations derive the unique id from `omega`, the base64 of the DER
@@ -232,10 +238,14 @@ the repository. Every fixture in the tests is generated by
and import that.
- **The other `ProtobufItems` item types.** Bookmarks, connection profiles and
server lists are not imported. Only identities are.
- **myTeamSpeak sign-in.** There is no public API and the terms forbid the
non-public ones, so identities synchronised only to a myTeamSpeak account and
not present locally cannot be fetched. Sign in with the official client once
so it writes them to `settings.db`, then import from there.
- **myTeamSpeak identity synchronisation.** Desktop My Account supports an
experimental account session, but does not fetch cloud identities or decrypt
account backups. Sign in with the official client once so it writes the
identities to `settings.db`, then import from there. See
[research/myteamspeak.md](research/myteamspeak.md) for the account client's
verification scope, session renewal, and cloud-sync limitations. The signed-in
account is the main app profile; server identities and bookmark nicknames are
independent.
- **Writing back to the official clients.** Voelin only reads them. Use the
`.ini` export and the client's own import.
- **Bringing the nickname's history along.** Only the key pair and the
+224 -11
View File
@@ -1,21 +1,234 @@
# myTeamSpeak
## Conclusion: out of scope
## Desktop account sessions
myTeamSpeak is TeamSpeak's account service: it holds the user's identities,
bookmarks and settings server-side so the official clients can synchronise
them. Voelin does **not** sign in to it.
them. Voelin opens a login page at desktop startup and makes the signed-in
myTeamSpeak account the main app profile. The same form lives in Settings →
My Account. Native login, OTP, saved-session validation and sign-out use
`voelin-myts`; registration, password recovery and account management open the
official website in the default browser.
There is no public API for it. The endpoints the official client uses are not
documented for third parties, and TeamSpeak's terms of service do not permit
using non-public ones. So there is nothing to implement here that could be
maintained, and nothing that would be allowed. This file exists so the question
is not re-researched.
This reverses the previous decision to leave account sign-in out of scope, at
the repository owner's request. The API remains non-public. This integration
does not establish permission to use or redistribute TeamSpeak's private API
or schemas.
What the user gets instead: sign in with the official client once, so that it
writes the synchronised identities into its local `settings.db`, then
`voelinctl identity import` reads them from there. See
[../identity.md](../identity.md).
Registration, activation-email resend, password recovery, username/email/password
changes, two-factor authentication, deletion and data export are available through
named browser actions. The website may be signed in to a different account;
Voelin does not transfer credentials to it. After completing a change, sign out
and back in to Voelin to refresh the profile.
Native cloud synchronization and recovery-key restoration are not implemented.
The app does not synchronize identities, bookmarks or settings, or create
account encryption and backup keys. Password login can decrypt an existing
version-2 account key to authenticate the account on voice servers (below).
To import cloud identities, sign in with the official client
so they are written to its local `settings.db`, then use the existing identity
import. See [../identity.md](../identity.md).
### Transport and verification boundary
The implementation consumes the message types, session status checks and wire
codec from the local `schema-api` snapshot in `third_party/schema-api`. Its
generated tonic gRPC clients are not used: the official clients use custom
protobuf-over-HTTP with `Content-Type: application/ts3cloud` at
`https://clientapi.myteamspeak.com`.
Requests contain a one-byte method-name length, the method name, and then the
protobuf payload. For login this is `05 6c 6f 67 69 6e` followed by `LoginData`.
Responses contain the protobuf alone. The live service labels these binary
responses `application/json`; decoding still uses protobuf and requires the
operation's explicit success status. Login uses `/authentication`; session
validation and deletion use `/session`.
`Client::login` accepts the user's password and derives the wire credential:
standard Base64 of PBKDF2-HMAC-SHA512 with 10,000 iterations, 48 output bytes,
and salt `ASCII_lowercase(email) + "ts3Login" + password`. The derivation runs
on Tokio's blocking pool. It reuses `base64` and `pbkdf2` already present in
the workspace dependency graph; no new cryptographic implementation is added.
These details replace the initial guessed header and raw-password handling.
On 2026-10-04, an owner-authorized live login, session validation, and logout
passed. Ordinary tests remain offline and use synthetic credentials. Live OTP
and expired-session renewal have not been verified.
Static evidence from the installed clients (ELF virtual addresses):
- TS3 request framing: `0x14a19dd`–`0x14a1a49`; password salt and iterations:
`0x1152b60`–`0x1152c24`; 48-byte derivation: `0x1154920`; SHA-512 selection:
`0x11e35af` and descriptor table `0x1b4a930`. Executable SHA-256:
`87c9b6927949d28c64e9da21fdf62bdf7a9e5b204597e9f75497ff6ee45be8ac`.
- TS6 request framing: `0x1dfd4e1`–`0x1dfd54c`; response decoding:
`0x1dfddcb`–`0x1dfde0b`. Executable SHA-256:
`9a32215a578a14525ec43f5e6f60aae087c0229c1b60487da235e3b3782cd40a`.
The renewal request has separate `renewal_token` and `auth_token` fields.
The official TS3 client requires both cached values before renewing
(`0x1143d81`–`0x1143dba`). Password login supplies no auth token, so an expired
password-login session requires fresh sign-in. The client API rejects missing
renewal credentials before making a request. It does not silently create the
separate shareable authentication token used by the official client's
sharing/import flow.
A saved OTP renewal token is used only with the same account's device ID in a
password login; an explicit one-time code takes precedence. Both are replaced
with the next successful response and cleared on sign-out. The installed TS6
serializer at `0x1cbed20`–`0x1cbefc1` independently confirms the email/password/OTP/
device/OTP-renewal fields. Live OTP and token rotation remain unverified.
Passwords and one-time codes are not persisted. Session and renewal material
are stored together as a single `myts/session` item through the app's secret
store, never in plaintext settings. Replacing one item prevents a partial write
from mixing credentials from different accounts. The bundle also stores the
account UUID, username and email, with backward-compatible defaults for older
bundles. Startup validates a saved session before showing its profile as signed
in. A valid session closes the login page; errors leave retry and manual sign-in
available. Transport failures retain saved credentials. A locked keyring can be
retried without restarting. Continue without an account dismisses the prompt
for the current run and leaves server features available.
Sign-out returns to login, clears local account material and attempts remote
session deletion; storage or remote errors are reported. A late completion
cannot sign a canceled operation back in. Server identities and bookmark
nicknames remain independent of the primary app profile.
### Authenticated account identity on voice servers
The account UUID is a profile identifier, not the authenticated `myTS ID`.
Password login unwraps the account's encrypted root key, then the account's
private signing scalar. The key pair is checked before it becomes usable.
The validated identity is stored with the session in the secret store; it is
not published to voice sessions until saved-session validation succeeds.
Older saved sessions need a fresh password sign-in to obtain this identity.
Missing, unsupported or invalid identity data leaves account login usable and
shows an explicit warning that voice servers will not receive a myTS ID.
The established version-2 format uses:
- PBKDF2-HMAC-SHA512, 10,000 iterations, 32 bytes, with salt
`ASCII_lowercase(email) + "ts3Encryption" + password`.
- Root wrapping: `02 || tag16 || nonce12 || ciphertext32`, AES-256-GCM
with empty associated data.
- Private-key wrapping: `iv16 || ciphertext32 || SHA512(plaintext32)`,
AES-256-CTR with a little-endian 128-bit counter. The digest and matching
public key must verify. Version-1 root wrapping is explicitly unsupported.
The existing transport's connection challenge is
`SHA256(30 08 00 00 00 00 || shared_iv64) || "MyTeamSpeakID"`.
Signing uses the raw account scalar, not Ed25519 seed expansion. The public
proof sends `myTeamspeakId`, `acTime`, `userPubKey`, `authSign`, `pubSign` and
`pubSignCert` on `clientinit`; the last two split `public_signature` at byte 64.
The HTTP response's numeric creation timestamp is byte-swapped once for the
voice protocol's decimal `acTime`. The provider public signature covers
`public_key32 || wire_acTime.to_le_bytes() || myTS_ID33`.
Neither the account UUID nor `mytsid_user_cert.cert` substitutes for these fields.
Private key material never belongs in a packet.
The main account is shared by all voice connections. Each new connection signs
its own challenge. Account changes cancel an unfinished handshake; connected
clients send `updatemytsid`, and logout sends an empty myTS ID. Rejected or
unanswered account updates disconnect rather than retaining a previous account
association. Cloud avatar retrieval is outside this branch.
Static TS3 evidence in the binary identified above: proof helper `0x1018580`,
`clientinit` invocation `0x1020c3b`, live update `0x1049659`, scalar signing
`0x1196800`, password KDF `0x1152cf0`, version-2 unwrap `0x11542d0`, GCM
layout `0x1155610`, and private-key integrity check `0x1153280`.
The login-to-storage timestamp swap is at `0x110b57c`; the server's public
signature payload is built at `0x1222da`–`0x12260d` in the pinned TS3 server.
Independent synthetic crypto vectors and malformed/tampered key tests cover
the local implementation. The ignored `voelin-core/tests/myts_live.rs` test
requires explicit account opt-in and caller-owned loopback servers; it checks
server-side identity association, clearing, reattachment, and fresh handshakes.
On 2026-10-04, owner-authorized live password login, authenticated key unwrap,
session validation and remote session deletion passed. Isolated official TS3
3.13.8 and TS6 6.0.0-beta13.1 servers each accepted two fresh signed handshakes,
reported the expected `client_myteamspeak_id`, and passed live clear/reattach
checks. Both reported the native Linux compatibility tuple and Voelin metadata.
The test servers needed a container-local DNS override to a working address
for `ts3services.teamspeak.com` before their official revocation-list downloads
succeeded; TLS and signature/revocation checks remained enabled. No server
override is part of the application.
Official-client visual inspection remains unverified: isolated TS3 3.6.2
crashed before showing its UI; isolated TS6 started but required account
confirmation before reaching the server view. No existing client profile was
changed. GUI checks of Voelin's account fields passed at desktop and narrow
sizes using synthetic account data.
### Client reporting
The voice engine chooses an unchanged signed compatibility tuple for the
actual operating system. A bookmark's explicit compatibility-version override
is honored and validated. `client_meta_data` identifies `Voelin`, its package
version and native OS. The CLI uses the same catalogue and native default.
TeamSpeak signs compatibility versions: replacing the signed version with an
arbitrary `Voelin` string is not supported. Metadata does not establish that
stock clients display Voelin in their standard version label.
An account change during an automatic transport reconnect cancels that voice
session to prevent stale credentials from being sent. Reconnect manually in
that case; ordinary connected account changes use the live update command.
The vendored crate has no declared license. Its provenance is recorded in
`third_party/schema-api/VOELIN-PATCH.md`; no license grant is inferred from its
presence. Runtime dependency notices are generated normally.
### Official account-management routes
Read-only inspection on 2026-10-04 verified these routes in the deployed
[main bundle](https://www.myteamspeak.com/main.a0429db5055b28c1.js) and
[account-management bundle](https://www.myteamspeak.com/933.0799f055321e36e9.js):
| Action | Official route |
| --- | --- |
| Registration | `https://www.myteamspeak.com/register` |
| Password recovery | `https://www.myteamspeak.com/forgot-password` |
| Activation email | `https://www.myteamspeak.com/resend-activation` |
| Account overview | `https://www.myteamspeak.com/my-account` |
| Username / email / password | `/my-account/change-username`, `/my-account/change-email`, `/my-account/change-password` |
| Two-factor authentication | `/my-account/change-2fa` |
| Deletion / data export | `/my-account/manage-account`, `/my-account/manage-data` |
The site's authentication guard preserves the requested destination. Its
[registration](https://www.myteamspeak.com/5.dcb40731983490af.js) and
[password recovery](https://www.myteamspeak.com/252.5c94d1e115160e7d.js) flows
use reCAPTCHA. Password changes rewrap encryption-key material, and deletion
requires a separate confirmation. Browser handoff retains those provider-owned
steps. Only fixed HTTPS URLs are passed as desktop-opener arguments; no shell,
email, password or token is included. Opening a page does not submit a change.
These are website-source findings, not a published native API guarantee.
### Local verification
```sh
cargo test -p voelin-myts
cargo test -p voelin-ui --lib myts::tests
cargo build -p voelin-myts -p voelin-ui
cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps -- -D warnings
cargo fmt $(scripts/own-crates.sh) --check
scripts/notices.sh --check
```
The HTTP tests use loopback mock servers and synthetic credentials. UI tests
cover the secret-store bundle, failed reads/writes/deletes, form states,
concurrent operations, primary-account replacement, legacy-bundle migration,
remembered-device ownership and late completions after sign-out. Screenshot
fixtures use `VOELIN_DEMO_UI=1` and `VOELIN_OPEN=login`, `login:otp`,
`login:saved` or `login:account`; they never read the keyring. The formatting
command excludes vendored sources; `cargo fmt --all` also traverses local path
dependencies and reports upstream formatting differences. Clippy's `--no-deps`
also keeps diagnostics out of the existing vendored protocol crates.
The ignored `owner_live_login_validate_logout` test requires the owner to set
`VOELIN_MYTS_LIVE=1`, `VOELIN_MYTS_EMAIL`, `VOELIN_MYTS_PASSWORD`,
`VOELIN_MYTS_DEVICE_ID`, and optionally `VOELIN_MYTS_OTP`, then explicitly run
`cargo test -p voelin-myts owner_live_login_validate_logout -- --ignored`.
This test is not part of the offline verification commands above.
## The local record, structurally
+15 -3
View File
@@ -177,7 +177,7 @@ Settings sections (`settings:<section>`):
| Section | Holds |
|---|---|
| `account` | The identity in use (nickname, TeamSpeak 3 and 6 unique ids, security level) and why there is no myTeamSpeak sign-in |
| `account` | The identity in use (nickname, TeamSpeak 3 and 6 unique ids, security level); on desktop, the primary myTeamSpeak profile, login/OTP, session status, sign-out and official browser account-management actions |
| `profiles` (also `identities`) | Identities with where they came from: rename, use as default (the store's default, `Store::set_default_identity`), export as a TeamSpeak 3 .ini, delete, raise the security level on every core; the import of the official clients' identities on start (`identity.import_from_teamspeak`) and by hand from their settings and .ini files (key material is never shown); the identity per server |
| `appearance` | Theme, text size, the phone layout's width, the image cache |
| `voice` | Microphone (device, test, level, noise suppression, echo cancellation, automatic gain), output (device, test sound, volume), streaming permissions, camera (device, preview with the background effect), video settings (resolution, frame rate 15 to 320 fps, codec, hardware acceleration, mirror), stream quality presets (Auto, 720p to 8K) with free bitrate entry (slider up to 60 Mbit/s, empty: automatic) and the upload it takes |
@@ -189,8 +189,20 @@ Settings sections (`settings:<section>`):
| `integrations` | The gateways of our servers with their features, and their administration for admins (configuration keys, permission rules); FFmpeg, the video encoders and decoders, what works and why not |
| `advanced` | Encoder and decoder, hardware acceleration and decoding, SRTP profiles, chat history, cache, transfers, logs and crash reports, and every setting by its key as JSON |
Every control reads and writes `voelin_core::settings` and applies at
once; numbers are typed freely next to the presets.
Settings controls read and write `voelin_core::settings` and apply at once;
numbers are typed freely next to the presets.
Desktop startup shows the shared myTeamSpeak login page until a saved session
is validated, a login succeeds, or the user chooses Continue without an account.
The signed-in username/email becomes the primary app profile in the desktop
user card and mobile You page; it does not replace server identities or bookmark
nicknames. Settings → My Account reuses the form, supports retry/OTP/sign-out,
and opens official browser flows for registration, activation, recovery and
account management. Account and renewal material live only in the keyring;
passwords and one-time codes are cleared after submission. Expired sessions
require fresh sign-in because password login supplies no renewal auth token.
See [research/myteamspeak.md](research/myteamspeak.md) for protocol evidence
and remaining cloud-sync limitations.
## The Stream Studio
+4
View File
@@ -47,6 +47,10 @@ if grep -E "WARN|ERROR" "$tmp/log" >&2; then
exit 1
fi
cat about-assets.md >>"$tmp/$OUT"
# Some upstream license texts contain trailing spaces. Keep the generated
# Markdown clean without changing the words of those notices.
sed 's/[[:blank:]]*$//' "$tmp/$OUT" >"$tmp/normalized"
mv "$tmp/normalized" "$tmp/$OUT"
if $check; then
if ! diff -u "$OUT" "$tmp/$OUT" >"$tmp/diff"; then
+1404
View File
File diff suppressed because it is too large. Load diff
+40
View File
@@ -0,0 +1,40 @@
[package]
name = "schema-api"
version = "0.1.0"
edition = "2021"
description = "Complete Rust gRPC bindings and client utilities for the supplied API schemas"
readme = "README.md"
publish = false
include = ["src/**", "proto/**", "build.rs", "Cargo.toml", "Cargo.lock", "README.md", "docs/**", "examples/**", "tests/**", "scripts/**"]
[features]
default = ["reflection"]
reflection = ["dep:prost-reflect", "dep:serde_json"]
server = []
infrastructure = []
gzip = ["tonic/gzip"]
[dependencies]
prost = "0.14"
prost-types = "0.14"
tonic = { version = "0.14", features = ["transport", "tls-ring", "tls-native-roots"] }
tonic-prost = "0.14"
thiserror = "2"
prost-reflect = { version = "0.16", features = ["serde"], optional = true }
serde_json = { version = "1", optional = true }
[build-dependencies]
prost-build = "0.14"
tonic-prost-build = "0.14"
protoc-bin-vendored = "3"
[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "sync", "time"] }
tokio-stream = { version = "0.1", features = ["net"] }
[[example]]
name = "inspect_schema"
required-features = ["reflection"]
# Voelin: keep this vendored package independent of enclosing workspaces.
[workspace]
+172
View File
@@ -0,0 +1,172 @@
# schema-api
A Rust crate for the API in the supplied protobuf archive. It exposes **all 106 application RPCs across nine services**, plus all 228 application message declarations and 33 enums. Original namespaces, field numbers, enum numbers, oneofs, proto2 presence, and RPC route spelling are preserved. The namespace is treated solely as your API's wire contract.
Features include configurable async gRPC clients, native/custom TLS and mTLS, rotating request metadata, request deadlines, message limits, optional gzip, session-body helpers, binary codecs, checked `Any` conversion, runtime descriptors, protobuf JSON, and optional generated servers. All original 123 `.proto` files are included.
## Use locally
Extract this directory next to your application and add:
```toml
[dependencies]
schema-api = { path = "../schema-api" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
```
Use a current stable Rust toolchain. Cargo downloads dependencies on the first build. A bundled `protoc` is selected automatically; installing a protobuf compiler separately is unnecessary. `PROTOC` can override the executable and `PROTOC_INCLUDE` can override its standard include directory (containing `google/protobuf`). Set both on hosts without a vendored compiler. `Cargo.lock` records the versions used for verification. This local crate is not published; `publish = false` avoids accidental registry publication. No new license is imposed on your supplied schemas.
## Login and a session-authenticated call
```no_run
use schema_api::{api, ApiClient, SessionRequest, SessionToken};
use std::time::Duration;
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let client = ApiClient::builder("https://api.example.invalid")?
.connect_timeout(Duration::from_secs(10))
.request_timeout(Duration::from_secs(30))
.connect()
.await?;
let response = client.login().login(api::LoginData {
email: "user@example.invalid".into(),
password: "your-server-defined-credential".into(),
device_name: "Rust client".into(),
..Default::default()
}).await?.into_inner();
// Require the explicit LOGIN_OK code (200), then a nonempty session.
// Keep the full response: it also carries keys, permissions and renewal data.
let session = SessionToken::try_from(&response)?;
let request = api::user::Session::default().with_session(&session);
let badges = client.user().get_badges(request).await?.into_inner();
// Inspect the response's own application status fields before using its data.
# let _ = badges;
# Ok(())
# }
```
The archive does not define a hostname, credential encoding, or deployment authentication policy. Supply your own endpoint and server-defined credential representation. Session helpers set explicit protobuf body fields; they do not add a guessed authorization header. `skipSession` logins can succeed without yielding a usable `SessionToken`. Unknown numeric application error values remain accessible.
## Service coverage
Every getter returns a generated tonic client over a cheap clone of the shared channel. Client methods accept either a message or `tonic::Request<Message>` and retain response metadata and `tonic::Status` errors. No RPC is hidden behind a smaller handwritten facade.
| Getter | Service | RPCs | Coverage |
| --- | --- | ---: | --- |
| `login()` | `LoginService` | 12 | Sessions, login, auth/renewal tokens, account status |
| `user()` | `UserAccountService` | 30 | Accounts, badges, voice servers, avatars, files, 2FA |
| `management()` | `UserManagementService` | 39 | Users, activation, resets, badges, communities |
| `chat()` | `ChatRequests` | 16 | Contacts, identifiers, home migration, group sessions |
| `synchronization()` | `SynchronizationService` | 2 | Check and update item classes |
| `integration()` | `IntegrationUserService` | 4 | Bindings, status, subscriptions |
| `messenger()` | `MessengerConnectorClientService` | 1 | Messenger account creation |
| `addon()` | `UserAddonService` | 1 | Download/update lookup |
| `push()` | `PushService` | 1 | Server-streaming `longPull` |
Rust method names are snake case, such as `login_with_auth_token`, `get_account_data`, and `long_pull`. Their on-wire method names retain the original spelling. The complete method/type/auth-field catalog is in `docs/SCHEMA.md`; `docs/schema-inventory.json` includes resolved paths, symbols, and original source hashes.
Use separate `ApiClient`s when services live at different endpoints. For custom connectors or middleware, use `ApiClient::from_channel`, `client::ClientBuilder::from_endpoint`, or the public generated client types under `proto`.
## Namespaces and features
| Namespace | Contents |
| --- | --- |
| `api` | Shared application types and service submodules |
| `push` | Push transport `Message` and `PushServiceClient` |
| `api::push` | Notification envelopes and payload types |
| `account` | Local account serialization messages |
| `sync` | Local synchronization serialization messages |
| `proto::com::teamspeak` | Complete original application package hierarchy, including caches and revocation |
| `proto::envoy`, `proto::xds`, etc. | Optional infrastructure packages |
| Cargo feature | Default | Effect |
| --- | --- | --- |
| `reflection` | Yes | Runtime inspection, dynamic messages, protobuf JSON |
| `server` | No | Generated tonic server traits/adapters for every enabled service |
| `infrastructure` | No | Also generate supporting Envoy/xDS/UDPA/CEL/gRPC/validation bindings and Envoy load-reporting client |
| `gzip` | No | Opt-in request/response gzip support |
`--no-default-features` retains all application types, gRPC clients, session helpers, codecs, TLS, and the raw `FILE_DESCRIPTOR_SET`, while dropping runtime JSON/reflection dependencies. Google well-known messages map to `prost_types`; `google.protobuf.Empty` maps to `()`.
The archive's Google `descriptor.proto` and `cpp_features.proto` contain malformed options. The build keeps these originals untouched and resolves standard Google protobuf imports from the compiler's bundled includes first. Compiler-only `pb.CppFeatures` is not exposed. The optional infrastructure definitions are data bindings; generating validation annotations does not execute business validation or implement an xDS controller.
## Metadata, TLS, deadlines, and limits
```no_run
use schema_api::{ApiClient, tonic::{Request, metadata::MetadataMap}};
use std::time::Duration;
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let mut headers = MetadataMap::new();
headers.insert("x-tenant", "example".parse()?);
let client = ApiClient::builder("https://api.example.invalid")?
.metadata(headers)
.max_decoding_message_size(16 * 1024 * 1024)
.max_encoding_message_size(16 * 1024 * 1024)
.request_timeout(Duration::from_secs(20))
.connect().await?;
// Only enable bearer authentication if it is part of YOUR deployment contract.
client.metadata().set_bearer_token("opaque-token")?;
client.metadata().clear_bearer_token()?;
let mut request = Request::new(schema_api::api::Session { session: "session".into() });
request.metadata_mut().insert("x-tenant", "override".parse()?);
request.set_timeout(Duration::from_secs(5));
let _ = client.login().session(request).await?;
# Ok(())
# }
```
Per-request metadata overrides defaults by key; duplicate default values and binary metadata are preserved. Shared metadata changes affect future calls through existing handles. Debug output for the shared metadata store and `SessionToken` is redacted; generated protobuf messages can contain secrets and should not be logged wholesale.
HTTPS enables native-root certificate validation. `client::ClientBuilder::tls_config` accepts a tonic `ClientTlsConfig` for a private CA, explicit TLS name, or client identity; see `examples/custom_tls.rs`. HTTP is supported for local or appropriately protected deployments. Endpoint paths/queries are rejected because service routes come from the protobuf descriptors.
The default connection timeout is 10 seconds. No RPC deadline is imposed by default. `request_timeout` sets `grpc-timeout` for unary calls; `stream_timeout` opts into a push deadline. The channel limits response setup; enforcement after a stream is established depends on the server. For a receive inactivity timeout, wrap `stream.message()` in `tokio::time::timeout`. Per-request timeouts override defaults. Message-size limits are per protobuf message. With `gzip`, use `send_gzip(true)` and `accept_gzip(true)` only when supported by the server.
## Push streams and binary payloads
```no_run
# async fn example(client: schema_api::ApiClient) -> Result<(), Box<dyn std::error::Error>> {
let mut stream = client.push().long_pull(()).await?.into_inner();
while let Some(message) = stream.message().await? {
// The contract only guarantees opaque bytes here.
println!("{} bytes", message.payload.len());
}
# Ok(())
# }
```
Dropping the stream cancels it. Stream errors remain `tonic::Status`. There is no automatic replay/reconnection policy because no resume cursor or delivery guarantee is specified. `wire::decode_push_payload::<T>` and `decode_push_notification` are explicit, fallible decoders for deployments that define the corresponding encoding. Typed `wire::pack_any`/`unpack_any` use full protobuf names and reject mismatched type URLs. Plain `wire::encode`/`decode` work with any prost message.
## Reflection and protobuf JSON
```rust
# #[cfg(feature = "reflection")]
# {
use schema_api::{api, reflection};
let message = api::LoginStatus { error: 200, uuid: "id".into() };
let json = reflection::to_json(&message).unwrap();
let roundtrip: api::LoginStatus = reflection::from_json(&json).unwrap();
assert_eq!(roundtrip, message);
# }
```
JSON follows protobuf rules: base64 bytes, named enums, string-encoded 64-bit integers, lower-camel field names, and descriptor-resolved `Any`. Unknown JSON fields and trailing content are rejected by default; configurable options are available. Dynamic messages support schema inspection and retain unknown wire fields. Decoding into generated types discards unknown wire fields. `FILE_DESCRIPTOR_SET` is available in every build for tooling or an optional server reflection implementation.
## Build and run examples
```sh
cargo test --locked --all-features --all-targets
cargo test --locked --no-default-features
cargo test --locked --doc
cargo run --locked --example inspect_schema
cargo doc --locked --all-features --no-deps --open
```
`examples/login.rs` reads `API_ENDPOINT`, `API_EMAIL`, `API_PASSWORD`, and optional `API_OTP`/`API_DEVICE_ID`. `examples/push.rs` reads `API_ENDPOINT` and optional `API_PUSH_HEADER`/`API_PUSH_VALUE`. No real hostname or credential is embedded. `examples/custom_tls.rs` documents CA and mTLS environment variables.
Tests cover actual in-process unary/streaming gRPC exchanges, metadata and status handling, deadline separation, schema coverage, binary compatibility, proto2 presence, unknown enums, checked session status, nested session updates, `Any`, and protobuf JSON. Verification details are in `docs/VERIFICATION.md`.
The schemas do not define encryption/signature algorithms, password derivation, blob envelope encoding, signed-URL HTTP upload details, token refresh rules, or safe retry/idempotency behavior. The crate exposes all related fields and RPCs without inventing those protocols or automatically retrying mutations. Live server compatibility requires your endpoint and its deployment contract.
+15
View File
@@ -0,0 +1,15 @@
# schema-api snapshot
Copied on 2026-10-04 from the owner's local
`/home/faumaray/Project/Personal/schema-api` (version 0.1.0).
The source directory has no Git metadata and declares no license; its licensing
must be resolved before redistribution. This note does not grant a license.
Voelin consumes the message types, session helpers and wire codec via a path
dependency with default features disabled. Generated gRPC clients are not used
for myTeamSpeak's custom HTTP transport.
The only upstream patch is an empty `[workspace]` table in `Cargo.toml`, matching
Voelin's other vendored packages. This packaging change prevents Cargo from
assigning the vendor to an enclosing checkout's workspace when Voelin itself is
in a nested worktree. All Rust and protobuf sources remain unmodified.
+55
View File
@@ -0,0 +1,55 @@
use std::{
env,
error::Error,
fs,
path::{Path, PathBuf},
};
fn collect_protos(dir: &Path, recursive: bool, files: &mut Vec<PathBuf>) -> std::io::Result<()> {
for entry in fs::read_dir(dir)? {
let path = entry?.path();
if path.is_dir() && recursive {
collect_protos(&path, true, files)?;
} else if path.extension().is_some_and(|ext| ext == "proto") {
// Google well-known definitions come from the same distribution as protoc.
// The archive's descriptor.proto/cpp_features.proto have invalid option syntax.
if !path.starts_with("proto/google/protobuf") {
files.push(path);
}
}
}
Ok(())
}
fn main() -> Result<(), Box<dyn Error>> {
println!("cargo:rerun-if-changed=proto");
println!("cargo:rerun-if-env-changed=PROTOC");
println!("cargo:rerun-if-env-changed=PROTOC_INCLUDE");
let out = PathBuf::from(env::var("OUT_DIR")?);
let mut files = Vec::new();
collect_protos(
Path::new("proto"),
env::var_os("CARGO_FEATURE_INFRASTRUCTURE").is_some(),
&mut files,
)?;
files.sort();
let mut config = prost_build::Config::new();
config.protoc_executable(match env::var_os("PROTOC") {
Some(path) => PathBuf::from(path),
None => protoc_bin_vendored::protoc_bin_path()?,
});
config.enable_type_names();
let standard_include = match env::var_os("PROTOC_INCLUDE") {
Some(path) => PathBuf::from(path),
None => protoc_bin_vendored::include_path()?,
};
let includes = [standard_include, PathBuf::from("proto")];
tonic_prost_build::configure()
.build_client(true)
.build_server(env::var_os("CARGO_FEATURE_SERVER").is_some())
.include_file("packages.rs")
.file_descriptor_set_path(out.join("api_descriptor.bin"))
.compile_with_config(config, &files, &includes)?;
Ok(())
}
+382
View File
@@ -0,0 +1,382 @@
# Source schema audit and RPC catalog
This document audits the supplied archive only. The namespace spelling is retained as a wire contract; it does not establish a relationship with any external service. No endpoint, credential, live server, or implementation documentation was supplied.
## Coverage and provenance
The archive contains **123 protobuf files**: **23 application files** and **100 supporting infrastructure files**. The application schemas define **228 explicitly declared messages**, **33 enums**, and **9 services with 106 methods**. Of those methods, **105 are unary** and **one is server streaming**. There are no application client-streaming or bidirectional methods. Message counts include nested declarations and exclude synthetic protobuf map-entry messages. The machine-readable [inventory](schema-inventory.json) records every source file, SHA-256 digest, package, message, enum value, and RPC path.
Every textual import points to a file in the archive. This is an import-completeness check, not proof that the entire archive compiles. Application source files contain no comments explaining protocol behavior. The only nonapplication imports needed by the application files are `google/protobuf/any.proto` and `google/protobuf/empty.proto`.
### Application source files
| File | Package | Messages | Enums | RPCs |
| --- | --- | ---: | ---: | ---: |
| `Account_Serializing.proto` | `com.teamspeak.account.proto` | 8 | 0 | 0 |
| `Sync_Serializing.proto` | `com.teamspeak.sync.proto` | 16 | 6 | 0 |
| `blacklist_info.proto` | `com.teamspeak.blacklist` | 2 | 1 | 0 |
| `client_lib_cache.proto` | `com.teamspeak.proto.client_cache` | 1 | 0 | 0 |
| `global_badge_list.proto` | `com.teamspeak.myteamspeak.proto.cloud` | 2 | 0 | 0 |
| `myteamspeak_addon.proto` | `com.teamspeak.myteamspeak.proto.addon` | 4 | 4 | 1 |
| `myteamspeak_avatar_common.proto` | `com.teamspeak.myteamspeak.proto` | 4 | 2 | 0 |
| `myteamspeak_common.proto` | `com.teamspeak.myteamspeak.proto` | 19 | 3 | 0 |
| `myteamspeak_integration_common.proto` | `com.teamspeak.myteamspeak.proto.integration` | 7 | 4 | 0 |
| `myteamspeak_integration_static_info.proto` | `com.teamspeak.myteamspeak.proto.integration` | 3 | 1 | 0 |
| `myteamspeak_integration_user.proto` | `com.teamspeak.myteamspeak.proto.integration` | 11 | 0 | 4 |
| `myteamspeak_login.proto` | `com.teamspeak.myteamspeak.proto.login` | 12 | 0 | 12 |
| `myteamspeak_messenger_connector_client.proto` | `com.teamspeak.myteamspeak.proto.messengerconnector` | 5 | 1 | 1 |
| `myteamspeak_namedserver_common.proto` | `com.teamspeak.myteamspeak.proto.namedserver` | 4 | 0 | 0 |
| `myteamspeak_push.proto` | `com.teamspeak.myteamspeak.proto.push` | 6 | 1 | 0 |
| `myteamspeak_synchronization.proto` | `com.teamspeak.myteamspeak.proto.synchronization` | 0 | 0 | 2 |
| `myteamspeak_tschat.proto` | `com.teamspeak.myteamspeak.proto.tschat` | 19 | 1 | 16 |
| `myteamspeak_user.proto` | `com.teamspeak.myteamspeak.proto.user` | 55 | 3 | 30 |
| `myteamspeak_user_management.proto` | `com.teamspeak.myteamspeak.proto.management.user` | 43 | 3 | 39 |
| `revocation_list.proto` | `com.teamspeak.revocation_list` | 1 | 0 | 0 |
| `revoke_cache.proto` | `com.teamspeak.proto.revocation` | 1 | 0 | 0 |
| `synchronization_common.proto` | `com.teamspeak.myteamspeak.proto.synchronization` | 4 | 3 | 0 |
| `teamspeak_push_grpc.proto` | `com.teamspeak.push.proto` | 1 | 0 | 1 |
`Account_Serializing.proto` and `Sync_Serializing.proto` use proto2. All other application files use proto3. The account/sync serialization, badge-list, named-server, revocation, blacklist and client-cache files define data formats without adding service methods. These formats are useful to the crate even though they do not establish a transport endpoint.
## Authentication and sessions
Most authenticated requests carry a session string **inside the protobuf body**. The shared `com.teamspeak.myteamspeak.proto.Session` and the distinct `com.teamspeak.myteamspeak.proto.user.Session` have equivalent fields but remain distinct types. Some requests nest the session: `NewUserPublicKeyData.session.session`, chat `user.session`, `UpdateBadgeRequest.addBadgeRequest.session`, and community listing `request.session`.
`LoginData` supports email/password plus `otp`, `device_id`, `otp_renewal_token`, `device_name`, `skipSession`, login origin and sync version. Login results include the session, key, UUID, limits, identity material, permissions, push token and optional alternative-login data. The latter contains renewal token, OTP renewal token and device ID. Auth-token and renewal-token login methods are also explicitly defined. Do not infer password hashing, key derivation, renewal timing, automatic token refresh, or a relation between `purge` and local clock units.
No schema declares an authorization metadata header, bearer-token format, endpoint, TLS requirement, hostname, or service routing layout. A client may expose custom metadata and separate service channels, but must not assume a particular header or silently copy the session/push token into one. Several management and account-status requests contain no session or credential field; this does not prove that the corresponding methods are unauthenticated. Such access may depend on deployment-specific transport metadata or service authorization.
Session convenience helpers should populate only explicit session fields and retain raw generated request access. Login helpers should preserve the full reply rather than discarding permissions, identity data or alternative-login fields. Keep passwords, renewal tokens, sessions, private keys, and OTP secrets out of diagnostic logs; generated message debugging can contain these values.
## Application status semantics
A successful gRPC transport status does not imply application success. Preserve the original response and unknown numeric enum values so callers can handle server extensions.
| Domain / enum | Evidence in schema | Client treatment |
| --- | --- | --- |
| Common `ErrorCommon` | Session OK `102`, login OK `200`, session deleted OK `204`; OTP required `208`; expired session `103` | Check the success appropriate to the RPC; expose OTP-required as a distinct outcome. `UNKNOWN_ERRORCOMMON = 0` is not success. |
| User `ErrorReturnCode` | Unknown `0`, named failures `100..132`; no named success value | Where a `success` boolean exists, use it. For enum-only responses, report the raw code; zero is unspecified rather than proof of success. |
| Management `UserManagementErrorReturnCode` | Unknown `0`, named failures `100..139`; no named success value | Same ambiguity as user responses. Preserve textual error and boolean fields when present. |
| Integration `IntegrationError` | OK `1`; session expired `8`; pending `10`; missing information `7`; invalid timestamp `11` | Success is `1`; retain `seconds_to_wait` on subscription replies without inventing a retry policy. |
| Avatar `AvatarError` | OK `1`, critical `2`, invalid session `3` | Success is `1`. |
| Chat `ChatRequestReturnCode` | Success `1`; connection `2`, internal `3`, request `4`, expired session `5`, account creation disabled `6` | Success is `1`; preserve nested `ErrorHandling.message`. |
| Messenger `MessengerConnectorReturnCodesClient` | Account created `1`; creation failed `100`, already exists `101` | Success is `1`; do not automatically treat already-exists as success. |
| Synchronization `SyncStatus` | In sync `300`, not in sync `301`, not in database `302`, collision `303`, over limit `304` | These are synchronization outcomes, not a generic boolean. Return them without automatic merging or retrying writes. |
| Add-on `ReturnCode` | Not found `1`, platform not found `2`, up to date `3`, update `4`, group `5` | Return a typed outcome; both up-to-date and update are useful results, with different payload interpretation. |
| Login management replies | `AuthTokenExpireReply` / `AccountStatusReply` have `success` and `error_msg`; token-list and suspension-reason replies have no application status | Use the declared boolean where available; absence of an error field must not be filled by guessed status codes. |
Response status fields vary in spelling and nesting (`error`, `error_code`, `errorcode`, `returncode`, `return_code`, `error_handling`). A universal reflective rule such as “an enum field named error must equal zero” is incorrect. A missing optional nested return-code message is also distinct from an explicit success.
## Streaming and opaque payloads
`com.teamspeak.push.proto.PushService/longPull` accepts `google.protobuf.Empty` and streams `Message { bytes payload = 1; }`. The request has no session or token field. Cancellation follows stream drop/cancellation at the transport layer. The schema provides no replay cursor, acknowledgment, reconnect backoff, heartbeat, or resume semantics; reconnecting cannot promise lossless delivery.
A different package defines `push.PushNotification` and `push.IntermediateData`, each with an `Any` payload, plus `SimpleNotification`, `ContactAvatarChanged`, `TsChatAvatarChanged` and `AuthTokenUsed`. The schema does **not** say whether the bytes emitted by `longPull` contain either of those envelopes, compressed data, or another encoding. Make decoding explicit and fallible. Support standard protobuf `Any` type URLs and preserve unknown payloads; do not choose an envelope by trial decoding alone, because protobuf accepts many unrelated byte sequences.
The `SimpleNotification` enum distinguishes sync-data changes (`1`), session expiry (`2`), and contact-homebase changes (`3`). `relogin_neccessary` is an independent boolean. Nothing in the schema specifies whether to obey it automatically or how to rebuild application state.
## Synchronization, identities and transfers
Synchronization requests carry the session, class/version list, global version and sync version. Each item detail has UUID, item version, opaque blob and the field `item_delte_on_server`. The data-serialization schema defines bookmarks, identities, hotkey profiles, whispers, add-ons, configuration, folders, group chats and contacts. Its `Item_Data.item_content` oneof permits typed local decoding, but the schema does not state that network `item_blob` is plain `Item_Data` rather than encrypted or wrapped. Expose codecs without automatic encryption/decryption assumptions. Preserve class/version IDs and collisions; never overwrite conflicting data without caller policy.
Signed identity, avatar, badge, integration, and Matrix identifier structures expose key, certificate, signature and timestamp bytes. They do not identify a signing algorithm, canonical signed bytes, certificate chain policy, signature verification procedure, or timestamp unit. Returning these structures is supported; inventing cryptographic verification is not.
Avatar/file RPCs return signed URLs and metadata. The schemas do not state the HTTP upload method, required headers, multipart layout, checksum policy, or URL expiration. Requesting an upload/download URL is part of the gRPC client surface. Transferring bytes through the URL requires deployment-specific HTTP details and should not be guessed.
## Schema quality and compilation cautions
- **Malformed bundled Google option syntax:** the supplied `google/protobuf/descriptor.proto`, beginning around line 358, serializes repeated/message-valued options with invalid source syntax, for example `targets = TARGET_TYPE_FIELD, TARGET_TYPE_FILE` and `edition_defaults = [value: ...]`. `google/protobuf/cpp_features.proto` has the same issue. Prefer compatible compiler-vendored standard protobuf includes when compiling optional infrastructure, and retain the supplied files as original source material. The application schemas do not need either malformed file. This finding is a source inspection result; compiler validation results belong to the crate's verification log.
- **Mixed presence semantics:** proto2 optional scalars must remain optional. For example, an absent bookmark `send_mytsid_on_server` has declared default `true`; reading its raw `Option<bool>` as `false` would change behavior. Proto3 scalars generally do not record whether an explicit default was sent. Message fields and oneofs retain presence.
- **Preserve original spelling:** wire/source symbols include `ERRIR_RENEWAL_TOKEN_INVALID`, `item_delte_on_server`, `relogin_neccessary`, lowercase `requestExpireTime`/`replyExpireTime`, mixed field casing and `Status_public_license_id`. Idiomatic Rust accessors may differ, but field numbers, enum numbers, full protobuf names and RPC paths must remain exact.
- **Reserved and deprecated fields:** respect declared reserved numbers; deprecated OTP QR-code bytes/MIME fields remain part of the wire format. Do not delete them from generated bindings.
- **Unknown enums and fields:** expose enum integers when no named variant is known. Prost generated messages generally discard unknown protobuf fields when decoded and re-encoded; use original bytes or a suitable dynamic representation when lossless forwarding matters.
- **No validation contract:** the archive includes `validate.proto` definitions, but the application schemas do not attach validation rules. Required business fields, string formats, UUID validation, quotas, size limits, and timestamp units are unspecified. Avoid rejecting otherwise encodable requests based on guessed rules.
- **Mutating operations and retries:** RPC names include account deletion, reset, badge management, key updates and voice-server changes, but there are no application idempotency annotations or request IDs. Retrying arbitrary failed RPCs can repeat side effects. Expose timeouts and caller-controlled retries.
- **Infrastructure is not application functionality:** the other 100 files describe Google protobuf/RPC/CEL, Envoy, xDS, UDPA, validation and gRPC support types. Their only additional service is Envoy load reporting. An optional infrastructure feature can expose these bindings without treating them as ordinary application API endpoints.
## Application RPC catalog
All method names and request/response names below are the original protobuf spelling. Request/response cells use names as declared in the source; shared parent-package types resolve by protobuf lexical scoping. The JSON inventory additionally records fully resolved type names. Each section states the full service name; the gRPC path is `/<full service name>/<method>`. “Body fields” lists evident session/credential fields, not a claim about required authorization. “None declared” never means public access.
### `com.teamspeak.myteamspeak.proto.addon.UserAddonService`
Source: `myteamspeak_addon.proto`. 1 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `requestDownload` | `GetDownload` | `Download` | None declared |
### `com.teamspeak.myteamspeak.proto.integration.IntegrationUserService`
Source: `myteamspeak_integration_user.proto`. 4 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `getIntegrationUserStatus` | `RequestIntegrationUserStatus` | `IntegrationStatusUserResponse` | `session` |
| `requestBindIntegration` | `RequestBindData` | `RequestBindResponse` | `session` |
| `requestUnbindIntegration` | `RequestUnbindData` | `RequestBindResponse` | `session` |
| `getUserIntegrationSubscriptionInfo` | `UserIntegrationSubscriptionInfoRequest` | `UserIntegrationSubscriptionInfoResponse` | `session_id` |
### `com.teamspeak.myteamspeak.proto.login.LoginService`
Source: `myteamspeak_login.proto`. 12 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `session` | `Session` | `LoginStatus` | `session` |
| `deleteSession` | `Session` | `LoginStatus` | `session` |
| `login` | `LoginData` | `LoginSession` | `email`, `password`; optional OTP/device fields |
| `requestAuthToken` | `AuthTokenRequest` | `AuthTokenReply` | `email`, `password` |
| `loginWithAuthToken` | `AuthTokenLogin` | `LoginSession` | `auth_token` |
| `loginWithRenewalToken` | `RenewalTokenLogin` | `LoginSession` | `renewal_token`, `auth_token` |
| `getAuthTokenList` | `AuthTokenListRequest` | `AuthTokenListReply` | `email`, `password` |
| `expireAuthTokenAccess` | `AuthTokenExpireRequest` | `AuthTokenExpireReply` | `email`, `password` |
| `deleteAccount` | `AccountStatusInfo` | `AccountStatusReply` | None; `email` is a target identifier |
| `suspendAccount` | `AccountStatusInfo` | `AccountStatusReply` | None; `email` is a target identifier |
| `reactivateAccount` | `AccountStatusInfo` | `AccountStatusReply` | None; `email` is a target identifier |
| `listSuspensionReasonForUser` | `AccountEmail` | `SuspensionReasonForUserReply` | None; `email` is a target identifier |
### `com.teamspeak.myteamspeak.proto.messengerconnector.MessengerConnectorClientService`
Source: `myteamspeak_messenger_connector_client.proto`. 1 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `requestCreateMessengerAccount` | `RequestCreateMessengerAccountRequest` | `RequestCreateMessengerAccountReply` | `session` |
### `com.teamspeak.myteamspeak.proto.synchronization.SynchronizationService`
Source: `myteamspeak_synchronization.proto`. 2 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `requestServerItems` | `Sync_Request_ItemClasses` | `Sync_Reply_ItemClasses` | `session` |
| `synchronizeItems` | `Sync_Request_ItemClasses` | `Sync_Reply_ItemClasses` | `session` |
### `com.teamspeak.myteamspeak.proto.tschat.ChatRequests`
Source: `myteamspeak_tschat.proto`. 16 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `createAccount` | `AuthenticatedUser` | `CreateAccountResponse` | `session`; `matrix_id` |
| `moveHome` | `MoveRequest` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `getContactList` | `AuthenticatedUser` | `ContactList` | `session`; `matrix_id` |
| `updateContact` | `ContactRequest` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `updateContactList` | `ContactRequestList` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `removeContact` | `ContactRequest` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `setPrimaryIdentifier` | `IdentifierRequest` | `TschatIdentifierList` | `user.session`; Matrix ID in `user` |
| `addIdentifier` | `IdentifierRequest` | `TschatIdentifierList` | `user.session`; Matrix ID in `user` |
| `removeIdentifier` | `IdentifierRequest` | `TschatIdentifierList` | `user.session`; Matrix ID in `user` |
| `getActiveIdentifierList` | `AuthenticatedUser` | `TschatIdentifierList` | `session`; `matrix_id` |
| `getAllowedIdentifierList` | `AuthenticatedUser` | `TschatIdentifierList` | `session`; `matrix_id` |
| `getGroupSessionData` | `GroupSessionRequest` | `GroupSessionResponse` | `user.session`; Matrix ID in `user` |
| `uploadGroupSessionData` | `GroupSessionRequest` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `clearAllGroupSessions` | `AuthenticatedUser` | `ErrorHandling` | `session`; `matrix_id` |
| `clearGroupSessions` | `GroupSessionRequest` | `ErrorHandling` | `user.session`; Matrix ID in `user` |
| `requestSignedAllowedIdentifierList` | `AuthenticatedUser` | `SignedAllowedIdentifier` | `session`; `matrix_id` |
### `com.teamspeak.myteamspeak.proto.user.UserAccountService`
Source: `myteamspeak_user.proto`. 30 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `addUser` | `UserData` | `ReturnCode` | `session`; `login` / `login_old` credentials |
| `updateUser` | `UserData` | `ReturnCode` | `session`; `login` / `login_old` credentials |
| `getBackupKey` | `UserLogin` | `BackupKeyData` | `email`, `password` |
| `getBadges` | `Session` | `UserBadgesList` | `session` |
| `redeemBadgeCode` | `BadgeCode` | `RedeemBadgeCodeResponse` | `session` |
| `setNewUserPublicKey` | `NewUserPublicKeyData` | `NewUserPublicKeyDataResponse` | `session.session` |
| `requestContactsAvatar` | `RequestContactsAvatarInfoRequest` | `RequestContactsAvatarInfoResponse` | `session` |
| `getSignedBadges` | `Session` | `UserBadgesSignedResponse` | `session` |
| `requestVoiceServer` | `VoiceServerRequest` | `VoiceServerResponse` | `session` |
| `requestVoiceServerLocation` | `SpawnVoiceServerLocationRequest` | `SpawnVoiceServerLocationResponse` | `session` |
| `deleteSpawnedVoiceServer` | `VoiceServerRequest` | `ReturnCode` | `session` |
| `listSpawnedVoiceServer` | `Session` | `SpawnedVoiceServerListResponse` | `session` |
| `startVoiceServer` | `VoiceServerRequest` | `VoiceServerResponse` | `session` |
| `stopVoiceServer` | `VoiceServerRequest` | `VoiceServerResponse` | `session` |
| `readVoiceServerStatus` | `VoiceServerRequest` | `VoiceServerResponse` | `session` |
| `requestAvatarSignedUrl` | `AvatarSignedUrlRequest` | `AvatarSignedUrlResponse` | `session` |
| `requestUploadAvatar` | `RequestUploadAvatarRequest` | `RequestUploadAvatarResponse` | `session` |
| `requestDeleteAvatar` | `RequestDeleteAvatarInfoRequest` | `ReturnCode` | `session` |
| `changeEmail` | `EmailChange` | `ReturnCode` | `session`; `validationKey`, `currentPw`, `newPw` |
| `resetAccount` | `ResetAccountRequest` | `ReturnCode` | `session`, `myts_id.session.session` |
| `updateUserDescription` | `UpdateUserDescriptionRequest` | `ReturnCode` | `session` |
| `requestUploadFile` | `UploadFileRequest` | `FileInfo` | `session` |
| `requestDownloadFile` | `DownloadFileRequest` | `FileInfo` | `session` |
| `generateOtpSetupSecret` | `TwoFactorAuthTypeRequest` | `OtpSecretResponse` | `session`; `user_login` credentials |
| `updateTwoFactorAuthType` | `UpdateTwoFactorAuthTypeRequest` | `ReturnCode` | `session` |
| `confirmTwoFactorAuthTypeOtp` | `TwoFactorAuthTypeOtpConfirmationRequest` | `ReturnCode` | `session`; `user_login` credentials; `otp` |
| `removeTwoFactorAuthType` | `TwoFactorAuthTypeRequest` | `ReturnCode` | `session`; `user_login` credentials |
| `getTwoFactorAuthType` | `Session` | `TwoFactorAuthTypeResponse` | `session` |
| `registerFirebasePush` | `RegisterFirebasePush` | `ReturnCode` | `session` |
| `getAccountData` | `AccountDataRequest` | `UserAccountData` | `session` |
### `com.teamspeak.myteamspeak.proto.management.user.UserManagementService`
Source: `myteamspeak_user_management.proto`. 39 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `listUser` | `SearchLimit` | `UserLightDataList` | None declared |
| `getUserInfo` | `Request` | `UserLightData` | `session` |
| `getKey` | `Request` | `KeyData` | `session` |
| `deleteUser` | `Request` | `UserManagementReturnCode` | `session` |
| `activateUser` | `Activation` | `UserManagementReturnCode` | `email`, activation `key` |
| `requestNewActivation` | `Activation` | `UserManagementReturnCode` | `email`, activation `key` |
| `setAddonDevStatus` | `AddonDevRequest` | `AddonDevReturnCode` | None declared |
| `requestPasswordReset` | `PasswordResetRequest` | `UserManagementReturnCode` | `email`, reset `key`, new `password` |
| `resetPassword` | `PasswordResetRequest` | `UserManagementReturnCode` | `email`, reset `key`, new `password` |
| `generateBadgeCodes` | `BadgeCodesRequest` | `BadgeCodes` | `session` |
| `changeEmail` | `EmailChange` | `UserManagementReturnCode` | `session`; `validationKey`, `currentPw`, `newPw` |
| `changeEmail2` | `EmailChange` | `UserManagementReturnCode` | `session`; `validationKey`, `currentPw`, `newPw` |
| `changeEmail3` | `EmailChange` | `UserManagementReturnCode` | `session`; `validationKey`, `currentPw`, `newPw` |
| `assignBadge` | `AssignBadgeRequest` | `UserManagementReturnCode` | `session` |
| `getUserData` | `Request` | `UserFullData` | `session` |
| `forceRename` | `UserRenameRequest` | `UserManagementReturnCode` | `session` |
| `addBadge` | `AddBadgeRequest` | `AddBadgeReturnCode` | `session` |
| `listBadges` | `Session` | `ListBadgesReturnCode` | `session` |
| `getBadgeStatistics` | `BadgeStatisticsRequest` | `BadgeStatisticsReturnCode` | `session` |
| `deleteBadge` | `Request` | `DeleteBadgeReturnCode` | `session` |
| `updateBadge` | `UpdateBadgeRequest` | `AddBadgeReturnCode` | `addBadgeRequest.session` |
| `updateBadgeCode` | `BadgeCodesRequest` | `BadgeCodeReturnCode` | `session` |
| `deleteBadgeCode` | `BadgeCodesRequest` | `UserManagementReturnCode` | `session` |
| `listBadgeCodes` | `BadgeCodesRequest` | `ListBadgeCodesResponse` | `session` |
| `addOAuthClient` | `OAuthClientRequest` | `OAuthClientReturnCode` | `session` |
| `updateOAuthClient` | `OAuthClientRequest` | `OAuthClientReturnCode` | `session` |
| `deleteOAuthClient` | `OAuthClientRequest` | `UserManagementReturnCode` | `session` |
| `listOAuthClients` | `Request` | `ListOAuthClientsReturnCode` | `session` |
| `searchUser` | `SearchTerm` | `UserLightDataList` | `session` |
| `addPermission` | `PermissionRequest` | `UserManagementReturnCode` | `session` |
| `removePermission` | `PermissionRequest` | `UserManagementReturnCode` | `session` |
| `removeBadgeFromUser` | `AssignBadgeRequest` | `UserManagementReturnCode` | `session` |
| `createCommunity` | `TSCommunityRequest` | `TSCommunityList` | `session` |
| `listCommunities` | `TSCommunityListRequest` | `TSCommunityList` | `request.session` |
| `updateCommunity` | `TSCommunityRequest` | `TSCommunityList` | `session` |
| `setRenameAllowance` | `RenameAllowanceRequest` | `UserManagementReturnCode` | `session` |
| `deleteTSChatAccount` | `Request` | `UserManagementReturnCode` | `session` |
| `getUserStatistics` | `UserStatisticsRequest` | `UserStatisticsResponse` | `session` |
| `getAllUserStatistics` | `UserStatisticsRequest` | `AllUserStatisticsResponse` | `session` |
### `com.teamspeak.push.proto.PushService`
Source: `teamspeak_push_grpc.proto`. 1 methods.
| Method | Request | Response | Body fields |
| --- | --- | --- | --- |
| `longPull` | `google.protobuf.Empty` | `stream Message` | None declared |
## Application enum catalog
All enum values, including nested enum values and sparse numeric assignments, are recorded in the JSON inventory. Counts below count explicitly declared variants, not integer ranges. Enum values whose names sound successful must be interpreted in their owning response domain.
| Fully qualified enum | Variants |
| --- | ---: |
| `com.teamspeak.sync.proto.Bookmark_Data.SubscriptionMode` | 3 |
| `com.teamspeak.sync.proto.Whisper_list_data.WhisperListType` | 3 |
| `com.teamspeak.sync.proto.Whisper_list_data.WhisperEntry.WhisperEntryType` | 3 |
| `com.teamspeak.sync.proto.HotkeyProfile_data.Hotkey.OS` | 3 |
| `com.teamspeak.sync.proto.Contact.NotificationPreference` | 4 |
| `com.teamspeak.sync.proto.Item_Data.Manipulation_Flag` | 4 |
| `com.teamspeak.blacklist.BlacklistInfoResponse.Result` | 4 |
| `com.teamspeak.myteamspeak.proto.addon.ApiType` | 7 |
| `com.teamspeak.myteamspeak.proto.addon.ReturnCode` | 6 |
| `com.teamspeak.myteamspeak.proto.addon.Platform` | 7 |
| `com.teamspeak.myteamspeak.proto.addon.Status` | 7 |
| `com.teamspeak.myteamspeak.proto.AvatarError` | 4 |
| `com.teamspeak.myteamspeak.proto.AvatarState` | 5 |
| `com.teamspeak.myteamspeak.proto.AddonDevStatus` | 7 |
| `com.teamspeak.myteamspeak.proto.LoginOrigin` | 2 |
| `com.teamspeak.myteamspeak.proto.ErrorCommon` | 18 |
| `com.teamspeak.myteamspeak.proto.integration.SpecifierType` | 5 |
| `com.teamspeak.myteamspeak.proto.integration.IntegrationType` | 3 |
| `com.teamspeak.myteamspeak.proto.integration.IntegrationBindingStatus` | 4 |
| `com.teamspeak.myteamspeak.proto.integration.IntegrationError` | 12 |
| `com.teamspeak.myteamspeak.proto.integration.ResponseType` | 5 |
| `com.teamspeak.myteamspeak.proto.messengerconnector.MessengerConnectorReturnCodesClient` | 4 |
| `com.teamspeak.myteamspeak.proto.push.SimpleNotificationType` | 4 |
| `com.teamspeak.myteamspeak.proto.tschat.ChatRequestReturnCode` | 7 |
| `com.teamspeak.myteamspeak.proto.user.UserAccountDataSelector` | 15 |
| `com.teamspeak.myteamspeak.proto.user.AuthType` | 2 |
| `com.teamspeak.myteamspeak.proto.user.ErrorReturnCode` | 34 |
| `com.teamspeak.myteamspeak.proto.management.user.TSCommunityState` | 4 |
| `com.teamspeak.myteamspeak.proto.management.user.UserSearchCriterionSelector` | 8 |
| `com.teamspeak.myteamspeak.proto.management.user.UserManagementErrorReturnCode` | 41 |
| `com.teamspeak.myteamspeak.proto.synchronization.SyncStatus` | 10 |
| `com.teamspeak.myteamspeak.proto.synchronization.Item_Class` | 9 |
| `com.teamspeak.myteamspeak.proto.synchronization.Sync_Version` | 2 |
## All archive packages
These are source-level counts across the entire archive. “App” marks packages declared by root application files. Infrastructure bindings may use compiler-vendored Google definitions in place of malformed bundled sources, so generated descriptor counts can differ from these archive counts.
| Package | Scope | Files | Messages | Enums | Services | RPCs |
| --- | --- | ---: | ---: | ---: | ---: | ---: |
| `com.teamspeak.account.proto` | App | 1 | 8 | 0 | 0 | 0 |
| `com.teamspeak.blacklist` | App | 1 | 2 | 1 | 0 | 0 |
| `com.teamspeak.myteamspeak.proto` | App | 2 | 23 | 5 | 0 | 0 |
| `com.teamspeak.myteamspeak.proto.addon` | App | 1 | 4 | 4 | 1 | 1 |
| `com.teamspeak.myteamspeak.proto.cloud` | App | 1 | 2 | 0 | 0 | 0 |
| `com.teamspeak.myteamspeak.proto.integration` | App | 3 | 21 | 5 | 1 | 4 |
| `com.teamspeak.myteamspeak.proto.login` | App | 1 | 12 | 0 | 1 | 12 |
| `com.teamspeak.myteamspeak.proto.management.user` | App | 1 | 43 | 3 | 1 | 39 |
| `com.teamspeak.myteamspeak.proto.messengerconnector` | App | 1 | 5 | 1 | 1 | 1 |
| `com.teamspeak.myteamspeak.proto.namedserver` | App | 1 | 4 | 0 | 0 | 0 |
| `com.teamspeak.myteamspeak.proto.push` | App | 1 | 6 | 1 | 0 | 0 |
| `com.teamspeak.myteamspeak.proto.synchronization` | App | 2 | 4 | 3 | 1 | 2 |
| `com.teamspeak.myteamspeak.proto.tschat` | App | 1 | 19 | 1 | 1 | 16 |
| `com.teamspeak.myteamspeak.proto.user` | App | 1 | 55 | 3 | 1 | 30 |
| `com.teamspeak.proto.client_cache` | App | 1 | 1 | 0 | 0 | 0 |
| `com.teamspeak.proto.revocation` | App | 1 | 1 | 0 | 0 | 0 |
| `com.teamspeak.push.proto` | App | 1 | 1 | 0 | 1 | 1 |
| `com.teamspeak.revocation_list` | App | 1 | 1 | 0 | 0 | 0 |
| `com.teamspeak.sync.proto` | App | 1 | 16 | 6 | 0 | 0 |
| `envoy.annotations` | Infrastructure | 1 | 0 | 0 | 0 | 0 |
| `envoy.config.accesslog.v3` | Infrastructure | 1 | 16 | 2 | 0 | 0 |
| `envoy.config.cluster.v3` | Infrastructure | 4 | 29 | 9 | 0 | 0 |
| `envoy.config.core.v3` | Infrastructure | 16 | 97 | 13 | 0 | 0 |
| `envoy.config.endpoint.v3` | Infrastructure | 3 | 16 | 0 | 0 | 0 |
| `envoy.config.listener.v3` | Infrastructure | 5 | 20 | 2 | 0 | 0 |
| `envoy.config.rbac.v3` | Infrastructure | 1 | 11 | 3 | 0 | 0 |
| `envoy.config.route.v3` | Infrastructure | 3 | 62 | 6 | 0 | 0 |
| `envoy.config.trace.v3` | Infrastructure | 1 | 2 | 0 | 0 | 0 |
| `envoy.data.accesslog.v3` | Infrastructure | 1 | 11 | 4 | 0 | 0 |
| `envoy.extensions.clusters.aggregate.v3` | Infrastructure | 1 | 1 | 0 | 0 | 0 |
| `envoy.extensions.filters.common.fault.v3` | Infrastructure | 1 | 5 | 1 | 0 | 0 |
| `envoy.extensions.filters.http.fault.v3` | Infrastructure | 1 | 3 | 0 | 0 | 0 |
| `envoy.extensions.filters.http.gcp_authn.v3` | Infrastructure | 1 | 4 | 0 | 0 | 0 |
| `envoy.extensions.filters.http.rbac.v3` | Infrastructure | 1 | 2 | 0 | 0 | 0 |
| `envoy.extensions.filters.http.router.v3` | Infrastructure | 1 | 2 | 0 | 0 | 0 |
| `envoy.extensions.filters.http.stateful_session.v3` | Infrastructure | 1 | 2 | 0 | 0 | 0 |
| `envoy.extensions.filters.network.http_connection_manager.v3` | Infrastructure | 1 | 21 | 5 | 0 | 0 |
| `envoy.extensions.http.stateful_session.cookie.v3` | Infrastructure | 1 | 1 | 0 | 0 | 0 |
| `envoy.extensions.transport_sockets.http_11_proxy.v3` | Infrastructure | 1 | 1 | 0 | 0 | 0 |
| `envoy.extensions.transport_sockets.tls.v3` | Infrastructure | 3 | 18 | 4 | 0 | 0 |
| `envoy.extensions.upstreams.http.v3` | Infrastructure | 1 | 4 | 0 | 0 | 0 |
| `envoy.service.discovery.v3` | Infrastructure | 1 | 13 | 0 | 0 | 0 |
| `envoy.service.load_stats.v3` | Infrastructure | 1 | 2 | 0 | 1 | 1 |
| `envoy.type.http.v3` | Infrastructure | 2 | 5 | 0 | 0 | 0 |
| `envoy.type.matcher.v3` | Infrastructure | 8 | 15 | 0 | 0 | 0 |
| `envoy.type.metadata.v3` | Infrastructure | 1 | 7 | 0 | 0 | 0 |
| `envoy.type.tracing.v3` | Infrastructure | 1 | 5 | 0 | 0 | 0 |
| `envoy.type.v3` | Infrastructure | 4 | 6 | 2 | 0 | 0 |
| `google.api.expr.v1alpha1` | Infrastructure | 2 | 25 | 3 | 0 | 0 |
| `google.protobuf` | Infrastructure | 9 | 56 | 24 | 0 | 0 |
| `google.rpc` | Infrastructure | 1 | 1 | 0 | 0 | 0 |
| `grpc.channelz.v2` | Infrastructure | 2 | 16 | 1 | 0 | 0 |
| `grpc.lookup.v1` | Infrastructure | 1 | 7 | 0 | 0 | 0 |
| `pb` | Infrastructure | 1 | 1 | 1 | 0 | 0 |
| `udpa.annotations` | Infrastructure | 5 | 6 | 1 | 0 | 0 |
| `validate` | Infrastructure | 1 | 23 | 1 | 0 | 0 |
| `xds.annotations.v3` | Infrastructure | 1 | 4 | 1 | 0 | 0 |
| `xds.core.v3` | Infrastructure | 6 | 8 | 1 | 0 | 0 |
| `xds.type.matcher.v3` | Infrastructure | 3 | 13 | 0 | 0 | 0 |
### Ancillary service
`envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats` is bidirectional streaming from `LoadStatsRequest` to `LoadStatsResponse`. It is an infrastructure protocol separate from the 106 application methods.
## What requires server-side knowledge
A running integration still requires endpoint(s), authorization metadata if any, deployment TLS material, credential conventions, and any encrypted payload/signature conventions. User-management pagination includes both cursor-like `SearchLimit.last_uuid` and offset/limit requests; neither establishes ordering guarantees or termination rules for automatic pagination. No API version compatibility range, rate-limit policy, server time unit, or guaranteed default behavior is documented. These omissions should stay explicit in a full-featured client rather than being replaced by guessed protocol behavior.
+42
View File
@@ -0,0 +1,42 @@
# Verification
Verified on 2026-10-04 on Linux x86_64 with Rust/Cargo 1.99.0, using the included `Cargo.lock` (tonic 0.14.6, prost 0.14.4, prost-reflect 0.16.5). Dependencies are fetched by Cargo; protobuf compilation uses `protoc-bin-vendored` 3.2.0.
## Checks
| Check | Result |
| --- | --- |
| All features, all targets | 25 library tests + 4 schema tests + 5 local transport tests passed; all four examples compile |
| No default features | 15 library tests + 3 schema tests passed; 4 documentation examples compile/run |
| Default-feature documentation tests | 4 passed |
| Clippy, all features and targets, warnings denied | Passed |
| Rustfmt check | Passed |
| Rustdoc, all features, no dependencies | Generated successfully |
| Original protobuf source integrity | All 123 files match the recorded SHA-256 hashes |
## Reproduce
```sh
cargo fmt --all --check
cargo test --locked --all-features --all-targets
cargo test --locked --no-default-features
cargo test --locked --doc
cargo clippy --locked --all-features --all-targets -- -D warnings
cargo doc --locked --all-features --no-deps
```
The GitHub Actions workflow runs these checks using stable Rust. Test counts across feature configurations overlap; they are not separate suites to sum together.
## What was exercised
Local tonic servers test the exact original HTTP/2 method paths for unary add-on download lookup and push streaming, typed request/response payloads, response metadata, default ASCII/binary metadata, per-call metadata overrides, preserved gRPC error codes/details/metadata, streamed frames, normal EOF, terminal stream errors, and cancellation of a pending unary RPC by its configured deadline. These tests use ephemeral localhost ports and deterministic server shutdown.
Unit/schema tests cover metadata rotation and sensitivity, endpoint validation, timeout precedence, expected login/session/deletion success codes, unknown codes, nested body session assignment, checked protobuf `Any` URLs, malformed payload rejection, opt-in push envelopes, proto2 presence, a fixed protobuf wire vector, complete application service/RPC counts, cached descriptors, protobuf JSON naming/enums/base64/int64/Any, and unknown JSON/wire behavior.
## Scope and remaining integration work
No deployment endpoint, credentials, or server implementation was supplied, so no live service call was made. TLS/mTLS examples compile; they were not exercised against a certificate-bearing test or production server. Gzip support compiles in the all-feature build; compressed traffic was not separately exercised. Linux is the only tested build host.
Business rules absent from the schemas remain caller/server responsibilities: credential encoding, cryptography, signed-URL HTTP transfer details, opaque blob interpretation, renewal policy, authorization requirements, and synchronization conflict resolution. Every declared request/response field and application RPC remains accessible.
The supplied Google `descriptor.proto` and `cpp_features.proto` contain malformed option syntax. Original files remain unchanged; builds use compiler-matched standard Google imports, and the compiler-only `pb.CppFeatures` type is excluded. The application and optional infrastructure bindings both compile with this documented strategy.
File diff suppressed because it is too large. Load diff
+26
View File
@@ -0,0 +1,26 @@
use schema_api::{
tonic::transport::{Certificate, ClientTlsConfig, Identity},
ApiClient,
};
use std::{env, error::Error, fs};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut tls = ClientTlsConfig::new()
.ca_certificate(Certificate::from_pem(fs::read(env::var("API_CA_PEM")?)?));
if let Ok(domain) = env::var("API_TLS_DOMAIN") {
tls = tls.domain_name(domain);
}
if let Ok(cert_path) = env::var("API_CLIENT_CERT_PEM") {
tls = tls.identity(Identity::from_pem(
fs::read(cert_path)?,
fs::read(env::var("API_CLIENT_KEY_PEM")?)?,
));
}
let _client = ApiClient::builder(env::var("API_ENDPOINT")?)?
.tls_config(tls)?
.connect()
.await?;
println!("Connected with custom TLS configuration");
Ok(())
}
+24
View File
@@ -0,0 +1,24 @@
fn main() {
let pool = schema_api::reflection::descriptor_pool();
for service in pool.services() {
println!("{}", service.full_name());
for method in service.methods() {
println!(
" {}({}{}) -> {}{}",
method.name(),
if method.is_client_streaming() {
"stream "
} else {
""
},
method.input().full_name(),
if method.is_server_streaming() {
"stream "
} else {
""
},
method.output().full_name(),
);
}
}
}
+34
View File
@@ -0,0 +1,34 @@
use schema_api::{api, ApiClient, SessionRequest, SessionToken};
use std::{env, error::Error, time::Duration};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let client = ApiClient::builder(env::var("API_ENDPOINT")?)?
.connect_timeout(Duration::from_secs(10))
.request_timeout(Duration::from_secs(30))
.connect()
.await?;
// Credential encoding is server-defined; this example passes the supplied values verbatim.
let reply = client
.login()
.login(api::LoginData {
email: env::var("API_EMAIL")?,
password: env::var("API_PASSWORD")?,
otp: env::var("API_OTP").unwrap_or_default(),
device_id: env::var("API_DEVICE_ID").unwrap_or_default(),
device_name: "Rust API client".into(),
..Default::default()
})
.await?
.into_inner();
let session = SessionToken::try_from(&reply)?;
println!("Login succeeded");
let status = client
.login()
.session(api::Session::default().with_session(&session))
.await?
.into_inner();
schema_api::session::validate_session_status(&status)?;
println!("Session is valid");
Ok(())
}
+28
View File
@@ -0,0 +1,28 @@
use schema_api::{
tonic::metadata::{MetadataKey, MetadataMap, MetadataValue},
ApiClient,
};
use std::{env, error::Error};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// The schemas do not specify push authentication. Supply your server's metadata contract.
let mut headers = MetadataMap::new();
if let Ok(name) = env::var("API_PUSH_HEADER") {
let key: MetadataKey<_> = name.parse()?;
let mut value: MetadataValue<_> = env::var("API_PUSH_VALUE")?.parse()?;
value.set_sensitive(true);
headers.insert(key, value);
}
let client = ApiClient::builder(env::var("API_ENDPOINT")?)?
.metadata(headers)
.connect()
.await?;
let mut stream = client.push().long_pull(()).await?.into_inner();
while let Some(message) = stream.message().await? {
println!("Received {} opaque payload bytes", message.payload.len());
// If your server uses this envelope, explicitly decode it with:
// let notification = schema_api::wire::decode_push_notification(&message)?;
}
Ok(())
}
+84
View File
@@ -0,0 +1,84 @@
syntax = "proto2";
package com.teamspeak.account.proto;
import "myteamspeak_common.proto";
import "myteamspeak_integration_common.proto";
import "myteamspeak_avatar_common.proto";
import "myteamspeak_tschat.proto";
message Account_Session {
optional string id = 1;
}
message Account_Data {
optional string email = 1;
optional string password = 2;
optional string uuid = 3;
optional string user_name = 4;
optional bytes encryption_password = 5;
optional string global_items_uuid = 10;
optional string class_bookmark_version_uuid = 11;
optional string class_identity_version_uuid = 12;
optional string class_add_on_version_uuid = 13;
optional string class_config_version_uuid = 14;
optional string class_hotkey_profile_version_uuid = 15;
optional string class_whisper_list_version_uuid = 16;
optional string class_item_folder_version_uuid = 17;
optional string class_item_room_category_version_uuid = 18;
optional string class_group_chats_version_uuid = 19;
optional string class_contact_version_uuid = 20;
optional Account_Session session = 50;
repeated myteamspeak.proto.Limits limits = 51;
optional bytes key = 52;
optional bytes backup_ed_key = 53;
optional myteamspeak.proto.MyTeamSpeakIdData myteamspeakid_data = 54;
repeated IntegrationCache integration_cache = 55;
message IntegrationCache {
repeated string user_integration_id = 1;
optional myteamspeak.proto.integration.IntegrationResponseList integration_cache = 2;
}
optional myteamspeak.proto.MyTSUserCertificate myteamspeakid_user_certificate = 56;
optional myteamspeak.proto.AvatarData avatar_data = 57;
optional string push_token = 58;
optional Permissions permissions = 59;
optional myteamspeak.proto.tschat.MatrixIdentifierToken identifier_token = 61;
optional AuthTokenCache auth_token_cache = 62;
message AuthTokenCache {
optional string auth_token = 1;
optional string renewal_token = 2;
}
optional string firebase_device_token = 63;
optional string otp_renewal_token = 64;
optional string device_id = 65;
}
message TS_Sync_Account {
optional string passphrase = 1;
}
message Permissions {
repeated string permission = 1;
}
message MyTSID_Verification_Token {
optional bytes verification_sign = 1;
optional uint64 sign_timestamp = 2;
optional bytes user_pub_key = 3;
optional bytes pub_sign = 4;
optional bytes pub_sign_cert = 5;
optional uint64 ac_time = 6;
optional bytes mytsid = 7;
}
message Auth_Token_Package {
optional uint32 version = 1;
optional string auth_token = 2;
optional string encrypted_encryption_password = 3;
optional string encryption_tag = 4;
optional string iv = 5;
}
+220
View File
@@ -0,0 +1,220 @@
syntax = "proto2";
package com.teamspeak.sync.proto;
import "synchronization_common.proto";
message Bookmark_Data {
optional string name = 1;
optional string address = 2;
optional uint32 port = 3;
optional string nickname = 4;
optional string phonetic_nickname = 5;
optional string identity = 6;
optional string server_password = 7;
optional string default_channel = 8;
optional string default_channel_password = 9;
optional uint64 default_channel_id = 10;
optional string capture_profile = 11;
optional string playback_profile = 12;
optional string hotkey_profile = 13;
optional bool autoconnect = 14;
optional string server_uid = 15;
optional string server_icon = 16;
optional string sound_pack = 17;
optional bool show_server_query_clients = 18;
optional SubscriptionMode subscription_mode = 19;
enum SubscriptionMode {
Undefined = 0;
All = 1;
Current = 2;
}
repeated uint64 subscribed_channel_ids = 20;
repeated ChannelPassword channel_passwords = 21;
message ChannelPassword {
optional uint64 channel_id = 1;
optional string password = 2;
}
optional bool send_mytsid_on_server = 22 [default = true];
optional bool announce_to_chat = 23 [default = false];
optional string resolved_server_nickname = 24;
optional bool connect_muted = 25 [default = false];
}
message Identity_Data {
optional string unique_identity = 1;
optional string id_name = 2;
optional string nickname = 3;
optional string phonetic_nickname = 4;
optional bool is_default = 5 [default = false];
}
message Whisper_list_data {
optional string uuid = 1;
optional string name = 2;
optional WhisperListType type = 3;
enum WhisperListType {
WLT_INVALID = 0;
WLT_LIST = 1;
WLT_PREDEFINED = 2;
}
optional int32 groupType = 4;
optional int32 groupTargetMode = 5;
optional uint64 targetGroupID = 6;
optional string targetGroupName = 7;
optional string targetServerUid = 8;
optional string targetServerName = 9;
repeated WhisperEntry whisperListEntries = 10;
message WhisperEntry {
optional WhisperEntryType type = 1;
enum WhisperEntryType {
WET_INVALID = 0;
WET_CLIENT = 1;
WET_CHANNEL = 2;
}
optional string name = 2;
optional string uid = 3;
}
}
message HotkeyProfile_data {
optional string uuid = 1;
optional string name = 2;
repeated Hotkey hotkeys = 3;
message Hotkey {
optional OS os = 3;
enum OS {
Windows = 0;
OSX = 1;
Linux = 2;
}
optional int32 event_type = 4;
optional string event_uuid = 5;
optional string event_mode = 6;
repeated KeyDef keys = 7;
message KeyDef {
optional string identifier = 1;
optional string key = 2;
}
optional uint32 action_type = 8;
optional string action_uuid = 9;
optional bool action_discard = 10 [default = false];
optional string action_mode = 11;
optional string action_flag = 12;
optional string action_description = 13;
optional string action_plugin = 14;
optional string action_away_message = 15;
optional string action_soundpack = 16;
optional string action_plugincommand = 17;
optional string action_plugindescription = 18;
optional string action_deviceuid = 19;
optional string action_devicename = 20;
optional string action_target = 21;
optional bool action_auto = 22 [default = false];
optional string action_profiles = 23;
optional bool action_active_tab = 24 [default = false];
}
optional bool is_default = 4 [default = false];
}
message Add_on_data {
optional string uuid = 1;
optional bool enabled = 2;
}
message Chat_Credentials {
optional string domain = 1;
optional string username = 2;
optional string password = 3;
}
message Config_data {
optional int32 default_subscribe_mode = 1;
repeated string user_badges = 2;
optional bool show_user_badges = 3;
optional bytes global_presence_token = 4;
optional Chat_Credentials tschat_credentials = 5;
repeated TSCHAT_DE_Data tschat_de_data = 7;
}
message Item_Folder {
optional string folder_name = 1;
optional myteamspeak.proto.synchronization.Item_Class folder_type = 2;
}
message Group_Chats {
optional string category_name = 1;
}
message Contact {
optional string chat_room_id = 1;
optional string custom_name = 2;
optional string custom_category = 3;
optional NotificationPreference notification_preference = 4;
enum NotificationPreference {
NOTIFY_ALWAYS = 0;
NOTIFY_EVERYONE_AND_SELF = 1;
NOTIFY_SELF = 2;
NOTIFY_NONE = 3;
}
optional bool is_favourite = 5;
optional bool is_direct_chat = 6;
optional string mytsid = 7;
optional string chat_member_id = 8;
}
message Item_Data {
optional string item_uuid = 2;
optional string sync_version_uuid = 3;
optional Manipulation_Flag manipulated = 4;
enum Manipulation_Flag {
ITEM_ADDED = 0;
ITEM_CHANGED = 1;
ITEM_DELETED = 2;
ITEM_NOT_MANIPULATED = 3;
}
optional string last_known_version = 5;
optional uint32 item_type = 6;
optional string parent = 7;
optional string sort_order = 8;
optional uint64 timestamp = 9;
oneof item_content {
Bookmark_Data bookmark = 16;
Identity_Data identity = 17;
Whisper_list_data whisperlist = 18;
HotkeyProfile_data hotkeyprofile = 19;
Add_on_data add_on = 20;
Config_data config = 21;
Item_Folder item_folder = 22;
Group_Chats group_chats = 24;
Contact contact = 25;
}
}
message TSCHAT_DE_Data {
optional string url = 1;
optional string identity = 2;
optional string username = 3;
optional string server_id = 4;
optional string address = 5;
optional string port = 6;
optional string name = 7;
}
+29
View File
@@ -0,0 +1,29 @@
syntax = "proto3";
package com.teamspeak.blacklist;
message BlacklistInfoRequest {
bytes ip_address = 1;
string domain_name = 2;
string virtual_server_id = 3;
string public_license_id = 4;
uint32 port = 5;
uint64 timestamp = 6;
bool valid_token_present = 7;
bool slots_ok = 8;
string updated_virtual_server_id = 9;
}
message BlacklistInfoResponse {
Result status_ip = 1;
enum Result {
INVALID = 0;
BLACKLISTED = 1;
GREYLISTED = 2;
NOT_LISTED = 3;
}
Result status_domain = 2;
Result status_virtual_server_id = 3;
Result Status_public_license_id = 4;
}
+10
View File
@@ -0,0 +1,10 @@
syntax = "proto3";
package com.teamspeak.proto.client_cache;
import "revoke_cache.proto";
message ClientLibCache {
revocation.RevokeListCachedData revoke_list_cache_certificates = 1;
revocation.RevokeListCachedData revoke_list_cache_mytsid_data = 2;
}
@@ -0,0 +1,17 @@
syntax = "proto3";
package envoy.annotations;
import "google/protobuf/descriptor.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/annotations";
extend google.protobuf.FieldOptions {
bool disallowed_by_default = 189503207;
string deprecated_at_minor_version = 157299826;
}
extend google.protobuf.EnumValueOptions {
bool disallowed_by_default_enum = 70100853;
string deprecated_at_minor_version_enum = 181198657;
}
@@ -0,0 +1,146 @@
syntax = "proto3";
package envoy.config.accesslog.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/route/v3/route_components.proto";
import "envoy/data/accesslog/v3/accesslog.proto";
import "envoy/type/matcher/v3/metadata.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/any.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v3;accesslogv3";
option java_multiple_files = true;
option java_outer_classname = "AccesslogProto";
option java_package = "io.envoyproxy.envoy.config.accesslog.v3";
message AccessLog {
string name = 1;
AccessLogFilter filter = 2;
oneof config_type {
google.protobuf.Any typed_config = 4;
}
reserved 3;
reserved "config";
}
message AccessLogFilter {
oneof filter_specifier {
StatusCodeFilter status_code_filter = 1;
DurationFilter duration_filter = 2;
NotHealthCheckFilter not_health_check_filter = 3;
TraceableFilter traceable_filter = 4;
RuntimeFilter runtime_filter = 5;
AndFilter and_filter = 6;
OrFilter or_filter = 7;
HeaderFilter header_filter = 8;
ResponseFlagFilter response_flag_filter = 9;
GrpcStatusFilter grpc_status_filter = 10;
ExtensionFilter extension_filter = 11;
MetadataFilter metadata_filter = 12;
LogTypeFilter log_type_filter = 13;
}
}
message ComparisonFilter {
Op op = 1;
enum Op {
EQ = 0;
GE = 1;
LE = 2;
}
core.v3.RuntimeUInt32 value = 2;
}
message StatusCodeFilter {
ComparisonFilter comparison = 1;
}
message DurationFilter {
ComparisonFilter comparison = 1;
}
message NotHealthCheckFilter {
}
message TraceableFilter {
}
message RuntimeFilter {
string runtime_key = 1;
type.v3.FractionalPercent percent_sampled = 2;
bool use_independent_randomness = 3;
}
message AndFilter {
repeated AccessLogFilter filters = 1;
}
message OrFilter {
repeated AccessLogFilter filters = 2;
}
message HeaderFilter {
route.v3.HeaderMatcher header = 1;
}
message ResponseFlagFilter {
repeated string flags = 1;
}
message GrpcStatusFilter {
repeated Status statuses = 1;
enum Status {
OK = 0;
CANCELED = 1;
UNKNOWN = 2;
INVALID_ARGUMENT = 3;
DEADLINE_EXCEEDED = 4;
NOT_FOUND = 5;
ALREADY_EXISTS = 6;
PERMISSION_DENIED = 7;
RESOURCE_EXHAUSTED = 8;
FAILED_PRECONDITION = 9;
ABORTED = 10;
OUT_OF_RANGE = 11;
UNIMPLEMENTED = 12;
INTERNAL = 13;
UNAVAILABLE = 14;
DATA_LOSS = 15;
UNAUTHENTICATED = 16;
}
bool exclude = 2;
}
message MetadataFilter {
type.matcher.v3.MetadataMatcher matcher = 1;
google.protobuf.BoolValue match_if_key_not_found = 2;
}
message LogTypeFilter {
repeated data.accesslog.v3.AccessLogType types = 1;
bool exclude = 2;
}
message ExtensionFilter {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
@@ -0,0 +1,37 @@
syntax = "proto3";
package envoy.config.cluster.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3;clusterv3";
option java_multiple_files = true;
option java_outer_classname = "CircuitBreakerProto";
option java_package = "io.envoyproxy.envoy.config.cluster.v3";
message CircuitBreakers {
repeated Thresholds thresholds = 1;
message Thresholds {
core.v3.RoutingPriority priority = 1;
google.protobuf.UInt32Value max_connections = 2;
google.protobuf.UInt32Value max_pending_requests = 3;
google.protobuf.UInt32Value max_requests = 4;
google.protobuf.UInt32Value max_retries = 5;
RetryBudget retry_budget = 8;
message RetryBudget {
type.v3.Percent budget_percent = 1;
google.protobuf.UInt32Value min_retry_concurrency = 2;
}
bool track_remaining = 6;
google.protobuf.UInt32Value max_connection_pools = 7;
}
repeated Thresholds per_host_thresholds = 2;
}
@@ -0,0 +1,311 @@
syntax = "proto3";
package envoy.config.cluster.v3;
import "envoy/config/cluster/v3/circuit_breaker.proto";
import "envoy/config/cluster/v3/filter.proto";
import "envoy/config/cluster/v3/outlier_detection.proto";
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/health_check.proto";
import "envoy/config/core/v3/protocol.proto";
import "envoy/config/core/v3/resolver.proto";
import "envoy/config/endpoint/v3/endpoint.proto";
import "envoy/type/metadata/v3/metadata.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "xds/core/v3/collection_entry.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/security.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3;clusterv3";
option java_multiple_files = true;
option java_outer_classname = "ClusterProto";
option java_package = "io.envoyproxy.envoy.config.cluster.v3";
message ClusterCollection {
xds.core.v3.CollectionEntry entries = 1;
}
message Cluster {
repeated TransportSocketMatch transport_socket_matches = 43;
message TransportSocketMatch {
string name = 1;
google.protobuf.Struct match = 2;
core.v3.TransportSocket transport_socket = 3;
}
string name = 1;
string alt_stat_name = 28;
EdsClusterConfig eds_cluster_config = 3;
message EdsClusterConfig {
core.v3.ConfigSource eds_config = 1;
string service_name = 2;
}
google.protobuf.Duration connect_timeout = 4;
google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 5;
LbPolicy lb_policy = 6;
enum LbPolicy {
ROUND_ROBIN = 0;
LEAST_REQUEST = 1;
RING_HASH = 2;
RANDOM = 3;
MAGLEV = 5;
CLUSTER_PROVIDED = 6;
LOAD_BALANCING_POLICY_CONFIG = 7;
}
endpoint.v3.ClusterLoadAssignment load_assignment = 33;
repeated core.v3.HealthCheck health_checks = 8;
google.protobuf.UInt32Value max_requests_per_connection = 9 [deprecated = true];
CircuitBreakers circuit_breakers = 10;
core.v3.UpstreamHttpProtocolOptions upstream_http_protocol_options = 46 [deprecated = true];
core.v3.HttpProtocolOptions common_http_protocol_options = 29 [deprecated = true];
core.v3.Http1ProtocolOptions http_protocol_options = 13 [deprecated = true];
core.v3.Http2ProtocolOptions http2_protocol_options = 14 [deprecated = true];
map<string, google.protobuf.Any> typed_extension_protocol_options = 36;
google.protobuf.Duration dns_refresh_rate = 16 [deprecated = true];
google.protobuf.Duration dns_jitter = 58 [deprecated = true];
RefreshRate dns_failure_refresh_rate = 44 [deprecated = true];
message RefreshRate {
google.protobuf.Duration base_interval = 1;
google.protobuf.Duration max_interval = 2;
}
bool respect_dns_ttl = 39 [deprecated = true];
DnsLookupFamily dns_lookup_family = 17;
enum DnsLookupFamily {
AUTO = 0;
V4_ONLY = 1;
V6_ONLY = 2;
V4_PREFERRED = 3;
ALL = 4;
}
repeated core.v3.Address dns_resolvers = 18 [deprecated = true];
bool use_tcp_for_dns_lookups = 45 [deprecated = true];
core.v3.DnsResolutionConfig dns_resolution_config = 53 [deprecated = true];
core.v3.TypedExtensionConfig typed_dns_resolver_config = 55;
google.protobuf.BoolValue wait_for_warm_on_init = 54;
OutlierDetection outlier_detection = 19;
google.protobuf.Duration cleanup_interval = 20;
core.v3.BindConfig upstream_bind_config = 21;
LbSubsetConfig lb_subset_config = 22;
message LbSubsetConfig {
LbSubsetFallbackPolicy fallback_policy = 1;
enum LbSubsetFallbackPolicy {
NO_FALLBACK = 0;
ANY_ENDPOINT = 1;
DEFAULT_SUBSET = 2;
}
google.protobuf.Struct default_subset = 2;
repeated LbSubsetSelector subset_selectors = 3;
message LbSubsetSelector {
repeated string keys = 1;
bool single_host_per_subset = 4;
LbSubsetSelectorFallbackPolicy fallback_policy = 2;
enum LbSubsetSelectorFallbackPolicy {
NOT_DEFINED = 0;
NO_FALLBACK = 1;
ANY_ENDPOINT = 2;
DEFAULT_SUBSET = 3;
KEYS_SUBSET = 4;
}
repeated string fallback_keys_subset = 3;
}
bool locality_weight_aware = 4;
bool scale_locality_weight = 5;
bool panic_mode_any = 6;
bool list_as_any = 7;
LbSubsetMetadataFallbackPolicy metadata_fallback_policy = 8;
enum LbSubsetMetadataFallbackPolicy {
METADATA_NO_FALLBACK = 0;
FALLBACK_LIST = 1;
}
}
CommonLbConfig common_lb_config = 27;
message CommonLbConfig {
type.v3.Percent healthy_panic_threshold = 1;
google.protobuf.Duration update_merge_window = 4;
bool ignore_new_hosts_until_first_hc = 5;
bool close_connections_on_host_set_change = 6;
ConsistentHashingLbConfig consistent_hashing_lb_config = 7;
message ConsistentHashingLbConfig {
bool use_hostname_for_hashing = 1;
google.protobuf.UInt32Value hash_balance_factor = 2;
}
core.v3.HealthStatusSet override_host_status = 8;
oneof locality_config_specifier {
ZoneAwareLbConfig zone_aware_lb_config = 2;
LocalityWeightedLbConfig locality_weighted_lb_config = 3;
}
message ZoneAwareLbConfig {
type.v3.Percent routing_enabled = 1;
google.protobuf.UInt64Value min_cluster_size = 2;
bool fail_traffic_on_panic = 3;
}
message LocalityWeightedLbConfig {
}
}
core.v3.TransportSocket transport_socket = 24;
core.v3.Metadata metadata = 25;
ClusterProtocolSelection protocol_selection = 26 [deprecated = true];
enum ClusterProtocolSelection {
USE_CONFIGURED_PROTOCOL = 0;
USE_DOWNSTREAM_PROTOCOL = 1;
}
UpstreamConnectionOptions upstream_connection_options = 30;
bool close_connections_on_host_health_failure = 31;
bool ignore_health_on_host_removal = 32;
repeated Filter filters = 40;
LoadBalancingPolicy load_balancing_policy = 41;
core.v3.ConfigSource lrs_server = 42;
repeated string lrs_report_endpoint_metrics = 57;
bool track_timeout_budgets = 47 [deprecated = true];
core.v3.TypedExtensionConfig upstream_config = 48;
TrackClusterStats track_cluster_stats = 49;
PreconnectPolicy preconnect_policy = 50;
message PreconnectPolicy {
google.protobuf.DoubleValue per_upstream_preconnect_ratio = 1;
google.protobuf.DoubleValue predictive_preconnect_ratio = 2;
}
bool connection_pool_per_downstream_connection = 51;
oneof cluster_discovery_type {
DiscoveryType type = 2;
CustomClusterType cluster_type = 38;
}
oneof lb_config {
RingHashLbConfig ring_hash_lb_config = 23;
MaglevLbConfig maglev_lb_config = 52;
OriginalDstLbConfig original_dst_lb_config = 34;
LeastRequestLbConfig least_request_lb_config = 37;
RoundRobinLbConfig round_robin_lb_config = 56;
}
reserved 12, 15, 7, 11, 35;
reserved "hosts", "tls_context", "extension_protocol_options";
message CustomClusterType {
string name = 1;
google.protobuf.Any typed_config = 2;
}
message SlowStartConfig {
google.protobuf.Duration slow_start_window = 1;
core.v3.RuntimeDouble aggression = 2;
type.v3.Percent min_weight_percent = 3;
}
message RoundRobinLbConfig {
SlowStartConfig slow_start_config = 1;
}
message LeastRequestLbConfig {
google.protobuf.UInt32Value choice_count = 1;
core.v3.RuntimeDouble active_request_bias = 2;
SlowStartConfig slow_start_config = 3;
}
message RingHashLbConfig {
google.protobuf.UInt64Value minimum_ring_size = 1;
HashFunction hash_function = 3;
enum HashFunction {
XX_HASH = 0;
MURMUR_HASH_2 = 1;
}
google.protobuf.UInt64Value maximum_ring_size = 4;
reserved 2;
}
message MaglevLbConfig {
google.protobuf.UInt64Value table_size = 1;
}
message OriginalDstLbConfig {
bool use_http_header = 1;
string http_header_name = 2;
google.protobuf.UInt32Value upstream_port_override = 3;
type.metadata.v3.MetadataKey metadata_key = 4;
}
enum DiscoveryType {
STATIC = 0;
STRICT_DNS = 1;
LOGICAL_DNS = 2;
EDS = 3;
ORIGINAL_DST = 4;
}
}
message LoadBalancingPolicy {
repeated Policy policies = 1;
message Policy {
core.v3.TypedExtensionConfig typed_extension_config = 4;
reserved 2, 1, 3;
reserved "config", "name", "typed_config";
}
}
message UpstreamConnectionOptions {
core.v3.TcpKeepalive tcp_keepalive = 1;
bool set_local_interface_name_on_upstream_connections = 2;
HappyEyeballsConfig happy_eyeballs_config = 3;
message HappyEyeballsConfig {
FirstAddressFamilyVersion first_address_family_version = 1;
google.protobuf.UInt32Value first_address_family_count = 2;
}
enum FirstAddressFamilyVersion {
DEFAULT = 0;
V4 = 1;
V6 = 2;
}
}
message TrackClusterStats {
bool timeout_budgets = 1;
bool request_response_sizes = 2;
bool per_endpoint_stats = 3;
}
@@ -0,0 +1,20 @@
syntax = "proto3";
package envoy.config.cluster.v3;
import "envoy/config/core/v3/config_source.proto";
import "google/protobuf/any.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3;clusterv3";
option java_multiple_files = true;
option java_outer_classname = "FilterProto";
option java_package = "io.envoyproxy.envoy.config.cluster.v3";
message Filter {
string name = 1;
google.protobuf.Any typed_config = 2;
core.v3.ExtensionConfigSource config_discovery = 3;
}
@@ -0,0 +1,43 @@
syntax = "proto3";
package envoy.config.cluster.v3;
import "envoy/config/core/v3/extension.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3;clusterv3";
option java_multiple_files = true;
option java_outer_classname = "OutlierDetectionProto";
option java_package = "io.envoyproxy.envoy.config.cluster.v3";
message OutlierDetection {
google.protobuf.UInt32Value consecutive_5xx = 1;
google.protobuf.Duration interval = 2;
google.protobuf.Duration base_ejection_time = 3;
google.protobuf.UInt32Value max_ejection_percent = 4;
google.protobuf.UInt32Value enforcing_consecutive_5xx = 5;
google.protobuf.UInt32Value enforcing_success_rate = 6;
google.protobuf.UInt32Value success_rate_minimum_hosts = 7;
google.protobuf.UInt32Value success_rate_request_volume = 8;
google.protobuf.UInt32Value success_rate_stdev_factor = 9;
google.protobuf.UInt32Value consecutive_gateway_failure = 10;
google.protobuf.UInt32Value enforcing_consecutive_gateway_failure = 11;
bool split_external_local_origin_errors = 12;
google.protobuf.UInt32Value consecutive_local_origin_failure = 13;
google.protobuf.UInt32Value enforcing_consecutive_local_origin_failure = 14;
google.protobuf.UInt32Value enforcing_local_origin_success_rate = 15;
google.protobuf.UInt32Value failure_percentage_threshold = 16;
google.protobuf.UInt32Value enforcing_failure_percentage = 17;
google.protobuf.UInt32Value enforcing_failure_percentage_local_origin = 18;
google.protobuf.UInt32Value failure_percentage_minimum_hosts = 19;
google.protobuf.UInt32Value failure_percentage_request_volume = 20;
google.protobuf.Duration max_ejection_time = 21;
google.protobuf.Duration max_ejection_time_jitter = 22;
google.protobuf.BoolValue successful_active_health_check_uneject_host = 23;
repeated core.v3.TypedExtensionConfig monitors = 24;
google.protobuf.BoolValue always_eject_one_host = 25;
}
@@ -0,0 +1,79 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/socket_option.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "AddressProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message Pipe {
string path = 1;
uint32 mode = 2;
}
message EnvoyInternalAddress {
string endpoint_id = 2;
oneof address_name_specifier {
string server_listener_name = 1;
}
}
message SocketAddress {
Protocol protocol = 1;
enum Protocol {
TCP = 0;
UDP = 1;
}
string address = 2;
string resolver_name = 5;
bool ipv4_compat = 6;
oneof port_specifier {
uint32 port_value = 3;
string named_port = 4;
}
}
message TcpKeepalive {
google.protobuf.UInt32Value keepalive_probes = 1;
google.protobuf.UInt32Value keepalive_time = 2;
google.protobuf.UInt32Value keepalive_interval = 3;
}
message ExtraSourceAddress {
SocketAddress address = 1;
SocketOptionsOverride socket_options = 2;
}
message BindConfig {
SocketAddress source_address = 1;
google.protobuf.BoolValue freebind = 2;
repeated SocketOption socket_options = 3;
repeated ExtraSourceAddress extra_source_addresses = 5;
repeated SocketAddress additional_source_addresses = 4 [deprecated = true];
TypedExtensionConfig local_address_selector = 6;
}
message Address {
oneof address {
SocketAddress socket_address = 1;
Pipe pipe = 2;
EnvoyInternalAddress envoy_internal_address = 3;
}
}
message CidrRange {
string address_prefix = 1;
google.protobuf.UInt32Value prefix_len = 2;
}
@@ -0,0 +1,18 @@
syntax = "proto3";
package envoy.config.core.v3;
import "google/protobuf/duration.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "BackoffProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message BackoffStrategy {
google.protobuf.Duration base_interval = 1;
google.protobuf.Duration max_interval = 2;
}
@@ -0,0 +1,246 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/backoff.proto";
import "envoy/config/core/v3/http_uri.proto";
import "envoy/type/v3/percent.proto";
import "envoy/type/v3/semantic_version.proto";
import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "xds/core/v3/context_params.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "BaseProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message Locality {
string region = 1;
string zone = 2;
string sub_zone = 3;
}
message BuildVersion {
type.v3.SemanticVersion version = 1;
google.protobuf.Struct metadata = 2;
}
message Extension {
string name = 1;
string category = 2;
string type_descriptor = 3 [deprecated = true];
BuildVersion version = 4;
bool disabled = 5;
repeated string type_urls = 6;
}
message Node {
string id = 1;
string cluster = 2;
google.protobuf.Struct metadata = 3;
map<string, xds.core.v3.ContextParams> dynamic_parameters = 12;
Locality locality = 4;
string user_agent_name = 6;
repeated Extension extensions = 9;
repeated string client_features = 10;
repeated Address listening_addresses = 11 [deprecated = true];
oneof user_agent_version_type {
string user_agent_version = 7;
BuildVersion user_agent_build_version = 8;
}
reserved 5;
reserved "build_version";
}
message Metadata {
map<string, google.protobuf.Struct> filter_metadata = 1;
map<string, google.protobuf.Any> typed_filter_metadata = 2;
}
message RuntimeUInt32 {
uint32 default_value = 2;
string runtime_key = 3;
}
message RuntimePercent {
type.v3.Percent default_value = 1;
string runtime_key = 2;
}
message RuntimeDouble {
double default_value = 1;
string runtime_key = 2;
}
message RuntimeFeatureFlag {
google.protobuf.BoolValue default_value = 1;
string runtime_key = 2;
}
message KeyValue {
string key = 1 [deprecated = true];
bytes value = 2 [deprecated = true];
}
message KeyValuePair {
string key = 1;
google.protobuf.Value value = 2;
}
message KeyValueAppend {
KeyValuePair record = 3;
KeyValue entry = 1 [deprecated = true];
KeyValueAppendAction action = 2;
enum KeyValueAppendAction {
APPEND_IF_EXISTS_OR_ADD = 0;
ADD_IF_ABSENT = 1;
OVERWRITE_IF_EXISTS_OR_ADD = 2;
OVERWRITE_IF_EXISTS = 3;
}
}
message KeyValueMutation {
KeyValueAppend append = 1;
string remove = 2;
}
message QueryParameter {
string key = 1;
string value = 2;
}
message HeaderValue {
string key = 1;
string value = 2;
bytes raw_value = 3;
}
message HeaderValueOption {
HeaderValue header = 1;
google.protobuf.BoolValue append = 2 [deprecated = true];
HeaderAppendAction append_action = 3;
enum HeaderAppendAction {
APPEND_IF_EXISTS_OR_ADD = 0;
ADD_IF_ABSENT = 1;
OVERWRITE_IF_EXISTS_OR_ADD = 2;
OVERWRITE_IF_EXISTS = 3;
}
bool keep_empty_value = 4;
}
message HeaderMap {
repeated HeaderValue headers = 1;
}
message WatchedDirectory {
string path = 1;
}
message DataSource {
WatchedDirectory watched_directory = 5;
oneof specifier {
string filename = 1;
bytes inline_bytes = 2;
string inline_string = 3;
string environment_variable = 4;
}
}
message RetryPolicy {
BackoffStrategy retry_back_off = 1;
google.protobuf.UInt32Value num_retries = 2;
string retry_on = 3;
RetryPriority retry_priority = 4;
message RetryPriority {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 2;
}
}
repeated RetryHostPredicate retry_host_predicate = 5;
message RetryHostPredicate {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 2;
}
}
int64 host_selection_retry_max_attempts = 6;
}
message RemoteDataSource {
HttpUri http_uri = 1;
string sha256 = 2;
RetryPolicy retry_policy = 3;
}
message AsyncDataSource {
oneof specifier {
DataSource local = 1;
RemoteDataSource remote = 2;
}
}
message TransportSocket {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
message RuntimeFractionalPercent {
type.v3.FractionalPercent default_value = 1;
string runtime_key = 2;
}
message ControlPlane {
string identifier = 1;
}
enum RoutingPriority {
DEFAULT = 0;
HIGH = 1;
}
enum RequestMethod {
METHOD_UNSPECIFIED = 0;
GET = 1;
HEAD = 2;
POST = 3;
PUT = 4;
DELETE = 5;
CONNECT = 6;
OPTIONS = 7;
TRACE = 8;
PATCH = 9;
}
enum TrafficDirection {
UNSPECIFIED = 0;
INBOUND = 1;
OUTBOUND = 2;
}
@@ -0,0 +1,86 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/grpc_service.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/core/v3/authority.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "ConfigSourceProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message ApiConfigSource {
ApiType api_type = 1;
enum ApiType {
DEPRECATED_AND_UNAVAILABLE_DO_NOT_USE = 0 [deprecated = true];
REST = 1;
GRPC = 2;
DELTA_GRPC = 3;
AGGREGATED_GRPC = 5;
AGGREGATED_DELTA_GRPC = 6;
}
ApiVersion transport_api_version = 8;
repeated string cluster_names = 2;
repeated GrpcService grpc_services = 4;
google.protobuf.Duration refresh_delay = 3;
google.protobuf.Duration request_timeout = 5;
RateLimitSettings rate_limit_settings = 6;
bool set_node_on_first_message_only = 7;
repeated TypedExtensionConfig config_validators = 9;
}
message AggregatedConfigSource {
}
message SelfConfigSource {
ApiVersion transport_api_version = 1;
}
message RateLimitSettings {
google.protobuf.UInt32Value max_tokens = 1;
google.protobuf.DoubleValue fill_rate = 2;
}
message PathConfigSource {
string path = 1;
WatchedDirectory watched_directory = 2;
}
message ConfigSource {
repeated xds.core.v3.Authority authorities = 7;
google.protobuf.Duration initial_fetch_timeout = 4;
ApiVersion resource_api_version = 6;
oneof config_source_specifier {
string path = 1 [deprecated = true];
PathConfigSource path_config_source = 8;
ApiConfigSource api_config_source = 2;
AggregatedConfigSource ads = 3;
SelfConfigSource self = 5;
}
}
message ExtensionConfigSource {
ConfigSource config_source = 1;
google.protobuf.Any default_config = 2;
bool apply_default_config_without_warming = 3;
repeated string type_urls = 4;
}
enum ApiVersion {
AUTO = 0;
V2 = 1 [deprecated = true];
V3 = 2;
}
@@ -0,0 +1,19 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/grpc_service.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "EventServiceConfigProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message EventServiceConfig {
oneof config_source_specifier {
GrpcService grpc_service = 1;
}
}
@@ -0,0 +1,17 @@
syntax = "proto3";
package envoy.config.core.v3;
import "google/protobuf/any.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "ExtensionProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message TypedExtensionConfig {
string name = 1;
google.protobuf.Any typed_config = 2;
}
@@ -0,0 +1,127 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/sensitive.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "GrpcServiceProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message GrpcService {
google.protobuf.Duration timeout = 3;
repeated HeaderValue initial_metadata = 5;
RetryPolicy retry_policy = 6;
oneof target_specifier {
EnvoyGrpc envoy_grpc = 1;
GoogleGrpc google_grpc = 2;
}
reserved 4;
message EnvoyGrpc {
string cluster_name = 1;
string authority = 2;
RetryPolicy retry_policy = 3;
google.protobuf.UInt32Value max_receive_message_length = 4;
bool skip_envoy_headers = 5;
}
message GoogleGrpc {
string target_uri = 1;
ChannelCredentials channel_credentials = 2;
message ChannelCredentials {
oneof credential_specifier {
SslCredentials ssl_credentials = 1;
google.protobuf.Empty google_default = 2;
GoogleLocalCredentials local_credentials = 3;
}
}
repeated CallCredentials call_credentials = 3;
message CallCredentials {
oneof credential_specifier {
string access_token = 1;
google.protobuf.Empty google_compute_engine = 2;
string google_refresh_token = 3;
ServiceAccountJWTAccessCredentials service_account_jwt_access = 4;
GoogleIAMCredentials google_iam = 5;
MetadataCredentialsFromPlugin from_plugin = 6;
StsService sts_service = 7;
}
message ServiceAccountJWTAccessCredentials {
string json_key = 1;
uint64 token_lifetime_seconds = 2;
}
message GoogleIAMCredentials {
string authorization_token = 1;
string authority_selector = 2;
}
message MetadataCredentialsFromPlugin {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
message StsService {
string token_exchange_service_uri = 1;
string resource = 2;
string audience = 3;
string scope = 4;
string requested_token_type = 5;
string subject_token_path = 6;
string subject_token_type = 7;
string actor_token_path = 8;
string actor_token_type = 9;
}
}
string stat_prefix = 4;
string credentials_factory_name = 5;
google.protobuf.Struct config = 6;
google.protobuf.UInt32Value per_stream_buffer_limit_bytes = 7;
ChannelArgs channel_args = 8;
message ChannelArgs {
map<string, Value> args = 1;
message Value {
oneof value_specifier {
string string_value = 1;
int64 int_value = 2;
}
}
}
message SslCredentials {
DataSource root_certs = 1;
DataSource private_key = 2;
DataSource cert_chain = 3;
}
message GoogleLocalCredentials {
}
}
}
@@ -0,0 +1,129 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/event_service_config.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/proxy_protocol.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/v3/http.proto";
import "envoy/type/v3/range.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "HealthCheckProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message HealthStatusSet {
repeated HealthStatus statuses = 1;
}
message HealthCheck {
google.protobuf.Duration timeout = 1;
google.protobuf.Duration interval = 2;
google.protobuf.Duration initial_jitter = 20;
google.protobuf.Duration interval_jitter = 3;
uint32 interval_jitter_percent = 18;
google.protobuf.UInt32Value unhealthy_threshold = 4;
google.protobuf.UInt32Value healthy_threshold = 5;
google.protobuf.UInt32Value alt_port = 6;
google.protobuf.BoolValue reuse_connection = 7;
google.protobuf.Duration no_traffic_interval = 12;
google.protobuf.Duration no_traffic_healthy_interval = 24;
google.protobuf.Duration unhealthy_interval = 14;
google.protobuf.Duration unhealthy_edge_interval = 15;
google.protobuf.Duration healthy_edge_interval = 16;
string event_log_path = 17 [deprecated = true];
repeated TypedExtensionConfig event_logger = 25;
EventServiceConfig event_service = 22;
bool always_log_health_check_failures = 19;
bool always_log_health_check_success = 26;
TlsOptions tls_options = 21;
message TlsOptions {
repeated string alpn_protocols = 1;
}
google.protobuf.Struct transport_socket_match_criteria = 23;
oneof health_checker {
HttpHealthCheck http_health_check = 8;
TcpHealthCheck tcp_health_check = 9;
GrpcHealthCheck grpc_health_check = 11;
CustomHealthCheck custom_health_check = 13;
}
reserved 10;
message Payload {
oneof payload {
string text = 1;
bytes binary = 2;
}
}
message HttpHealthCheck {
string host = 1;
string path = 2;
Payload send = 3;
repeated Payload receive = 4;
google.protobuf.UInt64Value response_buffer_size = 14;
repeated HeaderValueOption request_headers_to_add = 6;
repeated string request_headers_to_remove = 8;
repeated type.v3.Int64Range expected_statuses = 9;
repeated type.v3.Int64Range retriable_statuses = 12;
type.v3.CodecClientType codec_client_type = 10;
type.matcher.v3.StringMatcher service_name_matcher = 11;
RequestMethod method = 13;
reserved 5, 7;
reserved "service_name", "use_http2";
}
message TcpHealthCheck {
Payload send = 1;
repeated Payload receive = 2;
ProxyProtocolConfig proxy_protocol_config = 3;
}
message RedisHealthCheck {
string key = 1;
}
message GrpcHealthCheck {
string service_name = 1;
string authority = 2;
repeated HeaderValueOption initial_metadata = 3;
}
message CustomHealthCheck {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
}
enum HealthStatus {
UNKNOWN = 0;
HEALTHY = 1;
UNHEALTHY = 2;
DRAINING = 3;
TIMEOUT = 4;
DEGRADED = 5;
}
@@ -0,0 +1,22 @@
syntax = "proto3";
package envoy.config.core.v3;
import "google/protobuf/duration.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "HttpUriProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message HttpUri {
string uri = 1;
google.protobuf.Duration timeout = 3;
oneof http_upstream_type {
string cluster = 2;
}
}
@@ -0,0 +1,153 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/extension.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/annotations/v3/status.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "ProtocolProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message TcpProtocolOptions {
}
message QuicKeepAliveSettings {
google.protobuf.Duration max_interval = 1;
google.protobuf.Duration initial_interval = 2;
}
message QuicProtocolOptions {
google.protobuf.UInt32Value max_concurrent_streams = 1;
google.protobuf.UInt32Value initial_stream_window_size = 2;
google.protobuf.UInt32Value initial_connection_window_size = 3;
google.protobuf.UInt32Value num_timeouts_to_trigger_port_migration = 4;
QuicKeepAliveSettings connection_keepalive = 5;
string connection_options = 6;
string client_connection_options = 7;
google.protobuf.Duration idle_network_timeout = 8;
google.protobuf.UInt64Value max_packet_length = 9;
}
message UpstreamHttpProtocolOptions {
bool auto_sni = 1;
bool auto_san_validation = 2;
string override_auto_sni_header = 3;
}
message AlternateProtocolsCacheOptions {
string name = 1;
google.protobuf.UInt32Value max_entries = 2;
TypedExtensionConfig key_value_store_config = 3;
repeated AlternateProtocolsCacheEntry prepopulated_entries = 4;
message AlternateProtocolsCacheEntry {
string hostname = 1;
uint32 port = 2;
}
repeated string canonical_suffixes = 5;
}
message HttpProtocolOptions {
google.protobuf.Duration idle_timeout = 1;
google.protobuf.Duration max_connection_duration = 3;
google.protobuf.UInt32Value max_headers_count = 2;
google.protobuf.UInt32Value max_response_headers_kb = 7;
google.protobuf.Duration max_stream_duration = 4;
HeadersWithUnderscoresAction headers_with_underscores_action = 5;
enum HeadersWithUnderscoresAction {
ALLOW = 0;
REJECT_REQUEST = 1;
DROP_HEADER = 2;
}
google.protobuf.UInt32Value max_requests_per_connection = 6;
}
message Http1ProtocolOptions {
google.protobuf.BoolValue allow_absolute_url = 1;
bool accept_http_10 = 2;
string default_host_for_http_10 = 3;
HeaderKeyFormat header_key_format = 4;
message HeaderKeyFormat {
oneof header_format {
ProperCaseWords proper_case_words = 1;
TypedExtensionConfig stateful_formatter = 8;
}
message ProperCaseWords {
}
}
bool enable_trailers = 5;
bool allow_chunked_length = 6;
google.protobuf.BoolValue override_stream_error_on_invalid_http_message = 7;
bool send_fully_qualified_url = 8;
google.protobuf.BoolValue use_balsa_parser = 9;
bool allow_custom_methods = 10;
}
message KeepaliveSettings {
google.protobuf.Duration interval = 1;
google.protobuf.Duration timeout = 2;
type.v3.Percent interval_jitter = 3;
google.protobuf.Duration connection_idle_interval = 4;
}
message Http2ProtocolOptions {
google.protobuf.UInt32Value hpack_table_size = 1;
google.protobuf.UInt32Value max_concurrent_streams = 2;
google.protobuf.UInt32Value initial_stream_window_size = 3;
google.protobuf.UInt32Value initial_connection_window_size = 4;
bool allow_connect = 5;
bool allow_metadata = 6;
google.protobuf.UInt32Value max_outbound_frames = 7;
google.protobuf.UInt32Value max_outbound_control_frames = 8;
google.protobuf.UInt32Value max_consecutive_inbound_frames_with_empty_payload = 9;
google.protobuf.UInt32Value max_inbound_priority_frames_per_stream = 10;
google.protobuf.UInt32Value max_inbound_window_update_frames_per_data_frame_sent = 11;
bool stream_error_on_invalid_http_messaging = 12 [deprecated = true];
google.protobuf.BoolValue override_stream_error_on_invalid_http_message = 14;
repeated SettingsParameter custom_settings_parameters = 13;
message SettingsParameter {
google.protobuf.UInt32Value identifier = 1;
google.protobuf.UInt32Value value = 2;
}
KeepaliveSettings connection_keepalive = 15;
google.protobuf.BoolValue use_oghttp2_codec = 16;
google.protobuf.UInt64Value max_metadata_size = 17;
}
message GrpcProtocolOptions {
Http2ProtocolOptions http2_protocol_options = 1;
}
message Http3ProtocolOptions {
QuicProtocolOptions quic_protocol_options = 1;
google.protobuf.BoolValue override_stream_error_on_invalid_http_message = 2;
bool allow_extended_connect = 5;
bool allow_metadata = 6;
}
message SchemeHeaderTransformation {
bool match_upstream = 2;
oneof transformation {
string scheme_to_overwrite = 1;
}
}
@@ -0,0 +1,31 @@
syntax = "proto3";
package envoy.config.core.v3;
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "ProxyProtocolProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message ProxyProtocolPassThroughTLVs {
PassTLVsMatchType match_type = 1;
enum PassTLVsMatchType {
INCLUDE_ALL = 0;
INCLUDE = 1;
}
repeated uint32 tlv_type = 2;
}
message ProxyProtocolConfig {
Version version = 1;
enum Version {
V1 = 0;
V2 = 1;
}
ProxyProtocolPassThroughTLVs pass_through_tlvs = 2;
}
@@ -0,0 +1,22 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/address.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "ResolverProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message DnsResolverOptions {
bool use_tcp_for_dns_lookups = 1;
bool no_default_search_domain = 2;
}
message DnsResolutionConfig {
repeated Address resolvers = 1;
DnsResolverOptions dns_resolver_options = 2;
}
@@ -0,0 +1,17 @@
syntax = "proto3";
package envoy.config.core.v3;
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "SocketCmsgHeadersProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message SocketCmsgHeaders {
google.protobuf.UInt32Value level = 1;
google.protobuf.UInt32Value type = 2;
uint32 expected_size = 3;
}
@@ -0,0 +1,47 @@
syntax = "proto3";
package envoy.config.core.v3;
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "SocketOptionProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message SocketOption {
string description = 1;
int64 level = 2;
int64 name = 3;
SocketState state = 6;
enum SocketState {
STATE_PREBIND = 0;
STATE_BOUND = 1;
STATE_LISTENING = 2;
}
SocketType type = 7;
message SocketType {
Stream stream = 1;
message Stream {
}
Datagram datagram = 2;
message Datagram {
}
}
oneof value {
int64 int_value = 4;
bytes buf_value = 5;
}
}
message SocketOptionsOverride {
repeated SocketOption socket_options = 1;
}
@@ -0,0 +1,32 @@
syntax = "proto3";
package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "google/protobuf/struct.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "SubstitutionFormatStringProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message JsonFormatOptions {
bool sort_properties = 1;
}
message SubstitutionFormatString {
bool omit_empty_values = 3;
string content_type = 4;
repeated TypedExtensionConfig formatters = 6;
JsonFormatOptions json_format_options = 7;
oneof format {
string text_format = 1 [deprecated = true];
google.protobuf.Struct json_format = 2;
DataSource text_format_source = 5;
}
}
@@ -0,0 +1,17 @@
syntax = "proto3";
package envoy.config.core.v3;
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3";
option java_multiple_files = true;
option java_outer_classname = "UdpSocketConfigProto";
option java_package = "io.envoyproxy.envoy.config.core.v3";
message UdpSocketConfig {
google.protobuf.UInt64Value max_rx_datagram_size = 1;
google.protobuf.BoolValue prefer_gro = 2;
}
@@ -0,0 +1,39 @@
syntax = "proto3";
package envoy.config.endpoint.v3;
import "envoy/config/endpoint/v3/endpoint_components.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3;endpointv3";
option java_multiple_files = true;
option java_outer_classname = "EndpointProto";
option java_package = "io.envoyproxy.envoy.config.endpoint.v3";
message ClusterLoadAssignment {
string cluster_name = 1;
repeated LocalityLbEndpoints endpoints = 2;
map<string, Endpoint> named_endpoints = 5;
Policy policy = 4;
message Policy {
repeated DropOverload drop_overloads = 2;
message DropOverload {
string category = 1;
type.v3.FractionalPercent drop_percentage = 2;
}
google.protobuf.UInt32Value overprovisioning_factor = 3;
google.protobuf.Duration endpoint_stale_after = 4;
bool weighted_priority_health = 6;
reserved 1, 5;
reserved "disable_overprovisioning";
}
}
@@ -0,0 +1,70 @@
syntax = "proto3";
package envoy.config.endpoint.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/core/v3/health_check.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3;endpointv3";
option java_multiple_files = true;
option java_outer_classname = "EndpointComponentsProto";
option java_package = "io.envoyproxy.envoy.config.endpoint.v3";
message Endpoint {
core.v3.Address address = 1;
HealthCheckConfig health_check_config = 2;
message HealthCheckConfig {
uint32 port_value = 1;
string hostname = 2;
core.v3.Address address = 3;
bool disable_active_health_check = 4;
}
string hostname = 3;
repeated AdditionalAddress additional_addresses = 4;
message AdditionalAddress {
core.v3.Address address = 1;
}
}
message LbEndpoint {
core.v3.HealthStatus health_status = 2;
core.v3.Metadata metadata = 3;
google.protobuf.UInt32Value load_balancing_weight = 4;
oneof host_identifier {
Endpoint endpoint = 1;
string endpoint_name = 5;
}
}
message LedsClusterLocalityConfig {
core.v3.ConfigSource leds_config = 1;
string leds_collection_name = 2;
}
message LocalityLbEndpoints {
core.v3.Locality locality = 1;
core.v3.Metadata metadata = 9;
repeated LbEndpoint lb_endpoints = 2;
google.protobuf.UInt32Value load_balancing_weight = 3;
uint32 priority = 5;
google.protobuf.UInt32Value proximity = 6;
oneof lb_config {
LbEndpointList load_balancer_endpoints = 7;
LedsClusterLocalityConfig leds_cluster_locality_config = 8;
}
message LbEndpointList {
repeated LbEndpoint lb_endpoints = 1;
}
}
@@ -0,0 +1,70 @@
syntax = "proto3";
package envoy.config.endpoint.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "xds/annotations/v3/status.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3;endpointv3";
option java_multiple_files = true;
option java_outer_classname = "LoadReportProto";
option java_package = "io.envoyproxy.envoy.config.endpoint.v3";
message UpstreamLocalityStats {
core.v3.Locality locality = 1;
uint64 total_successful_requests = 2;
uint64 total_requests_in_progress = 3;
uint64 total_error_requests = 4;
uint64 total_issued_requests = 8;
uint64 total_active_connections = 9;
uint64 total_new_connections = 10;
uint64 total_fail_connections = 11;
UnnamedEndpointLoadMetricStats cpu_utilization = 12;
UnnamedEndpointLoadMetricStats mem_utilization = 13;
UnnamedEndpointLoadMetricStats application_utilization = 14;
repeated EndpointLoadMetricStats load_metric_stats = 5;
repeated UpstreamEndpointStats upstream_endpoint_stats = 7;
uint32 priority = 6;
}
message UpstreamEndpointStats {
core.v3.Address address = 1;
google.protobuf.Struct metadata = 6;
uint64 total_successful_requests = 2;
uint64 total_requests_in_progress = 3;
uint64 total_error_requests = 4;
uint64 total_issued_requests = 7;
repeated EndpointLoadMetricStats load_metric_stats = 5;
}
message EndpointLoadMetricStats {
string metric_name = 1;
uint64 num_requests_finished_with_metric = 2;
double total_metric_value = 3;
}
message UnnamedEndpointLoadMetricStats {
uint64 num_requests_finished_with_metric = 1;
double total_metric_value = 2;
}
message ClusterStats {
string cluster_name = 1;
string cluster_service_name = 6;
repeated UpstreamLocalityStats upstream_locality_stats = 2;
uint64 total_dropped_requests = 3;
repeated DroppedRequests dropped_requests = 5;
message DroppedRequests {
string category = 1;
uint64 dropped_count = 2;
}
google.protobuf.Duration load_report_interval = 4;
}
@@ -0,0 +1,16 @@
syntax = "proto3";
package envoy.config.listener.v3;
import "google/protobuf/any.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3;listenerv3";
option java_multiple_files = true;
option java_outer_classname = "ApiListenerProto";
option java_package = "io.envoyproxy.envoy.config.listener.v3";
message ApiListener {
google.protobuf.Any api_listener = 1;
}
@@ -0,0 +1,115 @@
syntax = "proto3";
package envoy.config.listener.v3;
import "envoy/config/accesslog/v3/accesslog.proto";
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/socket_option.proto";
import "envoy/config/listener/v3/api_listener.proto";
import "envoy/config/listener/v3/listener_components.proto";
import "envoy/config/listener/v3/udp_listener_config.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/annotations/v3/status.proto";
import "xds/core/v3/collection_entry.proto";
import "xds/type/matcher/v3/matcher.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/security.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3;listenerv3";
option java_multiple_files = true;
option java_outer_classname = "ListenerProto";
option java_package = "io.envoyproxy.envoy.config.listener.v3";
message AdditionalAddress {
core.v3.Address address = 1;
core.v3.SocketOptionsOverride socket_options = 2;
}
message ListenerCollection {
repeated xds.core.v3.CollectionEntry entries = 1;
}
message Listener {
string name = 1;
core.v3.Address address = 2;
repeated AdditionalAddress additional_addresses = 33;
string stat_prefix = 28;
repeated FilterChain filter_chains = 3;
xds.type.matcher.v3.Matcher filter_chain_matcher = 32;
google.protobuf.BoolValue use_original_dst = 4;
FilterChain default_filter_chain = 25;
google.protobuf.UInt32Value per_connection_buffer_limit_bytes = 5;
core.v3.Metadata metadata = 6;
DeprecatedV1 deprecated_v1 = 7 [deprecated = true];
message DeprecatedV1 {
google.protobuf.BoolValue bind_to_port = 1;
}
DrainType drain_type = 8;
enum DrainType {
DEFAULT = 0;
MODIFY_ONLY = 1;
}
repeated ListenerFilter listener_filters = 9;
google.protobuf.Duration listener_filters_timeout = 15;
bool continue_on_listener_filters_timeout = 17;
google.protobuf.BoolValue transparent = 10;
google.protobuf.BoolValue freebind = 11;
repeated core.v3.SocketOption socket_options = 13;
google.protobuf.UInt32Value tcp_fast_open_queue_length = 12;
core.v3.TrafficDirection traffic_direction = 16;
UdpListenerConfig udp_listener_config = 18;
ApiListener api_listener = 19;
ConnectionBalanceConfig connection_balance_config = 20;
message ConnectionBalanceConfig {
oneof balance_type {
ExactBalance exact_balance = 1;
core.v3.TypedExtensionConfig extend_balance = 2;
}
message ExactBalance {
}
}
bool reuse_port = 21 [deprecated = true];
google.protobuf.BoolValue enable_reuse_port = 29;
repeated accesslog.v3.AccessLog access_log = 22;
google.protobuf.UInt32Value tcp_backlog_size = 24;
google.protobuf.UInt32Value max_connections_to_accept_per_socket_event = 34;
google.protobuf.BoolValue bind_to_port = 26;
bool enable_mptcp = 30;
bool ignore_global_conn_limit = 31;
bool bypass_overload_manager = 35;
oneof listener_specifier {
InternalListenerConfig internal_listener = 27;
}
reserved 14, 23;
message InternalListenerConfig {
}
}
message ListenerManager {
}
message ValidationListenerManager {
}
message ApiListenerManager {
}
@@ -0,0 +1,98 @@
syntax = "proto3";
package envoy.config.listener.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/type/v3/range.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3;listenerv3";
option java_multiple_files = true;
option java_outer_classname = "ListenerComponentsProto";
option java_package = "io.envoyproxy.envoy.config.listener.v3";
message Filter {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 4;
core.v3.ExtensionConfigSource config_discovery = 5;
}
reserved 3, 2;
reserved "config";
}
message FilterChainMatch {
google.protobuf.UInt32Value destination_port = 8;
repeated core.v3.CidrRange prefix_ranges = 3;
string address_suffix = 4;
google.protobuf.UInt32Value suffix_len = 5;
repeated core.v3.CidrRange direct_source_prefix_ranges = 13;
ConnectionSourceType source_type = 12;
enum ConnectionSourceType {
ANY = 0;
SAME_IP_OR_LOOPBACK = 1;
EXTERNAL = 2;
}
repeated core.v3.CidrRange source_prefix_ranges = 6;
repeated uint32 source_ports = 7;
repeated string server_names = 11;
string transport_protocol = 9;
repeated string application_protocols = 10;
reserved 1;
}
message FilterChain {
FilterChainMatch filter_chain_match = 1;
repeated Filter filters = 3;
google.protobuf.BoolValue use_proxy_proto = 4 [deprecated = true];
core.v3.Metadata metadata = 5;
core.v3.TransportSocket transport_socket = 6;
google.protobuf.Duration transport_socket_connect_timeout = 9;
string name = 7;
reserved 2, 8;
reserved "tls_context", "on_demand_configuration";
}
message ListenerFilterChainMatchPredicate {
oneof rule {
MatchSet or_match = 1;
MatchSet and_match = 2;
ListenerFilterChainMatchPredicate not_match = 3;
bool any_match = 4;
type.v3.Int32Range destination_port_range = 5;
}
message MatchSet {
repeated ListenerFilterChainMatchPredicate rules = 1;
}
}
message ListenerFilter {
string name = 1;
ListenerFilterChainMatchPredicate filter_disabled = 4;
oneof config_type {
google.protobuf.Any typed_config = 3;
core.v3.ExtensionConfigSource config_discovery = 5;
}
reserved 2;
reserved "config";
}
@@ -0,0 +1,35 @@
syntax = "proto3";
package envoy.config.listener.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/protocol.proto";
import "envoy/config/core/v3/socket_cmsg_headers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/annotations/v3/status.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3;listenerv3";
option java_multiple_files = true;
option java_outer_classname = "QuicConfigProto";
option java_package = "io.envoyproxy.envoy.config.listener.v3";
message QuicProtocolOptions {
core.v3.QuicProtocolOptions quic_protocol_options = 1;
google.protobuf.Duration idle_timeout = 2;
google.protobuf.Duration crypto_handshake_timeout = 3;
core.v3.RuntimeFeatureFlag enabled = 4;
google.protobuf.UInt32Value packets_to_read_to_connection_count_ratio = 5;
core.v3.TypedExtensionConfig crypto_stream_config = 6;
core.v3.TypedExtensionConfig proof_source_config = 7;
core.v3.TypedExtensionConfig connection_id_generator_config = 8;
core.v3.TypedExtensionConfig server_preferred_address_config = 9;
google.protobuf.BoolValue send_disable_active_migration = 10;
core.v3.TypedExtensionConfig connection_debug_visitor_config = 11;
repeated core.v3.SocketCmsgHeaders save_cmsg_config = 12;
bool reject_new_connections = 13;
}
@@ -0,0 +1,28 @@
syntax = "proto3";
package envoy.config.listener.v3;
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/udp_socket_config.proto";
import "envoy/config/listener/v3/quic_config.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3;listenerv3";
option java_multiple_files = true;
option java_outer_classname = "UdpListenerConfigProto";
option java_package = "io.envoyproxy.envoy.config.listener.v3";
message UdpListenerConfig {
core.v3.UdpSocketConfig downstream_socket_config = 5;
QuicProtocolOptions quic_options = 7;
core.v3.TypedExtensionConfig udp_packet_packet_writer_config = 8;
reserved 1, 2, 3, 4, 6;
reserved "config";
}
message ActiveRawUdpListenerConfig {
}
@@ -0,0 +1,125 @@
syntax = "proto3";
package envoy.config.rbac.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/route/v3/route_components.proto";
import "envoy/type/matcher/v3/filter_state.proto";
import "envoy/type/matcher/v3/metadata.proto";
import "envoy/type/matcher/v3/path.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/v3/range.proto";
import "google/api/expr/v1alpha1/checked.proto";
import "google/api/expr/v1alpha1/syntax.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/rbac/v3;rbacv3";
option java_multiple_files = true;
option java_outer_classname = "RbacProto";
option java_package = "io.envoyproxy.envoy.config.rbac.v3";
message RBAC {
Action action = 1;
enum Action {
ALLOW = 0;
DENY = 1;
LOG = 2;
}
map<string, Policy> policies = 2;
AuditLoggingOptions audit_logging_options = 3;
message AuditLoggingOptions {
AuditCondition audit_condition = 1;
enum AuditCondition {
NONE = 0;
ON_DENY = 1;
ON_ALLOW = 2;
ON_DENY_AND_ALLOW = 3;
}
repeated AuditLoggerConfig logger_configs = 2;
message AuditLoggerConfig {
core.v3.TypedExtensionConfig audit_logger = 1;
bool is_optional = 2;
}
}
}
message Policy {
repeated Permission permissions = 1;
repeated Principal principals = 2;
google.api.expr.v1alpha1.Expr condition = 3;
google.api.expr.v1alpha1.CheckedExpr checked_condition = 4;
}
message SourcedMetadata {
type.matcher.v3.MetadataMatcher metadata_matcher = 1;
MetadataSource metadata_source = 2;
}
message Permission {
oneof rule {
Set and_rules = 1;
Set or_rules = 2;
bool any = 3;
route.v3.HeaderMatcher header = 4;
type.matcher.v3.PathMatcher url_path = 10;
core.v3.CidrRange destination_ip = 5;
uint32 destination_port = 6;
type.v3.Int32Range destination_port_range = 11;
type.matcher.v3.MetadataMatcher metadata = 7 [deprecated = true];
Permission not_rule = 8;
type.matcher.v3.StringMatcher requested_server_name = 9;
core.v3.TypedExtensionConfig matcher = 12;
core.v3.TypedExtensionConfig uri_template = 13;
SourcedMetadata sourced_metadata = 14;
}
message Set {
repeated Permission rules = 1;
}
}
message Principal {
oneof identifier {
Set and_ids = 1;
Set or_ids = 2;
bool any = 3;
Authenticated authenticated = 4;
core.v3.CidrRange source_ip = 5 [deprecated = true];
core.v3.CidrRange direct_remote_ip = 10;
core.v3.CidrRange remote_ip = 11;
route.v3.HeaderMatcher header = 6;
type.matcher.v3.PathMatcher url_path = 9;
type.matcher.v3.MetadataMatcher metadata = 7 [deprecated = true];
type.matcher.v3.FilterStateMatcher filter_state = 12;
Principal not_id = 8;
SourcedMetadata sourced_metadata = 13;
}
message Set {
repeated Principal ids = 1;
}
message Authenticated {
type.matcher.v3.StringMatcher principal_name = 2;
reserved 1;
}
}
message Action {
string name = 1;
RBAC.Action action = 2;
}
enum MetadataSource {
DYNAMIC = 0;
ROUTE = 1;
}
@@ -0,0 +1,41 @@
syntax = "proto3";
package envoy.config.route.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/config_source.proto";
import "envoy/config/route/v3/route_components.proto";
import "google/protobuf/any.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
option java_multiple_files = true;
option java_outer_classname = "RouteProto";
option java_package = "io.envoyproxy.envoy.config.route.v3";
message RouteConfiguration {
string name = 1;
repeated VirtualHost virtual_hosts = 2;
Vhds vhds = 9;
repeated string internal_only_headers = 3;
repeated core.v3.HeaderValueOption response_headers_to_add = 4;
repeated string response_headers_to_remove = 5;
repeated core.v3.HeaderValueOption request_headers_to_add = 6;
repeated string request_headers_to_remove = 8;
bool most_specific_header_mutations_wins = 10;
google.protobuf.BoolValue validate_clusters = 7;
google.protobuf.UInt32Value max_direct_response_body_size_bytes = 11;
repeated ClusterSpecifierPlugin cluster_specifier_plugins = 12;
repeated RouteAction.RequestMirrorPolicy request_mirror_policies = 13;
bool ignore_port_in_host_matching = 14;
bool ignore_path_parameters_in_path_matching = 15;
map<string, google.protobuf.Any> typed_per_filter_config = 16;
core.v3.Metadata metadata = 17;
}
message Vhds {
core.v3.ConfigSource config_source = 1;
}
@@ -0,0 +1,607 @@
syntax = "proto3";
package envoy.config.route.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/config/core/v3/proxy_protocol.proto";
import "envoy/type/matcher/v3/metadata.proto";
import "envoy/type/matcher/v3/regex.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/metadata/v3/metadata.proto";
import "envoy/type/tracing/v3/custom_tag.proto";
import "envoy/type/v3/percent.proto";
import "envoy/type/v3/range.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "xds/type/matcher/v3/matcher.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
option java_multiple_files = true;
option java_outer_classname = "RouteComponentsProto";
option java_package = "io.envoyproxy.envoy.config.route.v3";
message VirtualHost {
string name = 1;
repeated string domains = 2;
repeated Route routes = 3;
xds.type.matcher.v3.Matcher matcher = 21;
TlsRequirementType require_tls = 4;
enum TlsRequirementType {
NONE = 0;
EXTERNAL_ONLY = 1;
ALL = 2;
}
repeated VirtualCluster virtual_clusters = 5;
repeated RateLimit rate_limits = 6;
repeated core.v3.HeaderValueOption request_headers_to_add = 7;
repeated string request_headers_to_remove = 13;
repeated core.v3.HeaderValueOption response_headers_to_add = 10;
repeated string response_headers_to_remove = 11;
CorsPolicy cors = 8 [deprecated = true];
map<string, google.protobuf.Any> typed_per_filter_config = 15;
bool include_request_attempt_count = 14;
bool include_attempt_count_in_response = 19;
RetryPolicy retry_policy = 16;
google.protobuf.Any retry_policy_typed_config = 20;
HedgePolicy hedge_policy = 17;
bool include_is_timeout_retry_header = 23;
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 18;
repeated RouteAction.RequestMirrorPolicy request_mirror_policies = 22;
core.v3.Metadata metadata = 24;
reserved 9, 12;
reserved "per_filter_config";
}
message FilterAction {
google.protobuf.Any action = 1;
}
message RouteList {
repeated Route routes = 1;
}
message Route {
string name = 14;
RouteMatch match = 1;
core.v3.Metadata metadata = 4;
Decorator decorator = 5;
map<string, google.protobuf.Any> typed_per_filter_config = 13;
repeated core.v3.HeaderValueOption request_headers_to_add = 9;
repeated string request_headers_to_remove = 12;
repeated core.v3.HeaderValueOption response_headers_to_add = 10;
repeated string response_headers_to_remove = 11;
Tracing tracing = 15;
google.protobuf.UInt32Value per_request_buffer_limit_bytes = 16;
string stat_prefix = 19;
oneof action {
RouteAction route = 2;
RedirectAction redirect = 3;
DirectResponseAction direct_response = 7;
FilterAction filter_action = 17;
NonForwardingAction non_forwarding_action = 18;
}
reserved 6, 8;
reserved "per_filter_config";
}
message WeightedCluster {
repeated ClusterWeight clusters = 1;
message ClusterWeight {
string name = 1;
string cluster_header = 12;
google.protobuf.UInt32Value weight = 2;
core.v3.Metadata metadata_match = 3;
repeated core.v3.HeaderValueOption request_headers_to_add = 4;
repeated string request_headers_to_remove = 9;
repeated core.v3.HeaderValueOption response_headers_to_add = 5;
repeated string response_headers_to_remove = 6;
map<string, google.protobuf.Any> typed_per_filter_config = 10;
oneof host_rewrite_specifier {
string host_rewrite_literal = 11;
}
reserved 7, 8;
reserved "per_filter_config";
}
google.protobuf.UInt32Value total_weight = 3 [deprecated = true];
string runtime_key_prefix = 2;
oneof random_value_specifier {
string header_name = 4;
}
}
message ClusterSpecifierPlugin {
core.v3.TypedExtensionConfig extension = 1;
bool is_optional = 2;
}
message RouteMatch {
google.protobuf.BoolValue case_sensitive = 4;
core.v3.RuntimeFractionalPercent runtime_fraction = 9;
repeated HeaderMatcher headers = 6;
repeated QueryParameterMatcher query_parameters = 7;
GrpcRouteMatchOptions grpc = 8;
message GrpcRouteMatchOptions {
}
TlsContextMatchOptions tls_context = 11;
message TlsContextMatchOptions {
google.protobuf.BoolValue presented = 1;
google.protobuf.BoolValue validated = 2;
}
repeated type.matcher.v3.MetadataMatcher dynamic_metadata = 13;
oneof path_specifier {
string prefix = 1;
string path = 2;
type.matcher.v3.RegexMatcher safe_regex = 10;
ConnectMatcher connect_matcher = 12;
string path_separated_prefix = 14;
core.v3.TypedExtensionConfig path_match_policy = 15;
}
reserved 5, 3;
reserved "regex";
message ConnectMatcher {
}
}
message CorsPolicy {
repeated type.matcher.v3.StringMatcher allow_origin_string_match = 11;
string allow_methods = 2;
string allow_headers = 3;
string expose_headers = 4;
string max_age = 5;
google.protobuf.BoolValue allow_credentials = 6;
core.v3.RuntimeFractionalPercent shadow_enabled = 10;
google.protobuf.BoolValue allow_private_network_access = 12;
google.protobuf.BoolValue forward_not_matching_preflights = 13;
oneof enabled_specifier {
core.v3.RuntimeFractionalPercent filter_enabled = 9;
}
reserved 1, 8, 7;
reserved "allow_origin", "allow_origin_regex", "enabled";
}
message RouteAction {
ClusterNotFoundResponseCode cluster_not_found_response_code = 20;
enum ClusterNotFoundResponseCode {
SERVICE_UNAVAILABLE = 0;
NOT_FOUND = 1;
INTERNAL_SERVER_ERROR = 2;
}
core.v3.Metadata metadata_match = 4;
string prefix_rewrite = 5;
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 32;
core.v3.TypedExtensionConfig path_rewrite_policy = 41;
bool append_x_forwarded_host = 38;
google.protobuf.Duration timeout = 8;
google.protobuf.Duration idle_timeout = 24;
core.v3.TypedExtensionConfig early_data_policy = 40;
RetryPolicy retry_policy = 9;
google.protobuf.Any retry_policy_typed_config = 33;
repeated RequestMirrorPolicy request_mirror_policies = 30;
message RequestMirrorPolicy {
string cluster = 1;
string cluster_header = 5;
core.v3.RuntimeFractionalPercent runtime_fraction = 3;
google.protobuf.BoolValue trace_sampled = 4;
bool disable_shadow_host_suffix_append = 6;
reserved 2;
reserved "runtime_key";
}
core.v3.RoutingPriority priority = 11;
repeated RateLimit rate_limits = 13;
google.protobuf.BoolValue include_vh_rate_limits = 14 [deprecated = true];
repeated HashPolicy hash_policy = 15;
message HashPolicy {
bool terminal = 4;
oneof policy_specifier {
Header header = 1;
Cookie cookie = 2;
ConnectionProperties connection_properties = 3;
QueryParameter query_parameter = 5;
FilterState filter_state = 6;
}
message Header {
string header_name = 1;
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
}
message CookieAttribute {
string name = 1;
string value = 2;
}
message Cookie {
string name = 1;
google.protobuf.Duration ttl = 2;
string path = 3;
repeated CookieAttribute attributes = 4;
}
message ConnectionProperties {
bool source_ip = 1;
}
message QueryParameter {
string name = 1;
}
message FilterState {
string key = 1;
}
}
CorsPolicy cors = 17 [deprecated = true];
google.protobuf.Duration max_grpc_timeout = 23 [deprecated = true];
google.protobuf.Duration grpc_timeout_offset = 28 [deprecated = true];
repeated UpgradeConfig upgrade_configs = 25;
message UpgradeConfig {
string upgrade_type = 1;
google.protobuf.BoolValue enabled = 2;
ConnectConfig connect_config = 3;
message ConnectConfig {
core.v3.ProxyProtocolConfig proxy_protocol_config = 1;
bool allow_post = 2;
}
}
InternalRedirectPolicy internal_redirect_policy = 34;
InternalRedirectAction internal_redirect_action = 26 [deprecated = true];
enum InternalRedirectAction {
option deprecated = true;
PASS_THROUGH_INTERNAL_REDIRECT = 0;
HANDLE_INTERNAL_REDIRECT = 1;
}
google.protobuf.UInt32Value max_internal_redirects = 31 [deprecated = true];
HedgePolicy hedge_policy = 27;
MaxStreamDuration max_stream_duration = 36;
message MaxStreamDuration {
google.protobuf.Duration max_stream_duration = 1;
google.protobuf.Duration grpc_timeout_header_max = 2;
google.protobuf.Duration grpc_timeout_header_offset = 3;
}
oneof cluster_specifier {
string cluster = 1;
string cluster_header = 2;
WeightedCluster weighted_clusters = 3;
string cluster_specifier_plugin = 37;
ClusterSpecifierPlugin inline_cluster_specifier_plugin = 39;
}
oneof host_rewrite_specifier {
string host_rewrite_literal = 6;
google.protobuf.BoolValue auto_host_rewrite = 7;
string host_rewrite_header = 29;
type.matcher.v3.RegexMatchAndSubstitute host_rewrite_path_regex = 35;
}
reserved 12, 18, 19, 16, 22, 21, 10;
reserved "request_mirror_policy";
}
message RetryPolicy {
string retry_on = 1;
google.protobuf.UInt32Value num_retries = 2;
google.protobuf.Duration per_try_timeout = 3;
google.protobuf.Duration per_try_idle_timeout = 13;
RetryPriority retry_priority = 4;
message RetryPriority {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
repeated RetryHostPredicate retry_host_predicate = 5;
message RetryHostPredicate {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
repeated core.v3.TypedExtensionConfig retry_options_predicates = 12;
int64 host_selection_retry_max_attempts = 6;
repeated uint32 retriable_status_codes = 7;
RetryBackOff retry_back_off = 8;
message RetryBackOff {
google.protobuf.Duration base_interval = 1;
google.protobuf.Duration max_interval = 2;
}
RateLimitedRetryBackOff rate_limited_retry_back_off = 11;
message RateLimitedRetryBackOff {
repeated ResetHeader reset_headers = 1;
google.protobuf.Duration max_interval = 2;
}
repeated HeaderMatcher retriable_headers = 9;
repeated HeaderMatcher retriable_request_headers = 10;
message ResetHeader {
string name = 1;
ResetHeaderFormat format = 2;
}
enum ResetHeaderFormat {
SECONDS = 0;
UNIX_TIMESTAMP = 1;
}
}
message HedgePolicy {
google.protobuf.UInt32Value initial_requests = 1;
type.v3.FractionalPercent additional_request_chance = 2;
bool hedge_on_per_try_timeout = 3;
}
message RedirectAction {
string host_redirect = 1;
uint32 port_redirect = 8;
RedirectResponseCode response_code = 3;
enum RedirectResponseCode {
MOVED_PERMANENTLY = 0;
FOUND = 1;
SEE_OTHER = 2;
TEMPORARY_REDIRECT = 3;
PERMANENT_REDIRECT = 4;
}
bool strip_query = 6;
oneof scheme_rewrite_specifier {
bool https_redirect = 4;
string scheme_redirect = 7;
}
oneof path_rewrite_specifier {
string path_redirect = 2;
string prefix_rewrite = 5;
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 9;
}
}
message DirectResponseAction {
uint32 status = 1;
core.v3.DataSource body = 2;
}
message NonForwardingAction {
}
message Decorator {
string operation = 1;
google.protobuf.BoolValue propagate = 2;
}
message Tracing {
type.v3.FractionalPercent client_sampling = 1;
type.v3.FractionalPercent random_sampling = 2;
type.v3.FractionalPercent overall_sampling = 3;
repeated type.tracing.v3.CustomTag custom_tags = 4;
}
message VirtualCluster {
repeated HeaderMatcher headers = 4;
string name = 2;
reserved 1, 3;
reserved "pattern", "method";
}
message RateLimit {
google.protobuf.UInt32Value stage = 1;
string disable_key = 2;
repeated Action actions = 3;
message Action {
oneof action_specifier {
SourceCluster source_cluster = 1;
DestinationCluster destination_cluster = 2;
RequestHeaders request_headers = 3;
QueryParameters query_parameters = 12;
RemoteAddress remote_address = 4;
GenericKey generic_key = 5;
HeaderValueMatch header_value_match = 6;
DynamicMetaData dynamic_metadata = 7 [deprecated = true];
MetaData metadata = 8;
core.v3.TypedExtensionConfig extension = 9;
MaskedRemoteAddress masked_remote_address = 10;
QueryParameterValueMatch query_parameter_value_match = 11;
}
message SourceCluster {
}
message DestinationCluster {
}
message RequestHeaders {
string header_name = 1;
string descriptor_key = 2;
bool skip_if_absent = 3;
}
message QueryParameters {
string query_parameter_name = 1;
string descriptor_key = 2;
bool skip_if_absent = 3;
}
message RemoteAddress {
}
message MaskedRemoteAddress {
google.protobuf.UInt32Value v4_prefix_mask_len = 1;
google.protobuf.UInt32Value v6_prefix_mask_len = 2;
}
message GenericKey {
string descriptor_value = 1;
string descriptor_key = 2;
}
message HeaderValueMatch {
string descriptor_key = 4;
string descriptor_value = 1;
google.protobuf.BoolValue expect_match = 2;
repeated HeaderMatcher headers = 3;
}
message DynamicMetaData {
string descriptor_key = 1;
type.metadata.v3.MetadataKey metadata_key = 2;
string default_value = 3;
}
message MetaData {
string descriptor_key = 1;
type.metadata.v3.MetadataKey metadata_key = 2;
string default_value = 3;
Source source = 4;
enum Source {
DYNAMIC = 0;
ROUTE_ENTRY = 1;
}
bool skip_if_absent = 5;
}
message QueryParameterValueMatch {
string descriptor_key = 4;
string descriptor_value = 1;
google.protobuf.BoolValue expect_match = 2;
repeated QueryParameterMatcher query_parameters = 3;
}
}
Override limit = 4;
message Override {
oneof override_specifier {
DynamicMetadata dynamic_metadata = 1;
}
message DynamicMetadata {
type.metadata.v3.MetadataKey metadata_key = 1;
}
}
HitsAddend hits_addend = 5;
message HitsAddend {
google.protobuf.UInt64Value number = 1;
string format = 2;
}
bool apply_on_stream_done = 6;
}
message HeaderMatcher {
string name = 1;
bool invert_match = 8;
bool treat_missing_header_as_empty = 14;
oneof header_match_specifier {
string exact_match = 4 [deprecated = true];
type.matcher.v3.RegexMatcher safe_regex_match = 11 [deprecated = true];
type.v3.Int64Range range_match = 6;
bool present_match = 7;
string prefix_match = 9 [deprecated = true];
string suffix_match = 10 [deprecated = true];
string contains_match = 12 [deprecated = true];
type.matcher.v3.StringMatcher string_match = 13;
}
reserved 2, 3, 5;
reserved "regex_match";
}
message QueryParameterMatcher {
string name = 1;
oneof query_parameter_match_specifier {
type.matcher.v3.StringMatcher string_match = 5;
bool present_match = 6;
}
reserved 3, 4;
reserved "value", "regex";
}
message InternalRedirectPolicy {
google.protobuf.UInt32Value max_internal_redirects = 1;
repeated uint32 redirect_response_codes = 2;
repeated core.v3.TypedExtensionConfig predicates = 3;
bool allow_cross_scheme_redirect = 4;
repeated string response_headers_to_copy = 5;
}
message FilterConfig {
google.protobuf.Any config = 1;
bool is_optional = 2;
bool disabled = 3;
}
@@ -0,0 +1,31 @@
syntax = "proto3";
package envoy.config.route.v3;
import "envoy/config/route/v3/route.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/route/v3;routev3";
option java_multiple_files = true;
option java_outer_classname = "ScopedRouteProto";
option java_package = "io.envoyproxy.envoy.config.route.v3";
message ScopedRouteConfiguration {
bool on_demand = 4;
string name = 1;
string route_configuration_name = 2;
RouteConfiguration route_configuration = 5;
Key key = 3;
message Key {
repeated Fragment fragments = 1;
message Fragment {
oneof type {
string string_key = 1;
}
}
}
}
@@ -0,0 +1,28 @@
syntax = "proto3";
package envoy.config.trace.v3;
import "google/protobuf/any.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/trace/v3;tracev3";
option java_multiple_files = true;
option java_outer_classname = "HttpTracerProto";
option java_package = "io.envoyproxy.envoy.config.trace.v3";
message Tracing {
Http http = 1;
message Http {
string name = 1;
oneof config_type {
google.protobuf.Any typed_config = 3;
}
reserved 2;
reserved "config";
}
}
@@ -0,0 +1,199 @@
syntax = "proto3";
package envoy.data.accesslog.v3;
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/base.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3;accesslogv3";
option java_multiple_files = true;
option java_outer_classname = "AccesslogProto";
option java_package = "io.envoyproxy.envoy.data.accesslog.v3";
message TCPAccessLogEntry {
AccessLogCommon common_properties = 1;
ConnectionProperties connection_properties = 2;
}
message HTTPAccessLogEntry {
AccessLogCommon common_properties = 1;
HTTPVersion protocol_version = 2;
enum HTTPVersion {
PROTOCOL_UNSPECIFIED = 0;
HTTP10 = 1;
HTTP11 = 2;
HTTP2 = 3;
HTTP3 = 4;
}
HTTPRequestProperties request = 3;
HTTPResponseProperties response = 4;
}
message ConnectionProperties {
uint64 received_bytes = 1;
uint64 sent_bytes = 2;
}
message AccessLogCommon {
double sample_rate = 1;
config.core.v3.Address downstream_remote_address = 2;
config.core.v3.Address downstream_local_address = 3;
TLSProperties tls_properties = 4;
google.protobuf.Timestamp start_time = 5;
google.protobuf.Duration time_to_last_rx_byte = 6;
google.protobuf.Duration time_to_first_upstream_tx_byte = 7;
google.protobuf.Duration time_to_last_upstream_tx_byte = 8;
google.protobuf.Duration time_to_first_upstream_rx_byte = 9;
google.protobuf.Duration time_to_last_upstream_rx_byte = 10;
google.protobuf.Duration time_to_first_downstream_tx_byte = 11;
google.protobuf.Duration time_to_last_downstream_tx_byte = 12;
config.core.v3.Address upstream_remote_address = 13;
config.core.v3.Address upstream_local_address = 14;
string upstream_cluster = 15;
ResponseFlags response_flags = 16;
config.core.v3.Metadata metadata = 17;
string upstream_transport_failure_reason = 18;
string route_name = 19;
config.core.v3.Address downstream_direct_remote_address = 20;
map<string, google.protobuf.Any> filter_state_objects = 21;
map<string, string> custom_tags = 22;
google.protobuf.Duration duration = 23;
uint32 upstream_request_attempt_count = 24;
string connection_termination_details = 25;
string stream_id = 26;
bool intermediate_log_entry = 27 [deprecated = true];
string downstream_transport_failure_reason = 28;
uint64 downstream_wire_bytes_sent = 29;
uint64 downstream_wire_bytes_received = 30;
uint64 upstream_wire_bytes_sent = 31;
uint64 upstream_wire_bytes_received = 32;
AccessLogType access_log_type = 33;
}
message ResponseFlags {
bool failed_local_healthcheck = 1;
bool no_healthy_upstream = 2;
bool upstream_request_timeout = 3;
bool local_reset = 4;
bool upstream_remote_reset = 5;
bool upstream_connection_failure = 6;
bool upstream_connection_termination = 7;
bool upstream_overflow = 8;
bool no_route_found = 9;
bool delay_injected = 10;
bool fault_injected = 11;
bool rate_limited = 12;
Unauthorized unauthorized_details = 13;
message Unauthorized {
Reason reason = 1;
enum Reason {
REASON_UNSPECIFIED = 0;
EXTERNAL_SERVICE = 1;
}
}
bool rate_limit_service_error = 14;
bool downstream_connection_termination = 15;
bool upstream_retry_limit_exceeded = 16;
bool stream_idle_timeout = 17;
bool invalid_envoy_request_headers = 18;
bool downstream_protocol_error = 19;
bool upstream_max_stream_duration_reached = 20;
bool response_from_cache_filter = 21;
bool no_filter_config_found = 22;
bool duration_timeout = 23;
bool upstream_protocol_error = 24;
bool no_cluster_found = 25;
bool overload_manager = 26;
bool dns_resolution_failure = 27;
bool downstream_remote_reset = 28;
}
message TLSProperties {
TLSVersion tls_version = 1;
enum TLSVersion {
VERSION_UNSPECIFIED = 0;
TLSv1 = 1;
TLSv1_1 = 2;
TLSv1_2 = 3;
TLSv1_3 = 4;
}
google.protobuf.UInt32Value tls_cipher_suite = 2;
string tls_sni_hostname = 3;
CertificateProperties local_certificate_properties = 4;
message CertificateProperties {
repeated SubjectAltName subject_alt_name = 1;
message SubjectAltName {
oneof san {
string uri = 1;
string dns = 2;
}
}
string subject = 2;
string issuer = 3;
}
CertificateProperties peer_certificate_properties = 5;
string tls_session_id = 6;
string ja3_fingerprint = 7;
}
message HTTPRequestProperties {
config.core.v3.RequestMethod request_method = 1;
string scheme = 2;
string authority = 3;
google.protobuf.UInt32Value port = 4;
string path = 5;
string user_agent = 6;
string referer = 7;
string forwarded_for = 8;
string request_id = 9;
string original_path = 10;
uint64 request_headers_bytes = 11;
uint64 request_body_bytes = 12;
map<string, string> request_headers = 13;
uint64 upstream_header_bytes_sent = 14;
uint64 downstream_header_bytes_received = 15;
}
message HTTPResponseProperties {
google.protobuf.UInt32Value response_code = 1;
uint64 response_headers_bytes = 2;
uint64 response_body_bytes = 3;
map<string, string> response_headers = 4;
map<string, string> response_trailers = 5;
string response_code_details = 6;
uint64 upstream_header_bytes_received = 7;
uint64 downstream_header_bytes_sent = 8;
}
enum AccessLogType {
NotSet = 0;
TcpUpstreamConnected = 1;
TcpPeriodic = 2;
TcpConnectionEnd = 3;
DownstreamStart = 4;
DownstreamPeriodic = 5;
DownstreamEnd = 6;
UpstreamPoolReady = 7;
UpstreamPeriodic = 8;
UpstreamEnd = 9;
DownstreamTunnelSuccessfullyEstablished = 10;
UdpTunnelUpstreamConnected = 11;
UdpPeriodic = 12;
UdpSessionEnd = 13;
}
@@ -0,0 +1,16 @@
syntax = "proto3";
package envoy.extensions.clusters.aggregate.v3;
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/aggregate/v3;aggregatev3";
option java_multiple_files = true;
option java_outer_classname = "ClusterProto";
option java_package = "io.envoyproxy.envoy.extensions.clusters.aggregate.v3";
message ClusterConfig {
repeated string clusters = 1;
}
@@ -0,0 +1,52 @@
syntax = "proto3";
package envoy.extensions.filters.common.fault.v3;
import "envoy/type/v3/percent.proto";
import "google/protobuf/duration.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/fault/v3;faultv3";
option java_multiple_files = true;
option java_outer_classname = "FaultProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.common.fault.v3";
message FaultDelay {
type.v3.FractionalPercent percentage = 4;
oneof fault_delay_secifier {
google.protobuf.Duration fixed_delay = 3;
HeaderDelay header_delay = 5;
}
reserved 2, 1;
reserved "type";
message HeaderDelay {
}
enum FaultDelayType {
FIXED = 0;
}
}
message FaultRateLimit {
type.v3.FractionalPercent percentage = 2;
oneof limit_type {
FixedLimit fixed_limit = 1;
HeaderLimit header_limit = 3;
}
message FixedLimit {
uint64 limit_kbps = 1;
}
message HeaderLimit {
}
}
@@ -0,0 +1,52 @@
syntax = "proto3";
package envoy.extensions.filters.http.fault.v3;
import "envoy/config/route/v3/route_components.proto";
import "envoy/extensions/filters/common/fault/v3/fault.proto";
import "envoy/type/v3/percent.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/fault/v3;faultv3";
option java_multiple_files = true;
option java_outer_classname = "FaultProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.fault.v3";
message FaultAbort {
type.v3.FractionalPercent percentage = 3;
oneof error_type {
uint32 http_status = 2;
uint32 grpc_status = 5;
HeaderAbort header_abort = 4;
}
reserved 1;
message HeaderAbort {
}
}
message HTTPFault {
common.fault.v3.FaultDelay delay = 1;
FaultAbort abort = 2;
string upstream_cluster = 3;
repeated config.route.v3.HeaderMatcher headers = 4;
repeated string downstream_nodes = 5;
google.protobuf.UInt32Value max_active_faults = 6;
common.fault.v3.FaultRateLimit response_rate_limit = 7;
string delay_percent_runtime = 8;
string abort_percent_runtime = 9;
string delay_duration_runtime = 10;
string abort_http_status_runtime = 11;
string max_active_faults_runtime = 12;
string response_rate_limit_percent_runtime = 13;
string abort_grpc_status_runtime = 14;
bool disable_downstream_cluster_stats = 15;
google.protobuf.Struct filter_metadata = 16;
}
@@ -0,0 +1,38 @@
syntax = "proto3";
package envoy.extensions.filters.http.gcp_authn.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/http_uri.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/gcp_authn/v3;gcp_authnv3";
option java_multiple_files = true;
option java_outer_classname = "GcpAuthnProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.gcp_authn.v3";
message GcpAuthnFilterConfig {
config.core.v3.HttpUri http_uri = 1 [deprecated = true];
config.core.v3.RetryPolicy retry_policy = 2;
TokenCacheConfig cache_config = 3;
TokenHeader token_header = 4;
string cluster = 5;
google.protobuf.Duration timeout = 6;
}
message Audience {
string url = 1;
}
message TokenCacheConfig {
google.protobuf.UInt64Value cache_size = 1;
}
message TokenHeader {
string name = 1;
string value_prefix = 2;
}
@@ -0,0 +1,31 @@
syntax = "proto3";
package envoy.extensions.filters.http.rbac.v3;
import "envoy/config/rbac/v3/rbac.proto";
import "xds/annotations/v3/status.proto";
import "xds/type/matcher/v3/matcher.proto";
import "udpa/annotations/migrate.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rbac/v3;rbacv3";
option java_multiple_files = true;
option java_outer_classname = "RbacProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.rbac.v3";
message RBAC {
config.rbac.v3.RBAC rules = 1;
string rules_stat_prefix = 6;
xds.type.matcher.v3.Matcher matcher = 4;
config.rbac.v3.RBAC shadow_rules = 2;
xds.type.matcher.v3.Matcher shadow_matcher = 5;
string shadow_rules_stat_prefix = 3;
bool track_per_rule_stats = 7;
}
message RBACPerRoute {
RBAC rbac = 2;
reserved 1;
}
@@ -0,0 +1,35 @@
syntax = "proto3";
package envoy.extensions.filters.http.router.v3;
import "envoy/config/accesslog/v3/accesslog.proto";
import "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3;routerv3";
option java_multiple_files = true;
option java_outer_classname = "RouterProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.router.v3";
message Router {
google.protobuf.BoolValue dynamic_stats = 1;
bool start_child_span = 2 [deprecated = true];
repeated config.accesslog.v3.AccessLog upstream_log = 3;
UpstreamAccessLogOptions upstream_log_options = 9;
message UpstreamAccessLogOptions {
bool flush_upstream_log_on_upstream_stream = 1;
google.protobuf.Duration upstream_log_flush_interval = 2;
}
bool suppress_envoy_headers = 4;
repeated string strict_check_headers = 5;
bool respect_expected_rq_timeout = 6;
bool suppress_grpc_request_failure_code_stats = 7;
repeated network.http_connection_manager.v3.HttpFilter upstream_http_filters = 8;
}
@@ -0,0 +1,24 @@
syntax = "proto3";
package envoy.extensions.filters.http.stateful_session.v3;
import "envoy/config/core/v3/extension.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/stateful_session/v3;stateful_sessionv3";
option java_multiple_files = true;
option java_outer_classname = "StatefulSessionProto";
option java_package = "io.envoyproxy.envoy.extensions.filters.http.stateful_session.v3";
message StatefulSession {
config.core.v3.TypedExtensionConfig session_state = 1;
bool strict = 2;
}
message StatefulSessionPerRoute {
oneof override {
bool disabled = 1;
StatefulSession stateful_session = 2;
}
}
Loaded 100 of 185 files, more files were not shown because too many files have changed in this diff. Show more