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

Allow SSL params for Auth #430

Merged
merged 7 commits into from
Oct 11, 2024
Merged

Allow SSL params for Auth #430

merged 7 commits into from
Oct 11, 2024

Conversation

cymed
Copy link
Contributor

@cymed cymed commented Sep 27, 2024

This PR aims to fix the problems in #393. Now. all parameters in the pg_service entry are evaluated by the plugin. When using INTERLIS-Import/Export, all values that are not host/port/database/user/password are stored in a temporary dbparams file for usage in ili2pg.

The main problem I have now is that that SSL-keys must be in DER format to be used in ili2pg, but QGIS requires PEM. Everything except INTERLIS works with SSL. See claeis/ili2db#551 for upstream issue

@cymed cymed added help wanted Extra attention is needed plugin Concerns the wastewater plugin labels Sep 27, 2024
@cymed cymed self-assigned this Sep 27, 2024
@cymed
Copy link
Contributor Author

cymed commented Sep 27, 2024

@domi4484 DatabaseConfig does not accept overridden env variables from QGIS. How could we alter that?

@domi4484
Copy link
Contributor

@cymed I am not sure what do you mean. At this place you have the possibility to pass things from the "QGIS world": https://github.com/teksi/wastewater/blob/main/plugin/teksi_wastewater/teksi_wastewater_plugin.py#L614

Otherwise the modifications here looks correct to me, is it something that still doesn't work?

@cymed
Copy link
Contributor Author

cymed commented Sep 30, 2024

My main problem is handling of the user name. ili2pg requires a username even if the username is implicitly passed using certs. Currently, I implemented the OS user as a fallback, but there might be situations where the pg username is distinct from the OS username.
One option would be to override the PGUSER variable in QGIS, which is then read on initialisation. I do however not know how to access these.

@cymed cymed marked this pull request as ready for review September 30, 2024 06:10
@cymed cymed changed the title [WIP] Allow SSL params for Auth Allow SSL params for Auth Sep 30, 2024
@cymed cymed requested a review from domi4484 September 30, 2024 08:18
@domi4484
Copy link
Contributor

One option would be to override the PGUSER variable in QGIS, which is then read on initialisation. I do however not know how to access these.

I guess you should be able to access it like that, but this needs to be done inside teksi_wastewater_plugin.py and passed to the DBUtils class

expression = QgsExpression('@PGUSER')
pguser = expression.evaluate()

@cymed cymed requested a review from domi4484 September 30, 2024 12:02
@cymed cymed removed the help wanted Extra attention is needed label Sep 30, 2024
@cymed cymed requested a review from ponceta October 10, 2024 15:27
@ponceta
Copy link
Member

ponceta commented Oct 11, 2024

@cymed Fine for me, ili2db remains an issue but won't be fixed here right?

Free to merge.

@cymed
Copy link
Contributor Author

cymed commented Oct 11, 2024

sslmode works, but ili2db and QGIS require different cert types. Once thst is fixed upstream, we need no adaptations

@cymed cymed merged commit d48313e into teksi:main Oct 11, 2024
4 checks passed
@ponceta
Copy link
Member

ponceta commented Oct 11, 2024

sslmode works, but ili2db and QGIS require different cert types. Once thst is fixed upstream, we need no adaptations

is fixed or has to be fixed upstream, because I saw your issue is still open on ili2pg?

@cymed
Copy link
Contributor Author

cymed commented Oct 11, 2024

sslmode works, but ili2db and QGIS require different cert types. Once thst is fixed upstream, we need no adaptations

is fixed or has to be fixed upstream, because I saw your issue is still open on ili2pg?

The upstream issue stems from the type of ssl certificate only. Once it is fixed upstream, the TEKSI code is already ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Concerns the wastewater plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants