Skip to content

Conversation

@harminius
Copy link
Contributor

@harminius harminius commented Nov 27, 2025

Resolves #834

Export ➡️

  • before every sync
  • detect changes in auth configs by comparing the hash of the current config to one saved in qgis_conf.xml
  • overwrite the file if the auth config of the used layers has changed, skip otherwise

Import ⬅️

  • import from file to the auth db when the project is opened (overwrite the auth ids)

- export used layer credentials on project sync - overwrite qgi_conf.xml if auth config changed, skip otherwise
- import from file to auth db when project is opened
@harminius harminius changed the title Draft: Auth synchronization Auth synchronization Nov 28, 2025

def current_project_sync(self):
"""Synchronise current Mergin Maps project."""
AuthSync().export_auth(self.mc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, If here is permission check somewhere, or it's not called by design?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is inside the export method, do you prefer to put it outside?

@harminius harminius requested a review from MarcelGeo December 3, 2025 13:05
Copy link
Contributor

@JanCaha JanCaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good 👍

@harminius harminius merged commit 33ea2a8 into dev-2025.4.1 Dec 19, 2025
7 checks passed
@harminius harminius deleted the export_import_auth branch December 19, 2025 15:24
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

Successfully merging this pull request may close these issues.

4 participants