Skip to content

Commit 8739f12

Browse files
[pre-commit.ci] pre-commit autoupdate (#186)
<!--pre-commit.ci start--> updates: - [github.com/PyCQA/isort: 5.13.0 → 5.13.2](PyCQA/isort@5.13.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.0](psf/black@23.11.0...23.12.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.7 → v0.1.8](astral-sh/ruff-pre-commit@v0.1.7...v0.1.8) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent fc5793f commit 8739f12

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
- id: mixed-line-ending
1313

1414
- repo: https://github.com/PyCQA/isort
15-
rev: 5.13.0
15+
rev: 5.13.2
1616
hooks:
1717
- id: isort
1818
files: >-
@@ -24,7 +24,7 @@ repos:
2424
)
2525
2626
- repo: https://github.com/psf/black
27-
rev: 23.11.0
27+
rev: 23.12.0
2828
hooks:
2929
- id: black
3030
files: >-
@@ -41,7 +41,7 @@ repos:
4141
- id: pyproject-fmt
4242

4343
- repo: https://github.com/astral-sh/ruff-pre-commit
44-
rev: v0.1.7
44+
rev: v0.1.8
4545
hooks:
4646
- id: ruff
4747

nc_py_api/_session.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ def _create_adapter(self, dav: bool = False) -> AsyncClient | Client:
464464
)
465465

466466
def _add_auth(self, request: Request):
467-
request.headers.update({
468-
"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))
469-
})
467+
request.headers.update(
468+
{"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))}
469+
)
470470

471471

472472
class AsyncNcSessionApp(NcSessionAppBasic, AsyncNcSessionBasic):
@@ -488,6 +488,6 @@ def _create_adapter(self, dav: bool = False) -> AsyncClient | Client:
488488
)
489489

490490
async def _add_auth(self, request: Request):
491-
request.headers.update({
492-
"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))
493-
})
491+
request.headers.update(
492+
{"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))}
493+
)

nc_py_api/ex_app/integration_fastapi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
def nc_app(request: Request) -> NextcloudApp:
2828
"""Authentication handler for requests from Nextcloud to the application."""
29-
user = get_username_secret_from_headers({
30-
"AUTHORIZATION-APP-API": request.headers.get("AUTHORIZATION-APP-API", "")
31-
})[0]
29+
user = get_username_secret_from_headers(
30+
{"AUTHORIZATION-APP-API": request.headers.get("AUTHORIZATION-APP-API", "")}
31+
)[0]
3232
request_id = request.headers.get("AA-REQUEST-ID", None)
3333
nextcloud_app = NextcloudApp(user=user, headers={"AA-REQUEST-ID": request_id} if request_id else {})
3434
if not nextcloud_app.request_sign_check(request):
@@ -38,9 +38,9 @@ def nc_app(request: Request) -> NextcloudApp:
3838

3939
def anc_app(request: Request) -> AsyncNextcloudApp:
4040
"""Async Authentication handler for requests from Nextcloud to the application."""
41-
user = get_username_secret_from_headers({
42-
"AUTHORIZATION-APP-API": request.headers.get("AUTHORIZATION-APP-API", "")
43-
})[0]
41+
user = get_username_secret_from_headers(
42+
{"AUTHORIZATION-APP-API": request.headers.get("AUTHORIZATION-APP-API", "")}
43+
)[0]
4444
request_id = request.headers.get("AA-REQUEST-ID", None)
4545
nextcloud_app = AsyncNextcloudApp(user=user, headers={"AA-REQUEST-ID": request_id} if request_id else {})
4646
if not nextcloud_app.request_sign_check(request):

0 commit comments

Comments
 (0)