From 01d19a7b21fb82059a7ec0c4c6e269ec5f33fd61 Mon Sep 17 00:00:00 2001 From: A_A <21040751+Otto-AA@users.noreply.github.com> Date: Mon, 20 Feb 2023 09:15:14 +0100 Subject: [PATCH 1/4] docs: clarify that it only works with NSS --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0dc1b08..73128e0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ solid-file-python is a Python library for creating and managing files and folder Read and try it on [jupiter notebook](https://github.com/twonote/solid-file-python/blob/master/solid-file-python-getting-start.ipynb) now! +# Limitations + +Currently the authentication process relies on endpoints and cookies by the node-solid-server. Therefore, at least for now, authentication with other pod providers won't work. + # What is Solid? Solid is a specification that lets people store their data securely in decentralized data stores called Pods. Learn more about Solid on [solidproject.org](https://solidproject.org/). From 74b54d99618c698b6c61aa17f9d54ba2d84d6e1c Mon Sep 17 00:00:00 2001 From: Rui Zhao Date: Tue, 31 Oct 2023 03:10:51 +0000 Subject: [PATCH 2/4] fix: Check HTTP code for redirect before raise (#39) Closes #35 #36 --- src/solid/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/solid/auth.py b/src/solid/auth.py index 008daae..76b55f0 100644 --- a/src/solid/auth.py +++ b/src/solid/auth.py @@ -21,7 +21,9 @@ def login(self, idp, username, password): } r = self.client.post(url, data=data) - r.raise_for_status() + + if not r.is_redirect: + r.raise_for_status() if not self.is_login: raise Exception('Cannot login.') From ffd2c6912d8e96e80ec9384031d954772cad5db6 Mon Sep 17 00:00:00 2001 From: petertc Date: Tue, 31 Oct 2023 05:26:48 +0000 Subject: [PATCH 3/4] Update CI configs - Update install command which is deprecated - Do not specify dependency versions in setup.cfg by following the best practice --- .github/workflows/continuous-integration.yml | 4 ++-- setup.cfg | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e83b0da..42b7162 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -28,7 +28,7 @@ jobs: - name: Install setuptools run: pip install setuptools - name: Install solid - run: python setup.py install + run: pip install . - name: Install pytest run: pip install pytest - name: Run pytest @@ -48,7 +48,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install solid - run: python setup.py install + run: pip install . - name: Install pytest run: pip install pytest - name: Run Solid Authorization tests diff --git a/setup.cfg b/setup.cfg index fa66bba..537fd96 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,8 +21,8 @@ package_dir = packages = find: python_requires = >=3.7 install_requires = - httpx==0.23.0 - rdflib==5.0.0 + httpx + rdflib [options.packages.find] where = src diff --git a/setup.py b/setup.py index 8ab824c..8bf1ba9 100644 --- a/setup.py +++ b/setup.py @@ -1,2 +1,2 @@ from setuptools import setup -setup() \ No newline at end of file +setup() From 3d6103b1bcb1599a17940c8d4734bbc8bdaf44b8 Mon Sep 17 00:00:00 2001 From: Rui Zhao Date: Thu, 2 Nov 2023 03:26:29 +0000 Subject: [PATCH 4/4] fix: Fix crash when create_file called without options (#37) --- src/solid/solid_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solid/solid_api.py b/src/solid/solid_api.py index 9eda911..343875e 100644 --- a/src/solid/solid_api.py +++ b/src/solid/solid_api.py @@ -158,12 +158,12 @@ def create_folder(self, url, options: WriteOptions = WriteOptions(merge=MERGE.KE return self.post_item(url, '', 'text/turtle', LINK.CONTAINER, options) - def post_file(self, url, content: RequestContent, content_type, options: WriteOptions = None) -> Response: + def post_file(self, url, content: RequestContent, content_type, options: WriteOptions = WriteOptions(create_path=False, with_acl=False)) -> Response: if url[-1] == '/': raise Exception(f'Cannot use postFile to create a folder : ${url}') return self.post_item(url, content, content_type, LINK.RESOURCE, options) - def create_file(self, url, content: RequestContent, content_type, options: WriteOptions = None) -> Response: + def create_file(self, url, content: RequestContent, content_type, options: WriteOptions = WriteOptions(with_acl=False)) -> Response: return self.post_file(url, content, content_type, options) """