Skip to content

Permissions issues with PrivateJsonFile on windows #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
soxofaan opened this issue Mar 29, 2021 · 5 comments
Closed

Permissions issues with PrivateJsonFile on windows #198

soxofaan opened this issue Mar 29, 2021 · 5 comments
Assignees

Comments

@soxofaan
Copy link
Member

Windows does not support fine grained linux style permission chmoding, causing perrmission issues like

File "D:\tmp\env\lib\site-packages\openeo\rest\auth\config.py", line 85, in _write
    assert_private_file(self._path)
  File "D:\tmp\env\lib\site-packages\openeo\rest\auth\config.py", line 30, in assert_private_file
    p=path, a=mode, e=_PRIVATE_PERMS)
PermissionError: File C:\Users\john\AppData\Local\Temp\win-perms-test.json is readable by others: st_mode 100666 (expected permissions: 600).```
soxofaan added a commit that referenced this issue Mar 29, 2021
`os.chmod` does not change group/other permission on Windows,
so not useful to fail on that at the moment.
@soxofaan
Copy link
Member Author

did a first quick fix to make OIDC at least usable on Windows:
now a warning is raised when permissions are not correctly set

@soxofaan
Copy link
Member Author

next step: investigate oschmod (https://pypi.org/project/oschmod/) to set permissions on windows fully (which does not work with vanilla os.chmod)

@soxofaan
Copy link
Member Author

Also interesting solution: some kind of logout feature to remove these local files: #250

@soxofaan
Copy link
Member Author

FYI failing tests related to this are blocker for

JohanKJSchreurs added a commit that referenced this issue Dec 14, 2022
…t_config.py:163: AttributeError

AttributeError: 'function' object has no attribute 'st_mode'
JohanKJSchreurs added a commit that referenced this issue Dec 15, 2022
…ut in extra_requires if you want it on another platform
JohanKJSchreurs added a commit that referenced this issue Dec 16, 2022
soxofaan pushed a commit that referenced this issue Jan 4, 2023
…t_config.py:163: AttributeError

AttributeError: 'function' object has no attribute 'st_mode'
soxofaan pushed a commit that referenced this issue Jan 4, 2023
soxofaan pushed a commit that referenced this issue Jan 4, 2023
…ut in extra_requires if you want it on another platform
soxofaan pushed a commit that referenced this issue Jan 4, 2023
soxofaan added a commit that referenced this issue Jan 4, 2023
@soxofaan
Copy link
Member Author

soxofaan commented Jan 4, 2023

PR #351 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants