Skip to content

Commit 4225696

Browse files
committed
chore: add gapple/structured-fields as dependency
The gapple/structured-fields package implements RFC 8941 (HTTP Structured Field Values) and RFC 9651. nextcloud/server's RFC 9421 HTTP Message Signatures verifier and signer use it to drop the hand-rolled Signature-Input / Signature dictionary parser, per review feedback on nextcloud/server#60136. License: MIT. Signed-off-by: Micke Nordin <kano@sunet.se>
1 parent 015e995 commit 4225696

25 files changed

Lines changed: 1551 additions & 1 deletion

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bin
3131
# ignore README and UPGRADE
3232
*/**/README.md
3333
*/**/README.rst
34+
*/**/readme.md
3435
*/**/UPGRADE.md
3536
*/**/UPGRADING.md
3637
*/**/UPGRADE-*.md

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"egulias/email-validator": "^4.0.4",
3030
"firebase/php-jwt": "^7.0",
3131
"fusonic/opengraph": "^3.0.0",
32+
"gapple/structured-fields": "^2.3",
3233
"giggsey/libphonenumber-for-php-lite": "^9.0.9",
3334
"guzzlehttp/guzzle": "^7.10.0",
3435
"icewind/searchdav": "^3.2.0",

composer.lock

Lines changed: 72 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/autoload_classmap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,22 @@
32283228
'cweagans\\Composer\\PatchEvent' => $vendorDir . '/cweagans/composer-patches/src/PatchEvent.php',
32293229
'cweagans\\Composer\\PatchEvents' => $vendorDir . '/cweagans/composer-patches/src/PatchEvents.php',
32303230
'cweagans\\Composer\\Patches' => $vendorDir . '/cweagans/composer-patches/src/Patches.php',
3231+
'gapple\\StructuredFields\\Bytes' => $vendorDir . '/gapple/structured-fields/src/Bytes.php',
3232+
'gapple\\StructuredFields\\Date' => $vendorDir . '/gapple/structured-fields/src/Date.php',
3233+
'gapple\\StructuredFields\\Dictionary' => $vendorDir . '/gapple/structured-fields/src/Dictionary.php',
3234+
'gapple\\StructuredFields\\DisplayString' => $vendorDir . '/gapple/structured-fields/src/DisplayString.php',
3235+
'gapple\\StructuredFields\\InnerList' => $vendorDir . '/gapple/structured-fields/src/InnerList.php',
3236+
'gapple\\StructuredFields\\Item' => $vendorDir . '/gapple/structured-fields/src/Item.php',
3237+
'gapple\\StructuredFields\\OuterList' => $vendorDir . '/gapple/structured-fields/src/OuterList.php',
3238+
'gapple\\StructuredFields\\Parameters' => $vendorDir . '/gapple/structured-fields/src/Parameters.php',
3239+
'gapple\\StructuredFields\\ParseException' => $vendorDir . '/gapple/structured-fields/src/ParseException.php',
3240+
'gapple\\StructuredFields\\Parser' => $vendorDir . '/gapple/structured-fields/src/Parser.php',
3241+
'gapple\\StructuredFields\\ParsingInput' => $vendorDir . '/gapple/structured-fields/src/ParsingInput.php',
3242+
'gapple\\StructuredFields\\SerializeException' => $vendorDir . '/gapple/structured-fields/src/SerializeException.php',
3243+
'gapple\\StructuredFields\\Serializer' => $vendorDir . '/gapple/structured-fields/src/Serializer.php',
3244+
'gapple\\StructuredFields\\Token' => $vendorDir . '/gapple/structured-fields/src/Token.php',
3245+
'gapple\\StructuredFields\\TupleInterface' => $vendorDir . '/gapple/structured-fields/src/TupleInterface.php',
3246+
'gapple\\StructuredFields\\TupleTrait' => $vendorDir . '/gapple/structured-fields/src/TupleTrait.php',
32313247
'kornrunner\\Blurhash\\AC' => $vendorDir . '/kornrunner/blurhash/src/AC.php',
32323248
'kornrunner\\Blurhash\\Base83' => $vendorDir . '/kornrunner/blurhash/src/Base83.php',
32333249
'kornrunner\\Blurhash\\Blurhash' => $vendorDir . '/kornrunner/blurhash/src/Blurhash.php',

