nc-py-api 0.18.1__py3-none-any.whl → 0.18.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nc_py_api/_session.py CHANGED
@@ -12,6 +12,7 @@ from json import loads
12
12
  from os import environ
13
13
 
14
14
  from httpx import AsyncClient, Client, Headers, Limits, ReadTimeout, Request, Response
15
+ from httpx import __version__ as httpx_version
15
16
  from starlette.requests import HTTPConnection
16
17
 
17
18
  from . import options
@@ -511,6 +512,7 @@ class NcSessionApp(NcSessionAppBasic, NcSessionBasic):
511
512
  "AA-VERSION": self.cfg.aa_version,
512
513
  "EX-APP-ID": self.cfg.app_name,
513
514
  "EX-APP-VERSION": self.cfg.app_version,
515
+ "user-agent": f"ExApp/{self.cfg.app_name}/{self.cfg.app_version} (httpx/{httpx_version})",
514
516
  },
515
517
  )
516
518
 
@@ -535,6 +537,7 @@ class AsyncNcSessionApp(NcSessionAppBasic, AsyncNcSessionBasic):
535
537
  "AA-VERSION": self.cfg.aa_version,
536
538
  "EX-APP-ID": self.cfg.app_name,
537
539
  "EX-APP-VERSION": self.cfg.app_version,
540
+ "User-Agent": f"ExApp/{self.cfg.app_name}/{self.cfg.app_version} (httpx/{httpx_version})",
538
541
  },
539
542
  )
540
543
 
nc_py_api/_version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Version of nc_py_api."""
2
2
 
3
- __version__ = "0.18.1"
3
+ __version__ = "0.18.2"
nc_py_api/options.py CHANGED
@@ -33,11 +33,22 @@ NPA_NC_CERT: bool | str
33
33
  SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts. Either **True** (default CA bundle),
34
34
  a path to an SSL certificate file, or **False** (which will disable verification)."""
35
35
  str_val = environ.get("NPA_NC_CERT", "True")
36
- NPA_NC_CERT = True
36
+ # https://github.com/encode/httpx/issues/302
37
+ # when "httpx" will switch to use "truststore" by default - uncomment next line
38
+ # NPA_NC_CERT = True
37
39
  if str_val.lower() in ("false", "0"):
38
40
  NPA_NC_CERT = False
39
41
  elif str_val.lower() not in ("true", "1"):
40
42
  NPA_NC_CERT = str_val
43
+ else:
44
+ # Temporary workaround, see comment above.
45
+ # Use system certificate stores
46
+
47
+ import ssl
48
+
49
+ import truststore
50
+
51
+ NPA_NC_CERT = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
41
52
 
42
53
  CHUNKED_UPLOAD_V2 = environ.get("CHUNKED_UPLOAD_V2", True)
