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/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/). diff --git a/requirements.txt b/requirements.txt index 4d5f5c2..dc79773 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pytest==6.2.4 +pytest==9.0.3 httpx==0.23.0 rdflib==5.0.0 \ No newline at end of file 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() 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.') 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) """