diff --git a/httpbin/static/swagger-ui/README b/httpbin/static/swagger-ui/README new file mode 100644 index 00000000..1c480f4a --- /dev/null +++ b/httpbin/static/swagger-ui/README @@ -0,0 +1,19 @@ +Swagger UI 5.34.1, vendored from the swagger-ui-dist npm package. + + Tarball: https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.34.1.tgz + Integrity: sha512-VSr8fXfI93obYaQicLJbLUKGRxDojj/SfRJDDLCioGTUBj4BK/Nj4eE9jCeCAnJxVLi7iS+08PbiZLyrQKBkJQ== + +The files here are copied unchanged from the tarball's package/ directory: +swagger-ui-bundle.js, swagger-ui-standalone-preset.js, swagger-ui.css, +their *.LICENSE.txt notices, LICENSE and NOTICE. + +Licences: Swagger UI is Apache-2.0 (LICENSE, NOTICE). The bundles also +contain third-party code under MIT, BSD-3-Clause (ieee754) and +Apache-2.0 OR MPL-2.0 (DOMPurify), listed in the *.LICENSE.txt files. +These are minified builds; the sources are in the swagger-ui repository +(https://github.com/swagger-api/swagger-ui) at tag v5.34.1. + +To update: download the new tarball, check its integrity against the +registry (npm view swagger-ui-dist@ dist.integrity), copy the +same files over these ones, and update this README and the version in +httpbin/core.py. diff --git a/httpbin/static/swagger-ui/swagger-ui-bundle.js.LICENSE.txt b/httpbin/static/swagger-ui/swagger-ui-bundle.js.LICENSE.txt new file mode 100644 index 00000000..af846f2f --- /dev/null +++ b/httpbin/static/swagger-ui/swagger-ui-bundle.js.LICENSE.txt @@ -0,0 +1,131 @@ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ + +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * 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. + */ + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2021 Joachim Wester + * MIT license + */ + +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2022 Joachim Wester + * MIT licensed + */ + +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ + +/** + * @license + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * 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. + */ + +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * @license React + * use-sync-external-store-with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/httpbin/static/swagger-ui/swagger-ui-standalone-preset.js.LICENSE.txt b/httpbin/static/swagger-ui/swagger-ui-standalone-preset.js.LICENSE.txt new file mode 100644 index 00000000..840d0d29 --- /dev/null +++ b/httpbin/static/swagger-ui/swagger-ui-standalone-preset.js.LICENSE.txt @@ -0,0 +1,45 @@ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ + +/** + * @license + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * 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. + */ + +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/pyproject.toml b/pyproject.toml index 36849817..e32f0361 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,8 +7,15 @@ name = "httpbin" dynamic = ["version"] description = "HTTP Request and Response Service" requires-python = ">=3.11" -license = "MIT" -license-files = ["LICENSE"] +# httpbin is ISC (see LICENSE). The vendored Swagger UI is Apache-2.0, and its +# bundles include code under MIT, BSD-3-Clause and Apache-2.0 OR MPL-2.0. +license = "ISC AND Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 OR MPL-2.0)" +license-files = [ + "LICENSE", + "httpbin/static/swagger-ui/LICENSE", + "httpbin/static/swagger-ui/NOTICE", + "httpbin/static/swagger-ui/*.LICENSE.txt", +] authors = [{ name = "Kenneth Reitz", email = "me@kennethreitz.org" }] classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/test_httpbin.py b/test_httpbin.py index b8929655..2efc6d96 100755 --- a/test_httpbin.py +++ b/test_httpbin.py @@ -1245,6 +1245,16 @@ def test_swagger_ui_is_the_vendored_copy(self): response = self.app.get('/flasgger_static/lib/jquery.min.js') self.assertEqual(response.status_code, 404) + @local_only("checks this checkout's vendored files") + def test_swagger_ui_licence_notices_are_vendored(self): + static_dir = os.path.join('httpbin', 'static', 'swagger-ui') + for bundle in ('swagger-ui-bundle.js', 'swagger-ui-standalone-preset.js'): + with open(os.path.join(static_dir, bundle)) as f: + first_line = f.readline() + notice = first_line.rsplit(' ', 2)[-2] + self.assertEqual(notice, bundle + '.LICENSE.txt') + self.assertTrue(os.path.exists(os.path.join(static_dir, notice)), notice) + def test_swagger_ui_ignores_query_config(self): response = self.app.get('/') self.assertIn(b'queryConfigEnabled: false', response.data)