Skip to content
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

Refactor Authentication System and simplify/harden API #73

Open
dakcarto opened this issue Jan 27, 2017 · 0 comments
Open

Refactor Authentication System and simplify/harden API #73

dakcarto opened this issue Jan 27, 2017 · 0 comments

Comments

@dakcarto
Copy link
Member

This is a preliminary statement about my intentions, via Boundless sponsored development, of a refactoring, simplification and hardening of the authentication system, which will mostly be covered in an upcoming QEP.

While most of the changes will not affect the API, like porting Qt4-dependent code to Qt5, I would like to accomplish the following in its C++ API for:

QgsAuthManager

  • Simplify the API of the class
  • Move most SSL functionality out of it
  • Possibly adjust its singleton pattern design (as discussed in Singletons #42)

QgsAuthMethodRegistry

  • Add a means of creating/registering/deleting authentication methods, for PyQGIS binding.

QgsAuthCertUtils

  • Remove all QCA-specific code/functions that can now be accomplished with Qt5

QgsNetworkAccessManager

  • Updating QgsNetworkAccessManager to be authentication-system-aware, by being able to react to an authcfg token in a URL, would allow for automated selection of authentication relative to the endpoints base URL, i.e. offering a recommended existing auth config instead of requiring a user to pre-assign authentication configurations for every endpoint connection. The API change to QgsNetworkAccessManager would be minimal, possibly just an optional authcfg parameter for calls that already have the token stripped from the request URL.

For PyQGIS, there should be discussion on a hardening of the API to reduce attack vectors from possibly nefarious Python plugins or scripts. Granted, there are pluses/minuses to every approach I have thought of (to be outlined in QEP). These are the basic changes.

PyQGIS API:

  • Reduce binding coverage to the auth system to the bare minimum needed to interact with it.
  • Stabilize on methodology and API for accessing credentials (generally not needed if QgsAuthManager is handling authentication). Several potential approaches can be used, user-authorization per plugin or plugins are distributed code signing certificates from QGIS, etc.
  • Possibly add a means of creating/registering/deleting authentication methods via PyQGIS. This will aid in creation of third-party authentication methods, though does open QGIS to further attack vectors (like hijacking an existing auth method) is not done correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant