diff --git a/Cargo.lock b/Cargo.lock index caa5863c1..2bc65a80d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,6 +1869,7 @@ dependencies = [ "subtle", "thiserror", "time", + "unicode-general-category", "uuid", "wasm-bindgen-test", "web-time", @@ -5161,6 +5162,12 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" +[[package]] +name = "unicode-general-category" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07547e3ee45e28326cc23faac56d44f58f16ab23e413db526debce3b0bfd2742" + [[package]] name = "unicode-ident" version = "1.0.24" diff --git a/Cargo.toml b/Cargo.toml index 90158cc0c..1261b3cd5 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -217,6 +217,12 @@ config = "0.14" # Security zeroize = { version = "1.8", features = ["derive"] } +unicode-properties = "0.1.4" +# Unicode 13.0 general categories for the table tag grammar. The service +# refuses letters and digits that Unicode 14.0 and later assign, so the +# version is pinned to the last release with 13.0 tables. +unicode-general-category = "=0.4.0" + # Size-optimised profile for the `extenddb-dev` container image only. # # Deliberately NOT applied to `[profile.release]`: the production Postgres and diff --git a/SOFTWARE-LICENSE-NOTICES-CASSANDRA.html b/SOFTWARE-LICENSE-NOTICES-CASSANDRA.html index 895971ded..da19092a4 100644 --- a/SOFTWARE-LICENSE-NOTICES-CASSANDRA.html +++ b/SOFTWARE-LICENSE-NOTICES-CASSANDRA.html @@ -49,7 +49,7 @@
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
diff --git a/SOFTWARE-LICENSE-NOTICES-DEV.html b/SOFTWARE-LICENSE-NOTICES-DEV.html
index fe3338395..470e3f7ee 100644
--- a/SOFTWARE-LICENSE-NOTICES-DEV.html
+++ b/SOFTWARE-LICENSE-NOTICES-DEV.html
@@ -49,7 +49,7 @@ ExtendDB Software License Notices
Overview of licenses:
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
diff --git a/SOFTWARE-LICENSE-NOTICES-MONGODB.html b/SOFTWARE-LICENSE-NOTICES-MONGODB.html
index 019c0c9f4..35a2fb22e 100644
--- a/SOFTWARE-LICENSE-NOTICES-MONGODB.html
+++ b/SOFTWARE-LICENSE-NOTICES-MONGODB.html
@@ -49,7 +49,7 @@ ExtendDB Software License Notices
Overview of licenses:
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
diff --git a/SOFTWARE-LICENSE-NOTICES.html b/SOFTWARE-LICENSE-NOTICES.html
index 9197bd453..abe5fcfbe 100644
--- a/SOFTWARE-LICENSE-NOTICES.html
+++ b/SOFTWARE-LICENSE-NOTICES.html
@@ -49,7 +49,7 @@ ExtendDB Software License Notices
Overview of licenses:
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
diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml
index 5515035ae..1c63eea72 100755
--- a/crates/core/Cargo.toml
+++ b/crates/core/Cargo.toml
@@ -21,6 +21,7 @@ md-5 = { workspace = true }
sha2 = { workspace = true }
time = { workspace = true }
uuid = { workspace = true }
+unicode-general-category = { workspace = true }
zeroize = { workspace = true }
web-time = { workspace = true }
diff --git a/crates/core/src/validation/mod.rs b/crates/core/src/validation/mod.rs
index 9c1bcbb21..fd6054377 100755
--- a/crates/core/src/validation/mod.rs
+++ b/crates/core/src/validation/mod.rs
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
pub mod number;
pub mod restorable_item;
+pub mod tag;
pub mod vector_item;
pub mod warm_throughput;
@@ -9,6 +10,7 @@ pub use restorable_item::{
RestorableItemError, RestorableItemReason, RestorableKeySchema, RestorableLimits,
SHOWN_VALUE_BYTES, validate_restorable_item,
};
+pub use tag::{validate_folded_tag_prefix, validate_tag_keys, validate_tags, validate_tags_member};
pub use vector_item::{
MAX_HASH_KEY_SIZE, MAX_INLINE_FILTER_SIZE, validate_vector_write,
validate_vector_write_changed, vector_components, vector_norm,
@@ -103,23 +105,64 @@ pub fn validate_index_name(name: &str) -> Result<(), DynamoDbError> {
Ok(())
}
-/// Validate a `CreateTable` request.
+/// Validate a `CreateTable` request: the table name, then
+/// [`validate_create_table_constraints`], then
+/// [`validate_create_table_definition`]. `handle_create_table` calls the two
+/// groups itself, with its tag check between them; `RestoreTableFromBackup`
+/// calls this.
+///
+/// # Errors
+///
+/// `ValidationException` for the first failed check.
+pub fn validate_create_table(
+ input: &CreateTableInput,
+ limits: &LimitsConfig,
+) -> Result<(), DynamoDbError> {
+ validate_table_name(&input.table_name, limits)?;
+ validate_create_table_constraints(input)?;
+ validate_create_table_definition(input, limits)
+}
+
+/// The `CreateTable` checks the service makes before a tag key that reads
+/// `aws:` once U+017F is read as `s`: each index name, the table's throughput
+/// against its billing mode, and the throughput minimum of a provisioned
+/// table's GSIs (measured 2026-11-24).
+///
+/// # Errors
+///
+/// `ValidationException` for the first failed check.
+pub fn validate_create_table_constraints(input: &CreateTableInput) -> Result<(), DynamoDbError> {
+ for gsi in input.global_secondary_indexes.iter().flatten() {
+ validate_index_name(&gsi.index_name)?;
+ }
+ for lsi in input.local_secondary_indexes.iter().flatten() {
+ validate_index_name(&lsi.index_name)?;
+ }
+ validate_provisioned_throughput(input)?;
+ validate_gsi_throughput_minimum(input)
+}
+
+/// The rest of the `CreateTable` checks, which the service makes after that
+/// tag key. Measured on 2026-11-20 and 2026-11-24: two HASH keys, a third key
+/// schema element, an undefined or unused attribute definition, a GSI's
+/// throughput on an on-demand table and `StreamEnabled` without a view type.
///
/// When `allow_multipart_table_keys` is `true`, base tables may have up to 4 HASH
/// and 4 RANGE key schema elements (preview extension). GSIs always allow multi-part
/// keys regardless of this flag.
-pub fn validate_create_table(
+///
+/// # Errors
+///
+/// `ValidationException` for the first failed check.
+pub fn validate_create_table_definition(
input: &CreateTableInput,
limits: &LimitsConfig,
) -> Result<(), DynamoDbError> {
- validate_table_name(&input.table_name, limits)?;
validate_key_schema(input, limits.allow_multipart_table_keys)?;
validate_gsi_key_schemas(input)?;
validate_lsi_key_schemas(input)?;
validate_attribute_definitions(input)?;
- validate_provisioned_throughput(input)?;
validate_gsi_provisioned_throughput(input)?;
- validate_gsi_throughput_minimum(input)?;
validate_gsi_count(input, limits)?;
validate_lsi_count(input, limits)?;
validate_lsi_requires_range_key(input)?;
@@ -817,7 +860,6 @@ fn validate_gsi_key_schemas(input: &CreateTableInput) -> Result<(), DynamoDbErro
return Ok(());
};
for gsi in gsis {
- validate_index_name(&gsi.index_name)?;
if gsi.key_schema.is_empty() {
return Err(DynamoDbError::ValidationException(format!(
"One or more parameter values were invalid: No defined key schema for index: {}",
@@ -843,7 +885,6 @@ fn validate_lsi_key_schemas(input: &CreateTableInput) -> Result<(), DynamoDbErro
};
let table_hash_key = &input.key_schema[0].attribute_name;
for lsi in lsis {
- validate_index_name(&lsi.index_name)?;
match lsi.key_schema.as_slice() {
[hash, range] => {
if hash.key_type != KeyType::Hash {
diff --git a/crates/core/src/validation/tag.rs b/crates/core/src/validation/tag.rs
new file mode 100644
index 000000000..38600fbfd
--- /dev/null
+++ b/crates/core/src/validation/tag.rs
@@ -0,0 +1,445 @@
+// Copyright 2026 ExtendDB contributors
+// SPDX-License-Identifier: Apache-2.0
+
+//! Tag key and value validation, shared by `TagResource`, `UntagResource` and
+//! `CreateTable.Tags`.
+
+use unicode_general_category::{GeneralCategory, get_general_category};
+
+use crate::error::DynamoDbError;
+use crate::types::Tag;
+
+/// Longest tag key the service accepts, in UTF-16 code units. A key of 64
+/// U+20000 (two units each) is accepted and one of 65 is refused, and a key of
+/// 127 ASCII letters and one U+20000 is refused (measured 2026-11-20). A key
+/// of 128 two-byte UTF-8 characters such as `é` is one unit each and is
+/// accepted.
+const MAX_TAG_KEY_UNITS: usize = 128;
+
+/// Longest tag value the service accepts, in UTF-16 code units: 128 U+20000
+/// and 256 `é` are accepted, 129 U+20000 and 257 `é` are refused (measured
+/// 2026-11-20).
+const MAX_TAG_VALUE_UNITS: usize = 256;
+
+/// Whether `c` is admissible in a tag key or value.
+///
+/// The grammar is `[\p{L}\p{Z}\p{N}_.:/=+\-@]`: any Unicode Letter (Lu, Ll,
+/// Lt, Lm, Lo), Number (Nd, Nl, No) or Separator (Zs, Zl, Zp), plus the eight
+/// listed characters. Measured against the service: `é`, `ß`, a CJK ideograph
+/// and a Cyrillic letter are accepted, as are U+01C5 (Lt), U+02B0 (Lm), an
+/// Arabic-Indic digit (Nd), a Roman numeral (Nl), U+00B2 (No), U+00A0 (Zs),
+/// U+2028 (Zl) and U+2029 (Zp); U+0301 and U+093E (combining marks), U+200B
+/// (a format character), an emoji, a tab, a newline and the other ASCII
+/// punctuation characters are rejected.
+///
+/// The categories are those of Unicode 13.0, from `unicode-general-category`
+/// 0.4.0. The service refuses letters and digits that later versions assign
+/// (U+0870 and U+16AC0 from 14.0, U+31350 from 15.0, U+2EBF0 from 15.1,
+/// U+1C89 from 16.0, U+323B0 from 17.0) and accepts the 13.0 additions U+08BE,
+/// U+10E80 and U+30000 (measured 2026-11-20). `char::is_alphabetic` is not
+/// used: it is the Alphabetic property, a superset of `\p{L}` that admits
+/// Other_Alphabetic combining marks such as U+093E.
+fn is_tag_char(c: char) -> bool {
+ matches!(c, '_' | '.' | ':' | '/' | '=' | '+' | '-' | '@')
+ || matches!(
+ get_general_category(c),
+ GeneralCategory::UppercaseLetter
+ | GeneralCategory::LowercaseLetter
+ | GeneralCategory::TitlecaseLetter
+ | GeneralCategory::ModifierLetter
+ | GeneralCategory::OtherLetter
+ | GeneralCategory::DecimalNumber
+ | GeneralCategory::LetterNumber
+ | GeneralCategory::OtherNumber
+ | GeneralCategory::SpaceSeparator
+ | GeneralCategory::LineSeparator
+ | GeneralCategory::ParagraphSeparator
+ )
+}
+
+/// Validate one tag key.
+///
+/// An empty key, a key longer than 128 UTF-16 code units and a key holding a
+/// character outside the tag grammar are all reported as an invalid key. The
+/// length and character rules are applied before the reserved-prefix rule, so
+/// `aws:k!` reports the invalid key rather than the prefix (measured).
+///
+/// # Errors
+///
+/// Returns `ValidationException`.
+fn validate_tag_key(key: &str) -> Result<(), DynamoDbError> {
+ if key.is_empty()
+ || key.encode_utf16().count() > MAX_TAG_KEY_UNITS
+ || !key.chars().all(is_tag_char)
+ {
+ return Err(DynamoDbError::ValidationException(format!(
+ "The Tag Key provided is invalid, Key: {key}"
+ )));
+ }
+ // `get` keeps a character that spans byte 4 from splitting: it yields None
+ // when 4 is not a character boundary.
+ if key
+ .get(..4)
+ .is_some_and(|prefix| prefix.eq_ignore_ascii_case("aws:"))
+ {
+ return Err(DynamoDbError::ValidationException(format!(
+ "Tag Key cannot be prefixed with aws:, Key: {key}"
+ )));
+ }
+ Ok(())
+}
+
+/// Validate one tag value. An empty value is accepted (measured).
+///
+/// # Errors
+///
+/// Returns `ValidationException`.
+fn validate_tag_value(value: &str) -> Result<(), DynamoDbError> {
+ if value.encode_utf16().count() > MAX_TAG_VALUE_UNITS || !value.chars().all(is_tag_char) {
+ return Err(DynamoDbError::ValidationException(format!(
+ "The Tag Value provided is invalid, Value: {value}"
+ )));
+ }
+ Ok(())
+}
+
+/// Validate the tags of a `TagResource` or `CreateTable` request. Tags are
+/// checked in request order, and the key of a tag before its value (measured).
+///
+/// # Errors
+///
+/// Returns `ValidationException` for the first key or value that is invalid.
+pub fn validate_tags(tags: &[Tag]) -> Result<(), DynamoDbError> {
+ for tag in tags {
+ validate_tag_key(&tag.key)?;
+ validate_tag_value(&tag.value)?;
+ }
+ Ok(())
+}
+
+/// Refuse a tag key that starts with `aws:` once U+017F (`ſ`) is read as `s`,
+/// such as `awſ:foo`, which `validate_tag_key` accepts. The service refuses
+/// it on `TagResource` and `CreateTable` with this message, in a later check
+/// than [`validate_tags`]: on `TagResource` an absent table and a key outside
+/// the grammar later in the request are reported first. `UntagResource`
+/// accepts such a key (all measured 2026-11-20).
+///
+/// # Errors
+///
+/// Returns `ValidationException`.
+pub fn validate_folded_tag_prefix(tags: &[Tag]) -> Result<(), DynamoDbError> {
+ let folds_to_prefix = |key: &str| {
+ let mut folded = key.chars().map(|c| {
+ if c == '\u{17f}' {
+ 's'
+ } else {
+ c.to_ascii_lowercase()
+ }
+ });
+ "aws:".chars().all(|want| folded.next() == Some(want))
+ };
+ if tags.iter().any(|tag| folds_to_prefix(&tag.key)) {
+ return Err(DynamoDbError::ValidationException(
+ "One or more parameter values were invalid".to_owned(),
+ ));
+ }
+ Ok(())
+}
+
+/// Validate the `Tags` member of a raw `TagResource` or `CreateTable` request
+/// body. A member that does not parse as a tag list is left to the request's
+/// deserialization, which reports it.
+///
+/// # Errors
+///
+/// Returns `ValidationException` for the first key or value that is invalid.
+pub fn validate_tags_member(input: &serde_json::Value) -> Result<(), DynamoDbError> {
+ use serde::Deserialize;
+ match input.get("Tags").map(Vec::::deserialize) {
+ Some(Ok(tags)) => validate_tags(&tags),
+ _ => Ok(()),
+ }
+}
+
+/// Validate the tag keys of an `UntagResource` request. The service applies the
+/// same key rules there as on `TagResource` (measured).
+///
+/// # Errors
+///
+/// Returns `ValidationException` for the first key that is invalid.
+pub fn validate_tag_keys(keys: &[String]) -> Result<(), DynamoDbError> {
+ for key in keys {
+ validate_tag_key(key)?;
+ }
+ Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+ use super::{
+ validate_folded_tag_prefix, validate_tag_key, validate_tag_keys, validate_tag_value,
+ validate_tags, validate_tags_member,
+ };
+ use crate::error::DynamoDbError;
+ use crate::types::Tag;
+
+ fn message(err: DynamoDbError) -> String {
+ match err {
+ DynamoDbError::ValidationException(m) => m,
+ other => panic!("expected ValidationException, got {other:?}"),
+ }
+ }
+
+ fn tag(key: &str, value: &str) -> Tag {
+ Tag {
+ key: key.to_owned(),
+ value: value.to_owned(),
+ }
+ }
+
+ #[test]
+ fn accepts_the_characters_the_service_accepts() {
+ for key in [
+ "env",
+ "Abc123 _.:/=+-@",
+ "k\u{e9}y",
+ "k\u{df}y",
+ "k\u{4e2d}y",
+ "k\u{434}y",
+ "k\u{1c5}y",
+ "k\u{2b0}y",
+ "k\u{a0}y",
+ "k\u{2028}y",
+ "k\u{2029}y",
+ "k\u{663}y",
+ "k\u{2167}y",
+ "k\u{b2}y",
+ " lead",
+ "trail ",
+ " ",
+ "aws",
+ "xaws:foo",
+ "k\u{8be}y",
+ "k\u{10e80}y",
+ "k\u{30000}y",
+ &"k".repeat(128),
+ &"\u{e9}".repeat(128),
+ &"\u{20000}".repeat(64),
+ &format!("{}\u{20000}", "a".repeat(126)),
+ ] {
+ assert!(validate_tag_key(key).is_ok(), "key {key:?}");
+ }
+ for value in [
+ "",
+ "Abc123 _.:/=+-@",
+ "v\u{e9}x",
+ "v\u{1c5}x",
+ "v\u{2b0}x",
+ "v\u{b2}x",
+ "v\u{2029}x",
+ "aws:foo",
+ &"v".repeat(256),
+ &"\u{e9}".repeat(256),
+ &"\u{20000}".repeat(128),
+ ] {
+ assert!(validate_tag_value(value).is_ok(), "value {value:?}");
+ }
+ }
+
+ #[test]
+ fn rejects_the_characters_the_service_rejects() {
+ for bad in [
+ '!',
+ '#',
+ '$',
+ '%',
+ '&',
+ '*',
+ '(',
+ ',',
+ ';',
+ '<',
+ '\'',
+ '"',
+ '\\',
+ '`',
+ '~',
+ '^',
+ '|',
+ '{',
+ '[',
+ '?',
+ '\t',
+ '\n',
+ '\u{1f600}',
+ '\u{301}',
+ '\u{93e}',
+ '\u{200b}',
+ // Letters and digits assigned after Unicode 13.0.
+ '\u{870}',
+ '\u{16ac0}',
+ '\u{1e290}',
+ '\u{31350}',
+ '\u{2ebf0}',
+ '\u{1c89}',
+ '\u{323b0}',
+ ] {
+ let key = format!("k{bad}y");
+ assert_eq!(
+ message(validate_tag_key(&key).unwrap_err()),
+ format!("The Tag Key provided is invalid, Key: {key}"),
+ "key {key:?}"
+ );
+ let value = format!("v{bad}x");
+ assert_eq!(
+ message(validate_tag_value(&value).unwrap_err()),
+ format!("The Tag Value provided is invalid, Value: {value}"),
+ "value {value:?}"
+ );
+ }
+ }
+
+ #[test]
+ fn rejects_an_empty_key_and_an_over_length_key_or_value() {
+ assert_eq!(
+ message(validate_tag_key("").unwrap_err()),
+ "The Tag Key provided is invalid, Key: "
+ );
+ // The limits count UTF-16 code units: U+20000 is two of them, `é` one.
+ for long_key in [
+ "k".repeat(129),
+ "\u{e9}".repeat(129),
+ "\u{20000}".repeat(65),
+ format!("{}\u{20000}", "a".repeat(127)),
+ ] {
+ assert_eq!(
+ message(validate_tag_key(&long_key).unwrap_err()),
+ format!("The Tag Key provided is invalid, Key: {long_key}")
+ );
+ }
+ for long_value in [
+ "v".repeat(257),
+ "\u{e9}".repeat(257),
+ "\u{20000}".repeat(129),
+ ] {
+ assert_eq!(
+ message(validate_tag_value(&long_value).unwrap_err()),
+ format!("The Tag Value provided is invalid, Value: {long_value}")
+ );
+ }
+ }
+
+ #[test]
+ fn rejects_the_reserved_prefix_in_any_case() {
+ for key in ["aws:foo", "AWS:foo", "Aws:foo", "aws:"] {
+ assert_eq!(
+ message(validate_tag_key(key).unwrap_err()),
+ format!("Tag Key cannot be prefixed with aws:, Key: {key}"),
+ "key {key:?}"
+ );
+ }
+ }
+
+ #[test]
+ fn checks_characters_before_the_reserved_prefix() {
+ assert_eq!(
+ message(validate_tag_key("aws:k!").unwrap_err()),
+ "The Tag Key provided is invalid, Key: aws:k!"
+ );
+ let long = format!("aws:{}", "k".repeat(130));
+ assert_eq!(
+ message(validate_tag_key(&long).unwrap_err()),
+ format!("The Tag Key provided is invalid, Key: {long}")
+ );
+ }
+
+ #[test]
+ fn a_character_that_spans_byte_4_does_not_split_the_prefix_check() {
+ // In the last three keys byte 4 falls inside a character, so slicing
+ // the key at byte 4 would panic.
+ for key in [
+ "\u{4e2d}aws:",
+ "\u{e9}aw",
+ "ab\u{4e2d}",
+ "\u{e9}\u{4e2d}",
+ "abc\u{e9}",
+ ] {
+ assert!(validate_tag_key(key).is_ok(), "key {key:?}");
+ }
+ }
+
+ #[test]
+ fn a_long_s_in_the_reserved_prefix_is_refused_by_the_later_check() {
+ for key in ["aw\u{17f}:foo", "AW\u{17f}:foo", "Aw\u{17f}:"] {
+ assert!(validate_tag_key(key).is_ok(), "key {key:?}");
+ assert_eq!(
+ message(validate_folded_tag_prefix(&[tag("ok", "v"), tag(key, "v")]).unwrap_err()),
+ "One or more parameter values were invalid",
+ "key {key:?}"
+ );
+ }
+ for key in [
+ "aw\u{17f}",
+ "aw\u{17f}x:",
+ "xaw\u{17f}:",
+ "a\u{17f}w:",
+ "ok",
+ ] {
+ assert!(
+ validate_folded_tag_prefix(&[tag(key, "aw\u{17f}:foo")]).is_ok(),
+ "key {key:?}"
+ );
+ }
+ }
+
+ #[test]
+ fn checks_the_key_before_the_value_and_tags_in_order() {
+ assert_eq!(
+ message(validate_tags(&[tag("k!", "v!")]).unwrap_err()),
+ "The Tag Key provided is invalid, Key: k!"
+ );
+ assert_eq!(
+ message(validate_tags(&[tag("ok1", "v!"), tag("k!", "ok2")]).unwrap_err()),
+ "The Tag Value provided is invalid, Value: v!"
+ );
+ assert_eq!(
+ message(validate_tags(&[tag("zk!", "v"), tag("ak#", "v")]).unwrap_err()),
+ "The Tag Key provided is invalid, Key: zk!"
+ );
+ }
+
+ #[test]
+ fn untag_keys_follow_the_same_key_rules() {
+ assert!(validate_tag_keys(&["env".to_owned(), "team".to_owned()]).is_ok());
+ assert_eq!(
+ message(validate_tag_keys(&["ok".to_owned(), "k!".to_owned()]).unwrap_err()),
+ "The Tag Key provided is invalid, Key: k!"
+ );
+ assert_eq!(
+ message(validate_tag_keys(&["aws:foo".to_owned()]).unwrap_err()),
+ "Tag Key cannot be prefixed with aws:, Key: aws:foo"
+ );
+ }
+
+ #[test]
+ fn an_empty_tag_list_passes() {
+ // The service refuses an empty Tags list with its own message; that
+ // check is not part of this validator.
+ assert!(validate_tags(&[]).is_ok());
+ assert!(validate_tag_keys(&[]).is_ok());
+ }
+
+ #[test]
+ fn the_tags_member_is_checked_only_when_it_parses_as_a_tag_list() {
+ let bad = serde_json::json!({"Tags": [{"Key": "k!", "Value": "v"}]});
+ assert_eq!(
+ message(validate_tags_member(&bad).expect_err("k!")),
+ "The Tag Key provided is invalid, Key: k!"
+ );
+ let good = serde_json::json!({"Tags": [{"Key": "k", "Value": "v"}]});
+ assert!(validate_tags_member(&good).is_ok());
+ // A member that is not a tag list is left to the request's deserialization.
+ assert!(validate_tags_member(&serde_json::json!({"Tags": "x"})).is_ok());
+ assert!(validate_tags_member(&serde_json::json!({})).is_ok());
+ }
+}
diff --git a/crates/engine/src/create_table.rs b/crates/engine/src/create_table.rs
index ff81d2a02..63d08e729 100755
--- a/crates/engine/src/create_table.rs
+++ b/crates/engine/src/create_table.rs
@@ -1,18 +1,70 @@
// Copyright 2026 ExtendDB contributors
// SPDX-License-Identifier: Apache-2.0
+use serde::Deserialize;
use serde_json::Value;
use extenddb_core::error::{DynamoDbError, ErrorMessageKey, error_message};
use extenddb_core::types::{CreateTableInput, CreateTableOutput};
-use extenddb_core::validation::validate_create_table;
+use extenddb_core::validation::{
+ validate_create_table_constraints, validate_create_table_definition,
+ validate_folded_tag_prefix, validate_table_name, validate_tags_member,
+};
use crate::OperationContext;
use crate::serialize_output;
+/// The error for a `CreateTable` body that does not deserialize. A missing
+/// `TableName` has the service's own sentence; every other failure takes the
+/// shared mapping.
+fn input_error(e: serde_json::Error) -> DynamoDbError {
+ let msg = e.to_string();
+ if msg.contains("missing field") && msg.contains("TableName") {
+ return DynamoDbError::ValidationException(
+ "The parameter 'TableName' is required but was not present in the request".to_owned(),
+ );
+ }
+ crate::deserialize_error(e)
+}
+
+/// Whether a deserialization message reports a member of the wrong JSON type,
+/// serde's `invalid type: , expected `. A null member is left
+/// out: the service reads it as a missing member, not as the wrong type, and
+/// a missing member, an enum value outside its set and a number out of range
+/// are reported after the checks that follow.
+fn is_type_fault(msg: &str) -> bool {
+ msg.contains("invalid type: ") && !msg.contains("invalid type: null")
+}
+
pub async fn handle_create_table(
body: Value,
ctx: &OperationContext,
) -> Result {
+ // The service checks a member of the wrong JSON type before everything
+ // else (measured 2026-11-23: TableName `ab` with a Tags string, and an
+ // invalid tag with a KeySchema string, both get SerializationException).
+ // Then a TableName of bad length or outside the pattern, then a missing
+ // TableName, then the Tags, then the rest of the request: an invalid tag
+ // beside a definition error (an undefined key attribute, an enum value
+ // outside its set, PROVISIONED without throughput, a missing KeySchema) is
+ // refused for the tag (measured 2026-11-20). So the body is deserialized
+ // here and a type fault returned at once, while every other failure waits
+ // behind the checks below, where the deserialization ran before. A missing
+ // TableName beside an enum value outside its set still gets the enum error
+ // (#1109). CreateTable stores its Tags through the same rows TagResource
+ // writes, so the same grammar applies. Restore and import build their own
+ // CreateTableInput further in and do not pass through this handler.
+ let parsed = match CreateTableInput::deserialize(&body).map_err(input_error) {
+ Err(DynamoDbError::SerializationException(msg)) if is_type_fault(&msg) => {
+ return Err(DynamoDbError::SerializationException(msg));
+ }
+ parsed => parsed,
+ };
+
+ if let Some(name) = body.get("TableName").and_then(Value::as_str) {
+ validate_table_name(name, &ctx.limits)?;
+ validate_tags_member(&body)?;
+ }
+
crate::validate_enum_fields(
&body,
&[
@@ -30,28 +82,20 @@ pub async fn handle_create_table(
)?;
crate::require_stream_enabled_member(&body)?;
- let mut input: CreateTableInput = serde_json::from_value(body).map_err(|e| {
- let msg = e.to_string();
- if msg.contains("validation error detected")
- || msg.contains("parameter values were invalid")
- || msg.contains("must not be empty")
- || msg.contains("Syntax error; key")
- {
- DynamoDbError::ValidationException(msg)
- } else if msg.contains("missing field") && msg.contains("TableName") {
- DynamoDbError::ValidationException(
- "The parameter 'TableName' is required but was not present in the request"
- .to_owned(),
- )
- } else {
- DynamoDbError::SerializationException(format!(
- "Start of structure or map found where not expected: {e}"
- ))
- }
- })?;
+ let mut input = parsed?;
input.resolve_table_throughput_mode();
- validate_create_table(&input, &ctx.limits)?;
+ // A key that starts with `aws:` once U+017F is read as `s` is refused
+ // between the two groups of `validate_create_table`, which runs here
+ // without its TableName check, made above. The service reports the enum
+ // and missing-member errors, the index names, the table's throughput
+ // against its billing mode and a provisioned GSI's throughput minimum
+ // before it. It reports the key schema, attribute definition and stream
+ // errors and a GSI's throughput on an on-demand table after it (measured
+ // 2026-11-20 and 2026-11-24).
+ validate_create_table_constraints(&input)?;
+ validate_folded_tag_prefix(input.tags.as_deref().unwrap_or_default())?;
+ validate_create_table_definition(&input, &ctx.limits)?;
// An empty SearchSchema means the same as an absent one, so it is collapsed
// here, once, rather than in each backend. Storing the empty list would make
@@ -257,6 +301,70 @@ pub(crate) fn storage_err_to_dynamo_with_ccf(
}
}
+#[cfg(test)]
+mod input_error_tests {
+ use serde::Deserialize;
+ use serde_json::{Value, json};
+
+ use extenddb_core::error::DynamoDbError;
+ use extenddb_core::types::CreateTableInput;
+
+ use super::{input_error, is_type_fault};
+
+ fn error_of(body: &Value) -> DynamoDbError {
+ input_error(CreateTableInput::deserialize(body).expect_err("the body must not parse"))
+ }
+
+ fn with(member: &str, value: Value) -> Value {
+ let mut body = json!({
+ "TableName": "t",
+ "KeySchema": [{"AttributeName": "pk", "KeyType": "HASH"}],
+ "AttributeDefinitions": [{"AttributeName": "pk", "AttributeType": "S"}],
+ });
+ body[member] = value;
+ body
+ }
+
+ /// A member of the wrong JSON type, at the top level or nested, is the one
+ /// failure reported before the TableName and Tags checks. A null member, a
+ /// missing member and an enum value outside its set wait behind them.
+ #[test]
+ fn only_a_member_of_the_wrong_type_is_a_type_fault() {
+ for (body, fault) in [
+ (with("Tags", json!("x")), true),
+ (with("KeySchema", json!("x")), true),
+ (
+ with(
+ "KeySchema",
+ json!([{"AttributeName": 5, "KeyType": "HASH"}]),
+ ),
+ true,
+ ),
+ (with("KeySchema", Value::Null), false),
+ (with("BillingMode", json!("FOO")), false),
+ (json!({"TableName": "t", "AttributeDefinitions": []}), false),
+ ] {
+ match error_of(&body) {
+ DynamoDbError::SerializationException(msg) => {
+ assert_eq!(is_type_fault(&msg), fault, "{body}: {msg}");
+ }
+ other => panic!("{body}: {other:?}"),
+ }
+ }
+ }
+
+ #[test]
+ fn a_missing_table_name_has_the_service_sentence() {
+ match error_of(&json!({"KeySchema": [], "AttributeDefinitions": []})) {
+ DynamoDbError::ValidationException(msg) => assert_eq!(
+ msg,
+ "The parameter 'TableName' is required but was not present in the request"
+ ),
+ other => panic!("{other:?}"),
+ }
+ }
+}
+
#[cfg(test)]
mod storage_error_mapping_tests {
use extenddb_core::error::DynamoDbError;
diff --git a/crates/engine/src/tagging.rs b/crates/engine/src/tagging.rs
index dfc456b18..916e2064b 100755
--- a/crates/engine/src/tagging.rs
+++ b/crates/engine/src/tagging.rs
@@ -7,6 +7,7 @@ use extenddb_core::error::DynamoDbError;
use extenddb_core::types::{
ListTagsOfResourceInput, ListTagsOfResourceOutput, TagResourceInput, UntagResourceInput,
};
+use extenddb_core::validation::{validate_folded_tag_prefix, validate_tag_keys, validate_tags};
use serde_json::Value;
use crate::OperationContext;
@@ -71,16 +72,13 @@ fn deployment_scope_error(
)))
}
-/// Extract the table name from a `DynamoDB` table ARN, using the one shared
-/// resource parser ([`extenddb_core::arn::fields`]) so this layer splits an ARN
-/// the same way authorization and the engine stream resolver do.
-///
-/// Expected format: `arn:aws:dynamodb:{region}:{account}:table/{name}[/...]`
-fn extract_table_name_from_arn(arn: &str) -> Option<&str> {
- let resource = extenddb_core::arn::fields(arn)?.resource;
- let table_name = resource.strip_prefix("table/")?;
- // Strip any sub-resource (e.g. /index/foo, /stream/label).
- Some(table_name.split('/').next().unwrap_or(table_name))
+/// The table name of a `table/[//]` resource, the shape
+/// [`validate_arn_shape_and_account`] leaves. The fields come from the one
+/// shared resource parser ([`extenddb_core::arn::fields`]), so this layer
+/// splits an ARN the same way authorization and the engine stream resolver do.
+fn table_name_of(resource: &str) -> &str {
+ let tail = resource.strip_prefix("table/").unwrap_or(resource);
+ tail.split('/').next().unwrap_or(tail)
}
/// Validate that the ARN refers to an existing table owned by the caller.
@@ -105,7 +103,27 @@ fn extract_table_name_from_arn(arn: &str) -> Option<&str> {
/// fields are valid. For a table ARN, a no-permissions principal is denied by
/// authorization before this runs; the partition, service, region, and
/// existence errors therefore surface only for an authorized principal.
+///
+/// The two halves are called separately by the tag-writing handlers, because
+/// tag keys and values are checked between them: a request carrying an invalid
+/// tag key is refused for the tag on a cross-region table ARN and on an ARN
+/// naming no existing table, and denied on a cross-account ARN (measured). A
+/// stream ARN with another partition, service or region is refused in the
+/// first half, before the tags (measured 2026-11-20).
async fn validate_resource_arn(arn: &str, ctx: &OperationContext) -> Result<(), DynamoDbError> {
+ let fields = validate_arn_shape_and_account(arn, &ctx.account_id, &ctx.region)?;
+ validate_arn_region_and_table(fields, arn, ctx).await
+}
+
+/// First half of [`validate_resource_arn`]: the ARN prefix, its resource kind,
+/// the account, and the deployment scope of a stream ARN. Returns the parsed
+/// fields, whose resource is `table/` or `table//stream/