You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A global permission is required to view a specific repository #2415
Thanks @johnnyaug. FYI, I will be out of town this weekend, so I will most likely start really working on this issue (as well as Issue #2316) when I return Monday next week (hopefully that isn't an issue).
Thanks again for the help and letting me contribute to lakeFS.
Hey @johnnyaug just wanted to provide a little update. I'm starting to look at this more thoroughly tonight. Currently I'm trying to follow some of the implementation and declaration paths so I know what function/method should be checking for this specific perms.
I will probably have more detailed questions tomorrow or Wednesday. Do you happen to know which function/methods I should focus on making sure they check fs:ReadConfig? In mean time I will reach out to lakeFS slack channel if I need any other help.
Hey @johnnyaug, not sure I understand what's wrong here. The ReadConfig allows one to read a config which is not unique to any repository. The returned struct is:
The last 2 are lakeFS values and has nothing to do with the installation, the first one is the installation blockstore type. Why do you think that we need per-repo permissions here? Or do you think that we need to simply add the fs:ReadConfig:* to the default FSReadWriteAll policy as well?
@itaiad200 I think the issue resides elsewhere. The function GetStorageConfig requires permissions for all repositories. That sort-of makes sense (its semantics are not tied to a specific repository).
But in practice the GUI uses this function on the RepositoriesObjectPage, to get ObjectsBrowser configuration. So if you don't have fs:ReadConfig on allrepositories, I guess you cannot view objects in any repository.
Perhaps we need another, better-named, API endpoint in Swagger (GetRepositoryStorageConfig?). It will fetch the required properties for the repository, and will be able to apply more fine-grained permissions.
@DataDavD: The first step is to map what the objects page (see above) reads from the configuration. With that information you should be able to propose what information we really want to return. Does this make sense?
Simply put, as a lakeFS admin if I want to give my user permissions only for repo A, I have to give them this permission, which looks weird. It is implied by the name of this permission that it may allow access to installation-wide information. As a developer, I may be tempted to use this permission for other, more sensitive endpoints.
If we go with @arielshaqed's suggestion - we can remove this permission and protect the proposed endpoint with the existing fs:ReadRepository permission.
hey @itaiad200 and @arielshaqed sorry for the delayed response (been busy with work/life - the normal 😄 ).
Thank you very much for the detailed explanations. I believe I have a much better starting point now, if I have any questions later on I'll be sure to ask them. I will also provide a bit more updates once I'm in the thick of the code changes (which I intend to start regularly working on this this week).
Update: I got sidetracked working on Issue #2316 but working on it helped my understanding of how the front end/react components use the backend Go code of lakeFS, so I'll be starting up work on this this weekend and should have something more concrete next week that we can discuss to make sure I'm moving in the right direction.
If there are any issues current progress please let me know.
Another update: I got even more sidetrack working on React specific for Issue #2316 (I'm a backend engineer so my frontend skills are little weak 🤣 , but its good practice 📚 ).
So, I probably won't be able to get to fully working on this issue until next week since I'll be out of town this weekend and am trying to finish Issue #2316 If that is an issue please let me know @johnnyaug@itaiad200. I'll update you again next week once I start working on this Issue again and if I have any other questions/concerns.
hey friends sorry for the very late update. I've been extremely bogged down with work and life stuff (trying to buy a house and move states/cities, all while wrapping up a couple big projects at work), so I haven't really gotten to touch this. If someone else wants to have a go feel free. If not then I will probably start looking at this in my free time over the next two weeks as I get more of it. sorry and thank you for understanding
No worries @DataDavD , many thanks for your contributions so far!
I'm unassigning you so others can pick this up. If you made any progress on this and wish to share it, open a PR and link it here.
hey @arielshaqed so I took a look at this again based on your original suggestions and so far this is what I have determined.
config.getStorageConfig() is called in 2 places:
CreateRepositoryModal where the configs are used to determine things like which storage type you can use, etc. I believe the original GetStorageConfig() controller method can be used here.
RepositoryObjectsPage by which ObjectsBrowser uses the config. This is what you called you originally.
From my knowledge the config here is only utilized for the UploadButton by which, from my knowledge, UploadButton only uses the warnings from the config (via config.blockstore_type) to provide a warning when trying to upload that local and mem types.
So, if my understanding of GetStorageConfig's usage in RepositoryObjectsPage, then I would possible want to still use config.blockstore_type for the warnings, AND I would probably need to add some repository specific info to ensure that a user has access to the repository in question to upload anything, correct? But, for this particular action (Upload repo object), should we be requesting the UploadObject response?
Maybe I'm missing something, but I figure maybe for this particular use case, we should be using UploadObject response given that particular use case of the storage config in this instance is during repo object upload and its just checking for warnings.
Activity
codeaucafe commentedon Aug 30, 2021
Not sure if this issue is planned for anyone, but I'd be happy to assist in fixing this bug if no one is tasked with this Issue yet.
johnnyaug commentedon Aug 31, 2021
Hey @DataDavD, thank you, it would be great! I'm assigning you.
codeaucafe commentedon Sep 1, 2021
Thanks @johnnyaug. FYI, I will be out of town this weekend, so I will most likely start really working on this issue (as well as Issue #2316) when I return Monday next week (hopefully that isn't an issue).
Thanks again for the help and letting me contribute to lakeFS.
best,
dd
codeaucafe commentedon Sep 21, 2021
Hey @johnnyaug just wanted to provide a little update. I'm starting to look at this more thoroughly tonight. Currently I'm trying to follow some of the implementation and declaration paths so I know what function/method should be checking for this specific perms.
I will probably have more detailed questions tomorrow or Wednesday. Do you happen to know which function/methods I should focus on making sure they check
fs:ReadConfig? In mean time I will reach out to lakeFS slack channel if I need any other help.Thank you!
itaiad200 commentedon Sep 27, 2021
Hey @johnnyaug, not sure I understand what's wrong here. The ReadConfig allows one to read a config which is not unique to any repository. The returned struct is:
The last 2 are lakeFS values and has nothing to do with the installation, the first one is the installation blockstore type. Why do you think that we need per-repo permissions here? Or do you think that we need to simply add the
fs:ReadConfig:*to the defaultFSReadWriteAllpolicy as well?arielshaqed commentedon Sep 27, 2021
@itaiad200 I think the issue resides elsewhere. The function
GetStorageConfigrequires permissions for all repositories. That sort-of makes sense (its semantics are not tied to a specific repository).But in practice the GUI uses this function on the
RepositoriesObjectPage, to getObjectsBrowserconfiguration. So if you don't havefs:ReadConfigon all repositories, I guess you cannot view objects in any repository.Perhaps we need another, better-named, API endpoint in Swagger (
GetRepositoryStorageConfig?). It will fetch the required properties for the repository, and will be able to apply more fine-grained permissions.@DataDavD: The first step is to map what the objects page (see above) reads from the configuration. With that information you should be able to propose what information we really want to return. Does this make sense?
johnnyaug commentedon Sep 27, 2021
I basically agree with @arielshaqed.
Simply put, as a lakeFS admin if I want to give my user permissions only for repo A, I have to give them this permission, which looks weird. It is implied by the name of this permission that it may allow access to installation-wide information. As a developer, I may be tempted to use this permission for other, more sensitive endpoints.
If we go with @arielshaqed's suggestion - we can remove this permission and protect the proposed endpoint with the existing
fs:ReadRepositorypermission.itaiad200 commentedon Sep 27, 2021
Thanks @arielshaqed & @johnnyaug for the clarifications. I agree with your suggestions.
@DataDavD is the path forward clearer now?
codeaucafe commentedon Sep 29, 2021
hey @itaiad200 and @arielshaqed sorry for the delayed response (been busy with work/life - the normal 😄 ).
Thank you very much for the detailed explanations. I believe I have a much better starting point now, if I have any questions later on I'll be sure to ask them. I will also provide a bit more updates once I'm in the thick of the code changes (which I intend to start regularly working on this this week).
Thanks again for all y'all's assistance.
Best,
David
codeaucafe commentedon Oct 8, 2021
Update: I got sidetracked working on Issue #2316 but working on it helped my understanding of how the front end/react components use the backend Go code of lakeFS, so I'll be starting up work on this this weekend and should have something more concrete next week that we can discuss to make sure I'm moving in the right direction.
If there are any issues current progress please let me know.
Best,
David
codeaucafe commentedon Oct 14, 2021
Another update: I got even more sidetrack working on React specific for Issue #2316 (I'm a backend engineer so my frontend skills are little weak 🤣 , but its good practice 📚 ).
So, I probably won't be able to get to fully working on this issue until next week since I'll be out of town this weekend and am trying to finish Issue #2316 If that is an issue please let me know @johnnyaug @itaiad200. I'll update you again next week once I start working on this Issue again and if I have any other questions/concerns.
Thanks again!
Best,
David
4 remaining items
codeaucafe commentedon Mar 25, 2022
hey friends sorry for the very late update. I've been extremely bogged down with work and life stuff (trying to buy a house and move states/cities, all while wrapping up a couple big projects at work), so I haven't really gotten to touch this. If someone else wants to have a go feel free. If not then I will probably start looking at this in my free time over the next two weeks as I get more of it. sorry and thank you for understanding
cc @itaiad200 @johnnyaug
itaiad200 commentedon Mar 27, 2022
No worries @DataDavD , many thanks for your contributions so far!
I'm unassigning you so others can pick this up. If you made any progress on this and wish to share it, open a PR and link it here.
codeaucafe commentedon Mar 27, 2022
Sounds good. Thank you @itaiad200. I may get to take another look this week, if I do I'll share anything helpful.
codeaucafe commentedon Apr 2, 2022
hey @arielshaqed so I took a look at this again based on your original suggestions and so far this is what I have determined.
config.getStorageConfig()is called in 2 places:CreateRepositoryModalwhere the configs are used to determine things like which storage type you can use, etc. I believe the originalGetStorageConfig()controller method can be used here.RepositoryObjectsPageby whichObjectsBrowseruses the config. This is what you called you originally.UploadButtonby which, from my knowledge,UploadButtononly uses the warnings from the config (viaconfig.blockstore_type) to provide a warning when trying to upload thatlocalandmemtypes.So, if my understanding of
GetStorageConfig's usage inRepositoryObjectsPage, then I would possible want to still useconfig.blockstore_typefor the warnings, AND I would probably need to add some repository specific info to ensure that a user has access to the repository in question to upload anything, correct? But, for this particular action (Upload repo object), should we be requesting the UploadObject response?Maybe I'm missing something, but I figure maybe for this particular use case, we should be using UploadObject response given that particular use case of the storage config in this instance is during repo object upload and its just checking for warnings.
Any thoughts? Help with something I'm missing?
cc @itaiad200 @johnnyaug
thanks in advance!
happy coding,
david
codeaucafe commentedon Apr 2, 2022
Also, FYI I think I'll have time and motivation to tackle this issue now, so happy to get reassigned if no one else is taking this issue on yet.
codeaucafe commentedon Apr 7, 2022
@arielshaqed sorry to bother you, but bumping the above to get some input before I proceed this weekend/next week on working on this
github-actions commentedon Nov 1, 2023
This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.
github-actions commentedon Nov 12, 2023
Closing this issue because it has been stale for 7 days with no activity.