-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add $uid and $password templates to 'files_external' configuration #11939
Conversation
Pull 'uid' and 'password' variables from PHP session 'smb-credentials' array - if existing - and allow them to be used as $uid and $password templates when configuring system mounts (in data/mount.json). This allows to dynamically mount users' home directories using their login credentials and comes handy when using the 'user_ldap' authentication App/backend.
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
This will most likely not work anymore that way with #11747 |
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
Regarding #11747 |
Well, this would not really offer any advantages despite the fact that it would be another untested function that leads to potential bugs. Better approach is: Store the credentials if required and if not, just don't store them. |
I propose that I will first take care of #11747 after 7.0.3 is released (could take up to two weeks) and then we can update this PR to decrypt the credentials. |
I'm the original author of SMB_OC, and it has a really bad design. There is an PR floating around somewhere that replaces the |
For now the goal is: Store the password only if required and encrypt it with a secret stored in config.php. Sure - this is not a perfect solution either but we need to move forward and this needs also to work for older versions. We can improve the SMB_OC storage at any time later :-) |
The inspection completed: 8 new issues, 3 updated code elements |
If the "only if required" can be less constraining than SMB_OC being used, then it would great. |
Sounds like a plan. Thank you! |
Hello, I've had time to experiment with what this PR allows to do and thought it may be worth sharing what I learned. From the (SFTP) sync' perspective: From the OC sharing perspective: About user credentials in PHP sessions: About user credentials in "dynamically-maintained" mount.json: Given all those pros and cons (and mostly because of the security consequences), I'm now wondering whether I still want to go down that way... Hope these thoughts can help others, Best |
Hello, |
Sure. I never said something against that. But our development cycle is: Fixing something in master/stable7 before we think of "changing" the approach completely ;-) We even have this planned for the next releases, see #12216 - feel free to comment there as well about your thoughts. And if you want to do a task of it: Feel free to. (but please comment there to prevent that somebody else is also working on it) |
Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
@Xenopathic External storage fun – interested? |
I disagree with the ability to substitute in |
Can one of the admins verify this patch? |
We probably need a different approach for this. |
I understand this is to be closed in favor of a modernized solution as required by #16305. The current state would not be mergable also and at least would need a rebase. Please reopen if I should be wrong. |
@blizzz This is about replacement of substitution variables in configuration fields, so it's related, but not quite the same. I don't know where we are going to take this exactly though, and as I mentioned above I think the password should never be substituted, so closing is probably the best solution. I'm currently refactoring a lot of this anyway. |
Fine for me. |
@cedric-dufour We will implement that, but not by using |
Pull 'uid' and 'password' variables from PHP session 'smb-credentials'
array - if existing - and allow them to be used as $uid and $password
templates when configuring system mounts (in data/mount.json).
This allows to dynamically mount users' home directories using their
login credentials and comes handy when using the 'user_ldap' authentication
App/backend.
It has been verified to work successfully using OC 7.0.2 and SFTP.
I Hope it can help!
Best,
Cédric