-
Notifications
You must be signed in to change notification settings - Fork 0
Capability to access user shared data #9
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
Conversation
fileglancer_central/app.py
Outdated
@@ -53,14 +54,14 @@ def cache_wiki_paths(confluence_url, confluence_token, force_refresh=False): | |||
|
|||
|
|||
|
|||
def get_file_proxy_client(sharing_key: str, sharing_name: str) -> FileProxyClient | Response: | |||
def _get_file_proxy_client(sharing_key: str, sharing_name: str) -> FileProxyClient | Response: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this convention - it gives me the illusion the method is used only in this file. Let me know if you want me to revert it
return False | ||
|
||
|
||
def main(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this in here - because I just did some additional testing but it can be removed
logger.debug("Release user context") | ||
os.seteuid(self._uid) | ||
os.setegid(self._gid) | ||
self._user = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also revert groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably should - I will do that too
if isinstance(client, Response): | ||
return client | ||
return await client.head_object(path) | ||
with userctx: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
8000 The reason will be displayed to describe this comment to others. Learn more.
Very elegant!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
logger.error(f"Failed to set the effective gid: {e}") | ||
raise e | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krokicki on my mac I ran into an exception when I tried to restore the groups - the number of groups my root has on mac is larger than the number allowed to set. So I added this check just to see if this happens
Created a UserContext that allows accesing shared data.