<div dir="ltr">Hi Tom,<div class="gmail_extra"><div><div class="gmail_signature"><div dir="ltr"><br></div></div></div><div class="gmail_quote">On Fri, Mar 10, 2017 at 2:11 AM, Tom Chadwin <span dir="ltr"><<a href="mailto:tom.chadwin@nnpa.org.uk" target="_blank">tom.chadwin@nnpa.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Sorry to threadjack, but a related question: Larry I think mentioned maybe<br>
removing the Python bindings for the auth system. Is that still the<br>
intention? Nyall has implemented FTP upload in qgis2web (other connection<br>
types such as SCP, SFTP can be developed using this framework). However,<br>
securely saving the password would be a real benefit. The auth system would<br>
be the most secure way to achieve this, obviously. If the Python bindings<br>
are to be removed, there's no point in using them to allow password saving.<br></blockquote><div><br></div><div>Note: master password saving/restoring (as noted in this thread) is different than the connection credentials stored/retrieved in the auth system.</div><div><br></div><div>What Python bindings will be removed is still open for discussion. I will soon be submitting a QEP for Qt5 updates/refactoring of the QGIS auth system, as well as security hardening.</div><div><br></div><div>However, there always needs to exist within the auth system GUI bindings a simple means for plugins to offer their users a way of selecting and utilizing auth system configurations. This is already supported with the QgsAuthConfigSelect widget [0]. In this way, a plugin author just needs to include the auth system widgets in their plugin's layout (if defining connections are key to the plugin's functionality). Then, all that the plugin needs to store/retrieve is the 'authcfg' token that represents an auth system configuration.</div><div><br></div><div>The problem comes in when a plugin *prefers* to utilize a different HTTP (or other connection) library instead of interacting with QgsNetworkAccessManager. In these cases, the plugin needs access to not only the auth configuration, but also its actual saved credentials, to pass to the Python library/package. This could be allowed, if the user specifically authorizes a plugin to do so (API for this does not yet exist).</div><div><br></div><div>Another approach, instead of (or in addition to) creating an "authorized plugins cache," is to harden the auth system to always disallow access to credentials from plugins, then offer drop in wrappers for common Python connection libs, supporting QgsNetworkAccessManager and the QGIS auth system. Indeed, Alessandro Pasotti has already done this for 'httplib2' [0]; and, it could be done for 'requests'.</div><div><br></div><div>Note: this latter approach also allows the plugin to inherit the QGIS app's proxy settings associated with QgsNetworkAccessManager, as well as any auth system enhancements applied to the QgsNetworkAccessManager class (some are planned).</div><div><br></div><div>In summary, right now, with QGIS >= 2.14, you can easily use QgsAuthConfigSelect widget in your plugins, then pass the authcfg into the httplib2 wrapper, getting support for QgsNetworkAccessManager and the QGIS auth system without then need to expose credentials to Python. Then, the core auth system classes manage the master password, auth configuration setup and credential expansion. This type of plugin auth configuration integration will likely never be removed from the bindings.</div><div><br></div><div>Thread definitely hijacked :^) Any further discussion should be in the upcoming auth system QEP.</div><div><br></div><div>[0] <a href="https://github.com/qgis/QGIS/blob/master/src/gui/auth/qgsauthconfigselect.h">https://github.com/qgis/QGIS/blob/master/src/gui/auth/qgsauthconfigselect.h</a></div><div>[1] <a href="https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/geoserverexplorer/geoserver/networkaccessmanager.py">https://github.com/boundlessgeo/qgis-geoserver-plugin/blob/master/geoserverexplorer/geoserver/networkaccessmanager.py</a></div><div><br></div><div><div class="gmail_signature"><div dir="ltr">Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota<br>----------------------------------<br>Boundless Desktop and QGIS Support/Development<br>Boundless Spatial - <a href="http://boundlessgeo.com/" target="_blank">http://boundlessgeo.com</a><br><a href="mailto:lshaffer@boundlessgeo.com" target="_blank">lshaffer@boundlessgeo.com</a></div></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-----<br>
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Port-Password-Helper-plugin-into-core-tp5311418p5311718.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.<wbr>nabble.com/Port-Password-<wbr>Helper-plugin-into-core-<wbr>tp5311418p5311718.html</a><br>
Sent from the QGIS - Developer mailing list archive at Nabble.com.<br>
<div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a></div></div></blockquote></div><br></div></div>