Re: [QGIS-Developer] [PyQGIS] adding a layer with an auth config ID leaks into the project

2019-10-14 Thread Denis Rouzaud
Hi Bernard, Many thanks works perfectly. Le lun. 14 oct. 2019 à 16:13, Bernhard Ströbl a écrit : > Hi Denis, > > I use: > uri = QgsDataSourceUri() > uri.setDataSource(schemaName, tableName, geomColumn) > uri.setConnection(thisHostName, > str(thisPort), thisDatabaseName, > "", "",

Re: [QGIS-Developer] [PyQGIS] adding a layer with an auth config ID leaks into the project

2019-10-14 Thread Bernhard Ströbl
Hi Denis, I use: uri = QgsDataSourceUri() uri.setDataSource(schemaName, tableName, geomColumn) uri.setConnection(thisHostName, str(thisPort), thisDatabaseName, "", "", QgsDataSourceUri.SslRequire, thisAuthCfgId) vLayerUri = uri.uri(False) vlayer = QgsVectorLayer(vLayerUri, displayName,

[QGIS-Developer] [PyQGIS] adding a layer with an auth config ID leaks into the project

2019-10-14 Thread Denis Rouzaud
Hi all, I add a layer using an authentification config ID using PyQGIS: uri = QgsDataSourceUri() uri.setConnection(HOST, PORT, DB, None, None, QgsDataSourceUri.SslPrefer, pg_auth_id) In the project, the credentials are written in clear text in the project file: dbname='pub'