1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
%global _empty_manifest_terminate_build 0
Name: python-quart-cors
Version: 0.6.0
Release: 1
Summary: A Quart extension to provide Cross Origin Resource Sharing, access control, support
License: MIT
URL: https://github.com/pgjones/quart-cors/
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/06/bd/7e413c380484264f04ea390de82f5d78871010b445c2b08567682b9ce076/quart_cors-0.6.0.tar.gz
BuildArch: noarch
Requires: python3-quart
Requires: python3-typing_extensions
%description
|Build Status| |pypi| |python| |license|
Quart-CORS is an extension for `Quart
<https://github.com/pgjones/quart>`_ to enable and control `Cross
Origin Resource Sharing <http://www.w3.org/TR/cors/>`_, CORS (also
known as access control).
CORS is required to share resources in browsers due to the `Same
Origin Policy <https://en.wikipedia.org/wiki/Same-origin_policy>`_
which prevents resources being used from a different origin. An origin
in this case is defined as the scheme, host and port combined and a
resource corresponds to a path.
In practice the Same Origin Policy means that a browser visiting
``http://quart.com`` will prevent the response of ``GET
http://api.com`` being read. It will also prevent requests such as
``POST http://api.com``. Note that CORS applies to browser initiated
requests, non-browser clients such as ``requests`` are not subject to
CORS restrictions.
CORS allows a server to indicate to a browser that certain resources
can be used, contrary to the Same Origin Policy. It does so via
access-control headers that inform the browser how the resource can be
used. For GET requests these headers are sent in the response. For
non-GET requests the browser must ask the server for the
access-control headers before sending the actual request, it does so
via a preflight OPTIONS request.
The Same Origin Policy does not apply to WebSockets, and hence there
is no need for CORS. Instead the server alone is responsible for
deciding if the WebSocket is allowed and it should do so by inspecting
the WebSocket-request origin header.
Simple (GET) requests should return CORS headers specifying the
origins that are allowed to use the resource (response). This can be
any origin, ``*`` (wildcard), or a list of specific origins. The
response should also include a CORS header specifying whether
response-credentials e.g. cookies can be used. Note that if credential
sharing is allowed the allowed origins must be specific and not a
wildcard.
Preflight requests should return CORS headers specifying the origins
allowed to use the resource, the methods and headers allowed to be
sent in a request to the resource, whether response credentials can be
used, and finally which response headers can be used.
Note that certain actions are allowed in the Same Origin Policy such
as embedding e.g. ``<img src="http://api.com/img.gif">`` and simple
POSTs. For the purposes of this readme though these complications are
ignored.
%package -n python3-quart-cors
Summary: A Quart extension to provide Cross Origin Resource Sharing, access control, support
Provides: python-quart-cors
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-quart-cors
|Build Status| |pypi| |python| |license|
Quart-CORS is an extension for `Quart
<https://github.com/pgjones/quart>`_ to enable and control `Cross
Origin Resource Sharing <http://www.w3.org/TR/cors/>`_, CORS (also
known as access control).
CORS is required to share resources in browsers due to the `Same
Origin Policy <https://en.wikipedia.org/wiki/Same-origin_policy>`_
which prevents resources being used from a different origin. An origin
in this case is defined as the scheme, host and port combined and a
resource corresponds to a path.
In practice the Same Origin Policy means that a browser visiting
``http://quart.com`` will prevent the response of ``GET
http://api.com`` being read. It will also prevent requests such as
``POST http://api.com``. Note that CORS applies to browser initiated
requests, non-browser clients such as ``requests`` are not subject to
CORS restrictions.
CORS allows a server to indicate to a browser that certain resources
can be used, contrary to the Same Origin Policy. It does so via
access-control headers that inform the browser how the resource can be
used. For GET requests these headers are sent in the response. For
non-GET requests the browser must ask the server for the
access-control headers before sending the actual request, it does so
via a preflight OPTIONS request.
The Same Origin Policy does not apply to WebSockets, and hence there
is no need for CORS. Instead the server alone is responsible for
deciding if the WebSocket is allowed and it should do so by inspecting
the WebSocket-request origin header.
Simple (GET) requests should return CORS headers specifying the
origins that are allowed to use the resource (response). This can be
any origin, ``*`` (wildcard), or a list of specific origins. The
response should also include a CORS header specifying whether
response-credentials e.g. cookies can be used. Note that if credential
sharing is allowed the allowed origins must be specific and not a
wildcard.
Preflight requests should return CORS headers specifying the origins
allowed to use the resource, the methods and headers allowed to be
sent in a request to the resource, whether response credentials can be
used, and finally which response headers can be used.
Note that certain actions are allowed in the Same Origin Policy such
as embedding e.g. ``<img src="http://api.com/img.gif">`` and simple
POSTs. For the purposes of this readme though these complications are
ignored.
%package help
Summary: Development documents and examples for quart-cors
Provides: python3-quart-cors-doc
%description help
|Build Status| |pypi| |python| |license|
Quart-CORS is an extension for `Quart
<https://github.com/pgjones/quart>`_ to enable and control `Cross
Origin Resource Sharing <http://www.w3.org/TR/cors/>`_, CORS (also
known as access control).
CORS is required to share resources in browsers due to the `Same
Origin Policy <https://en.wikipedia.org/wiki/Same-origin_policy>`_
which prevents resources being used from a different origin. An origin
in this case is defined as the scheme, host and port combined and a
resource corresponds to a path.
In practice the Same Origin Policy means that a browser visiting
``http://quart.com`` will prevent the response of ``GET
http://api.com`` being read. It will also prevent requests such as
``POST http://api.com``. Note that CORS applies to browser initiated
requests, non-browser clients such as ``requests`` are not subject to
CORS restrictions.
CORS allows a server to indicate to a browser that certain resources
can be used, contrary to the Same Origin Policy. It does so via
access-control headers that inform the browser how the resource can be
used. For GET requests these headers are sent in the response. For
non-GET requests the browser must ask the server for the
access-control headers before sending the actual request, it does so
via a preflight OPTIONS request.
The Same Origin Policy does not apply to WebSockets, and hence there
is no need for CORS. Instead the server alone is responsible for
deciding if the WebSocket is allowed and it should do so by inspecting
the WebSocket-request origin header.
Simple (GET) requests should return CORS headers specifying the
origins that are allowed to use the resource (response). This can be
any origin, ``*`` (wildcard), or a list of specific origins. The
response should also include a CORS header specifying whether
response-credentials e.g. cookies can be used. Note that if credential
sharing is allowed the allowed origins must be specific and not a
wildcard.
Preflight requests should return CORS headers specifying the origins
allowed to use the resource, the methods and headers allowed to be
sent in a request to the resource, whether response credentials can be
used, and finally which response headers can be used.
Note that certain actions are allowed in the Same Origin Policy such
as embedding e.g. ``<img src="http://api.com/img.gif">`` and simple
POSTs. For the purposes of this readme though these complications are
ignored.
%prep
%autosetup -n quart-cors-0.6.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-quart-cors -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri Apr 21 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6.0-1
- Package Spec generated
|