43
54
  """Option to enable/disable **version 2** chunked upload(better Object Storages support).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nc-py-api
3
- Version: 0.18.1
3
+ Version: 0.18.2
4
4
  Summary: Nextcloud Python Framework
5
5
  Project-URL: Changelog, https://github.com/cloud-py-api/nc_py_api/blob/main/CHANGELOG.md
6
6
  Project-URL: Documentation, https://cloud-py-api.github.io/nc_py_api/
@@ -34,6 +34,7 @@ Requires-Dist: fastapi>=0.109.2
34
34
  Requires-Dist: httpx>=0.25.2
35
35
  Requires-Dist: pydantic>=2.1.1
36
36
  Requires-Dist: python-dotenv>=1
37
+ Requires-Dist: truststore==0.10
37
38
  Requires-Dist: xmltodict>=0.13
38
39
  Provides-Extra: app
39
40
  Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'app'
@@ -4,10 +4,10 @@ nc_py_api/_exceptions.py,sha256=7vbUECaLmD7RJBCU27t4fuP6NmQK6r4508u_gS4szhI,2298
4
4
  nc_py_api/_misc.py,sha256=dUzCP9VmyhtICTsn1aexlFAYUioBm40k6Zh-YE5WwCY,3333
5
5
  nc_py_api/_preferences.py,sha256=OtovFZuGHnHYKjdDjSnUappO795tW8Oxj7qVaejHWpQ,2479
6
6
  nc_py_api/_preferences_ex.py,sha256=tThj6U0ZZMaBZ-jUkjrbaI0xDnafWsBowQKsC6gjOQs,7179
7
- nc_py_api/_session.py,sha256=ZD0TKrL-tOpxYtV6AO0cwRrYzbnjBr_ylCEUirrykjU,20242
7
+ nc_py_api/_session.py,sha256=h5S-Zd26tkq7-FxJ1mqJaa9YoNzVRIN2CkUBBNAAjJo,20503
8
8
  nc_py_api/_talk_api.py,sha256=0Uo7OduYniuuX3UQPb468RyGJJ-PWBCgJ5HoPuz5Qa0,51068
9
9
  nc_py_api/_theming.py,sha256=hTr3nuOemSuRFZaPy9iXNmBM7rDgQHECH43tHMWGqEY,1870
10
- nc_py_api/_version.py,sha256=vPHaIX0sBYHr1ilh-YTVqasI6cM7TDtyHmVDvps_3zY,52
10
+ nc_py_api/_version.py,sha256=hLV4fonCqbhDftVE3lJ1pszd3t3jAjpr4Lt4JQhlFUg,52
11
11
  nc_py_api/activity.py,sha256=t9VDSnnaXRNOvALqOSGCeXSQZ-426pCOMSfQ96JHys4,9574
12
12
  nc_py_api/apps.py,sha256=Us2y2lszdxXlD8t6kxwd5_Nrrmazc0EvZXIH9O-ol80,9315
13
13
  nc_py_api/calendar.py,sha256=-T6CJ8cRbJZTLtxSEDWuuYpD29DMJGCTfLONmtxZV9w,1445
@@ -15,7 +15,7 @@ nc_py_api/loginflow_v2.py,sha256=UjkK3gMouzNrIS7BFhjbmB_9m4fP2UY5sfpmvJ2EXWk,576
15
15
  nc_py_api/nextcloud.py,sha256=Uc4hOtLNkvl8sjKmAGS-vyKdiA1gEZwRr1wj0Sd_ONk,23005
16
16
  nc_py_api/notes.py,sha256=ljO3TOe-Qg0bJ0mlFQwjg--Pxmj-XFknoLbcbJmII0A,15106
17
17
  nc_py_api/notifications.py,sha256=WgzV21TuLOhLk-UEjhBSbMsIi2isa5MmAx6cbe0pc2Y,9187
18
- nc_py_api/options.py,sha256=K5co-fIfFVbwF6r3sqWsJF3cKgAbS2CjLAXdyTOkP9s,1717
18
+ nc_py_api/options.py,sha256=ZKJqVLhWVwJ6YxAKzGWlPXJhd1vg9GluyFzr-jX4Jp0,2038
19
19
  nc_py_api/talk.py,sha256=OZFemYkDOaM6o4xAK3EvQbjMFiK75E5qnsCDyihIElg,29368
20
20
  nc_py_api/talk_bot.py,sha256=_RuImwb3jYvUKX3ywcX095ucOjECCxsuc59heIxNoTM,16725
21
21
  nc_py_api/user_status.py,sha256=I101nwYS8X1WvC8AnLa2f3qJUCPDPHrbq-ke0h1VT4E,13282
@@ -46,8 +46,8 @@ nc_py_api/files/_files.py,sha256=_s_f8xbzQPEH2F2LNwomI9CxscYHryus1pMZ_vW00C4,136
46
46
  nc_py_api/files/files.py,sha256=7x4hfnVa2y1R5bxK9f8cdggi1gPnpUYnsBj0e4p-4qc,24926
47
47
  nc_py_api/files/files_async.py,sha256=nyDeWiGx_8CHuVrNThSgfZy0l-WlC4El-TzJONo0TsM,25773
48
48
  nc_py_api/files/sharing.py,sha256=VRZCl-TYK6dbu9rUHPs3_jcVozu1EO8bLGZwoRpiLsU,14439
49
- nc_py_api-0.18.1.dist-info/METADATA,sha256=kNiYxJLCeclDF7NYY0B3sa9nXkqqm7T1yfZfE4Yx7GE,9502
50
- nc_py_api-0.18.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- nc_py_api-0.18.1.dist-info/licenses/AUTHORS,sha256=B2Q9q9XH3PAxJp0V3GiKQc1l0z7vtGDpDHqda-ISWKM,616
52
- nc_py_api-0.18.1.dist-info/licenses/LICENSE.txt,sha256=OLEMh401fAumGHfRSna365MLIfnjdTcdOHZ6QOzMjkg,1551
53
- nc_py_api-0.18.1.dist-info/RECORD,,
49
+ nc_py_api-0.18.2.dist-info/METADATA,sha256=w6waXTKQimSLZrNeCDd7Gpy12U0fK6SlYFEVgpMxHX4,9534
50
+ nc_py_api-0.18.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
+ nc_py_api-0.18.2.dist-info/licenses/AUTHORS,sha256=B2Q9q9XH3PAxJp0V3GiKQc1l0z7vtGDpDHqda-ISWKM,616
52
+ nc_py_api-0.18.2.dist-info/licenses/LICENSE.txt,sha256=OLEMh401fAumGHfRSna365MLIfnjdTcdOHZ6QOzMjkg,1551
53
+ nc_py_api-0.18.2.dist-info/RECORD,,