composer/autoload_psr4.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
'ownCloud\\TarStreamer\\' => array($vendorDir . '/deepdiver1975/tarstreamer/src'),
1212
'libphonenumber\\' => array($vendorDir . '/giggsey/libphonenumber-for-php-lite/src'),
1313
'kornrunner\\Blurhash\\' => array($vendorDir . '/kornrunner/blurhash/src'),
14+
'gapple\\Tests\\StructuredFields\\' => array($vendorDir . '/gapple/structured-fields/tests'),
15+
'gapple\\StructuredFields\\' => array($vendorDir . '/gapple/structured-fields/src'),
1416
'cweagans\\Composer\\' => array($vendorDir . '/cweagans/composer-patches/src'),
1517
'bantu\\IniGetWrapper\\' => array($vendorDir . '/bantu/ini-get-wrapper/src'),
1618
'ZipStreamer\\' => array($vendorDir . '/deepdiver/zipstreamer/src'),

composer/autoload_static.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
5252
array (
5353
'kornrunner\\Blurhash\\' => 20,
5454
),
55+
'g' =>
56+
array (
57+
'gapple\\Tests\\StructuredFields\\' => 30,
58+
'gapple\\StructuredFields\\' => 24,
59+
),
5560
'c' =>
5661
array (
5762
'cweagans\\Composer\\' => 18,
@@ -211,6 +216,14 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
211216
array (
212217
0 => __DIR__ . '/..' . '/kornrunner/blurhash/src',
213218
),
219+
'gapple\\Tests\\StructuredFields\\' =>
220+
array (
221+
0 => __DIR__ . '/..' . '/gapple/structured-fields/tests',
222+
),
223+
'gapple\\StructuredFields\\' =>
224+
array (
225+
0 => __DIR__ . '/..' . '/gapple/structured-fields/src',
226+
),
214227
'cweagans\\Composer\\' =>
215228
array (
216229
0 => __DIR__ . '/..' . '/cweagans/composer-patches/src',
@@ -3765,6 +3778,22 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
37653778
'cweagans\\Composer\\PatchEvent' => __DIR__ . '/..' . '/cweagans/composer-patches/src/PatchEvent.php',
37663779
'cweagans\\Composer\\PatchEvents' => __DIR__ . '/..' . '/cweagans/composer-patches/src/PatchEvents.php',
37673780
'cweagans\\Composer\\Patches' => __DIR__ . '/..' . '/cweagans/composer-patches/src/Patches.php',
3781+
'gapple\\StructuredFields\\Bytes' => __DIR__ . '/..' . '/gapple/structured-fields/src/Bytes.php',
3782+
'gapple\\StructuredFields\\Date' => __DIR__ . '/..' . '/gapple/structured-fields/src/Date.php',
3783+
'gapple\\StructuredFields\\Dictionary' => __DIR__ . '/..' . '/gapple/structured-fields/src/Dictionary.php',
3784+
'gapple\\StructuredFields\\DisplayString' => __DIR__ . '/..' . '/gapple/structured-fields/src/DisplayString.php',
3785+
'gapple\\StructuredFields\\InnerList' => __DIR__ . '/..' . '/gapple/structured-fields/src/InnerList.php',
3786+
'gapple\\StructuredFields\\Item' => __DIR__ . '/..' . '/gapple/structured-fields/src/Item.php',
3787+
'gapple\\StructuredFields\\OuterList' => __DIR__ . '/..' . '/gapple/structured-fields/src/OuterList.php',
3788+
'gapple\\StructuredFields\\Parameters' => __DIR__ . '/..' . '/gapple/structured-fields/src/Parameters.php',
3789+
'gapple\\StructuredFields\\ParseException' => __DIR__ . '/..' . '/gapple/structured-fields/src/ParseException.php',
3790+
'gapple\\StructuredFields\\Parser' => __DIR__ . '/..' . '/gapple/structured-fields/src/Parser.php',
3791+
'gapple\\StructuredFields\\ParsingInput' => __DIR__ . '/..' . '/gapple/structured-fields/src/ParsingInput.php',
3792+
'gapple\\StructuredFields\\SerializeException' => __DIR__ . '/..' . '/gapple/structured-fields/src/SerializeException.php',
3793+
'gapple\\StructuredFields\\Serializer' => __DIR__ . '/..' . '/gapple/structured-fields/src/Serializer.php',
3794+
'gapple\\StructuredFields\\Token' => __DIR__ . '/..' . '/gapple/structured-fields/src/Token.php',
3795+
'gapple\\StructuredFields\\TupleInterface' => __DIR__ . '/..' . '/gapple/structured-fields/src/TupleInterface.php',
3796+
'gapple\\StructuredFields\\TupleTrait' => __DIR__ . '/..' . '/gapple/structured-fields/src/TupleTrait.php',
37683797
'kornrunner\\Blurhash\\AC' => __DIR__ . '/..' . '/kornrunner/blurhash/src/AC.php',
37693798
'kornrunner\\Blurhash\\Base83' => __DIR__ . '/..' . '/kornrunner/blurhash/src/Base83.php',
37703799
'kornrunner\\Blurhash\\Blurhash' => __DIR__ . '/..' . '/kornrunner/blurhash/src/Blurhash.php',

composer/installed.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,80 @@
992992
},
993993
"install-path": "../fusonic/opengraph"
994994
},
995+
{
996+
"name": "gapple/structured-fields",
997+
"version": "v2.3.2",
998+
"version_normalized": "2.3.2.0",
999+
"source": {
1000+
"type": "git",
1001+
"url": "https://github.com/gapple/structured-fields.git",
1002+
"reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f"
1003+
},
1004+
"dist": {
1005+
"type": "zip",
1006+
"url": "https://api.github.com/repos/gapple/structured-fields/zipball/f753bf49ffccc44a1287706c4fab973ddf6e2f5f",
1007+
"reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f",
1008+
"shasum": ""
1009+
},
1010+
"require": {
1011+
"php": "^8.1"
1012+
},
1013+
"require-dev": {
1014+
"httpwg/structured-field-tests": "*@dev",
1015+
"paragonie/constant_time_encoding": "^3.0.0",
1016+
"phpmd/phpmd": "^2.15",
1017+
"phpstan/phpstan": "^1.12",
1018+
"phpstan/phpstan-phpunit": "^1.4",
1019+
"phpunit/phpunit": "^10.5",
1020+
"slevomat/coding-standard": "^8.15",
1021+
"squizlabs/php_codesniffer": "^3.11"
1022+
},
1023+
"time": "2025-04-14T03:43:17+00:00",
1024+
"type": "library",
1025+
"extra": {
1026+
"branch-alias": {
1027+
"dev-develop": "2.x-dev"
1028+
}
1029+
},
1030+
"installation-source": "dist",
1031+
"autoload": {
1032+
"psr-4": {
1033+
"gapple\\StructuredFields\\": "src/",
1034+
"gapple\\Tests\\StructuredFields\\": "tests/"
1035+
}
1036+
},
1037+
"notification-url": "https://packagist.org/downloads/",
1038+
"license": [
1039+
"MIT",
1040+
"GPL-2.0-or-later"
1041+
],
1042+
"authors": [
1043+
{
1044+
"name": "Geoff Appleby"
1045+
}
1046+
],
1047+
"description": "Library for Structured Field Values for HTTP",
1048+
"keywords": [
1049+
"http",
1050+
"rfc8941",
1051+
"rfc9651"
1052+
],
1053+
"support": {
1054+
"issues": "https://github.com/gapple/structured-fields/issues",
1055+
"source": "https://github.com/gapple/structured-fields"
1056+
},
1057+
"funding": [
1058+
{
1059+
"url": "https://github.com/gapple",
1060+
"type": "github"
1061+
},
1062+
{
1063+
"url": "https://ko-fi.com/gapple",
1064+
"type": "ko_fi"
1065+
}
1066+
],
1067+
"install-path": "../gapple/structured-fields"
1068+
},
9951069
{
9961070
"name": "giggsey/libphonenumber-for-php-lite",
9971071
"version": "9.0.9",

composer/installed.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@
136136
'aliases' => array(),
137137
'dev_requirement' => false,
138138
),
139+
'gapple/structured-fields' => array(
140+
'pretty_version' => 'v2.3.2',
141+
'version' => '2.3.2.0',
142+
'reference' => 'f753bf49ffccc44a1287706c4fab973ddf6e2f5f',
143+
'type' => 'library',
144+
'install_path' => __DIR__ . '/../gapple/structured-fields',
145+
'aliases' => array(),
146+
'dev_requirement' => false,
147+
),
139148
'giggsey/libphonenumber-for-php-lite' => array(
140149
'pretty_version' => '9.0.9',
141150
'version' => '9.0.9.0',

gapple/structured-fields/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Geoff Appleby
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace gapple\StructuredFields;
6+
7+
class Bytes implements \Stringable
8+
{
9+
public function __construct(private readonly string $value)
10+
{
11+
}
12+
13+
public function __toString(): string
14+
{
15+
return $this->value;
16+
}
17+
}

0 commit comments

Comments
 (0)