Commit 939d18d
fix: Upgrade protobufjs and fix legacy key decoding in Datastore (#8088)
* fix: upgrade protobufjs and fix legacy key decoding
Upgrades protobufjs to ^7.5.5 to address security vulnerabilities.
Introduces a fix for legacy App Engine key decoding by explicitly calling
.setup() on Reference, Path, and Element types. This ensures that group
support (wire types 3 and 4) is correctly initialized in newer versions
of protobufjs, which is required for these legacy keys.
Fixes the "invalid wire type 4" error in unit tests.
Co-authored-by: danieljbruce <8935272+danieljbruce@users.noreply.github.com>
* fix: upgrade protobufjs and fix legacy key decoding
Upgrades protobufjs to ^7.5.5 to address security vulnerabilities (GHSA-xq3m-2v4x-88gg).
Resolves a functional regression in decoding legacy App Engine keys by
explicitly calling .setup() on Reference, Path, and Element types. This
forces the generation of optimized decoders that correctly support
proto2 groups, preventing "invalid wire type 4" errors.
Adds 10+ regression tests for legacyDecode covering various scenarios.
Co-authored-by: danieljbruce <8935272+danieljbruce@users.noreply.github.com>
* fix: upgrade protobufjs and fix legacy key decoding with inverse tests
Upgrades protobufjs to ^7.5.5 to address security vulnerabilities (GHSA-xq3m-2v4x-88gg).
Resolves a functional regression in decoding legacy App Engine keys by
explicitly calling .setup() on Reference, Path, and Element types. This
forces the generation of optimized decoders that correctly support
proto2 groups, preventing "invalid wire type 4" errors.
Adds 10+ regression tests for legacyDecode and updates all legacy key tests
to verify that legacyDecode and legacyEncode are inverses of each other.
Co-authored-by: danieljbruce <8935272+danieljbruce@users.noreply.github.com>
* Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fix: Upgrade protobufjs and fix legacy key decoding in Datastore
* Remove the as any cast
* Add a describe block for the encode/decode tests
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: danieljbruce <8935272+danieljbruce@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent 682c5dd commit 939d18d
3 files changed
Lines changed: 84 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1302 | 1302 | | |
1303 | 1303 | | |
1304 | 1304 | | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1305 | 1313 | | |
1306 | 1314 | | |
1307 | 1315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1800 | 1800 | | |
1801 | 1801 | | |
1802 | 1802 | | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
1803 | 1807 | | |
1804 | 1808 | | |
1805 | 1809 | | |
| |||
1808 | 1812 | | |
1809 | 1813 | | |
1810 | 1814 | | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
1811 | 1819 | | |
1812 | 1820 | | |
1813 | 1821 | | |
| |||
1816 | 1824 | | |
1817 | 1825 | | |
1818 | 1826 | | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
1819 | 1831 | | |
1820 | 1832 | | |
1821 | 1833 | | |
| |||
1831 | 1843 | | |
1832 | 1844 | | |
1833 | 1845 | | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1834 | 1909 | | |
1835 | 1910 | | |
1836 | 1911 | | |
| |||
0 commit comments