Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#186)
Browse files Browse the repository at this point in the history
<!--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>
  • Loading branch information
pre-commit-ci[bot] authored Dec 18, 2023
1 parent fc5793f commit 8739f12
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: mixed-line-ending

- repo: https://github.com/PyCQA/isort
rev: 5.13.0
rev: 5.13.2
hooks:
- id: isort
files: >-
Expand All @@ -24,7 +24,7 @@ repos:
)
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.0
hooks:
- id: black
files: >-
Expand All @@ -41,7 +41,7 @@ repos:
- id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.1.8
hooks:
- id: ruff

Expand Down
12 changes: 6 additions & 6 deletions nc_py_api/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ def _create_adapter(self, dav: bool = False) -> AsyncClient | Client:
)

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


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

async def _add_auth(self, request: Request):
request.headers.update({
"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))
})
request.headers.update(
{"AUTHORIZATION-APP-API": b64encode(f"{self._user}:{self.cfg.app_secret}".encode("UTF=8"))}
)
12 changes: 6 additions & 6 deletions nc_py_api/ex_app/integration_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

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

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

0 comments on commit 8739f12

Please sign in to comment.