Let a connection's form offer options found on the remote service, several chosen, each with a mode #332
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#332
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A connection's form is drawn from the plugin's
FieldSpecs, with every choice fixed whenconfig_fields()is called. The DAV plugin is asked to make sure it "can only read and/or write the desired / specified calendar(s), contact list(s), task(s), files(s), folder(s)", and only the server knows which address books, calendars and task lists exist and which the account may write (postulo/postulo-dav#13). A plugin can take only typed text; what it finds, it can only name in Test's sentence.What the core has today
text,url,email,password,integer,boolean,choiceandtextarea; achoicemust declare static, non-empty choices (src/postulo/plugins/base.py:515, 534-540). Nothing holds several values.config_fields()is handed the owner at most (call_with_user,base.py:373-391;plugins/forms.py:154-157), never the stored configuration or the service. The one computed choice, the email notifier's verified addresses (#232), comes from Postulo's own records.plugins/views.py:361-411,plugins/models.py:271-279). It cannot write into the configuration.validate(config)runs on submit, sees configuration and secrets together, and reports per field (plugins/forms.py:192-216).plugins/models.py:190). One connection per collection is today's only way to choose several.Proposal
discover(config)on a connected plugin, looked up by name asvalidateandsummaryare. It returns, per field, the options found: a value (for DAV, an href), a label in words, an optional group ("Address books"), the modes the option may take, and an optional note ("Read only on the server"). Nothing in it is secret.configunder a key the core owns. A form save already keeps keys that are not fields (plugins/forms.py:177-190).FieldSpecdeclares its modes as(value, label)pairs (for DAV: read, write, read and write). It stores option value → mode, for chosen options only, drawn as a table: one row per option, grouped, each with a select offering Not used and the modes that option allows.templates/connections/form.html:92-96).validatestays the last check and sees the choices and their modes.POSTULO_CONNECTION_TEST_RATE(plugins/views.py:373-385). A failure is a sentence, and the stored options stay as they were.The core draws the choice and does not enforce it; the plugin still holds its requests to it.
Possibly useful beyond DAV (untried): postulo-imap takes its folder, and postulo-paperless a tag and a custom field, by typed name; each could pick from what its server lists.
Decisions
config, as above. A table of their own needs a migration and buys nothing.config_fields()with the sameform_field_for(core/server_forms.py:560-562). Recommended: the new type for connections only, and a transport that declares it refused with a sentence.Needed by
postulo/postulo-dav#13.
Done when
discover; a saved connection shows what was found, several chosen with a mode each and a vanished one in words, andvalidatesees it all.postulo.plugins.apibesideFieldSpec(which gainsmodes), with its line in Writing a plugin (tests/test_wiki_surface.py), the publishedpostulo.plugins.testingcheck andtests/test_plugin_surface.py. The wiki's Plugins that connect to another service describes the field,discover, what is stored, and that enforcement stays with the plugin.EXCUSEDwith a reason (tests/test_page_coverage.py) and in the isolation sweep (tests/security/test_isolation_sweep.py), answering 404 for somebody else's connection.tests/e2e/test_accessibility.py) visits a connection form showing found options. New strings are in en, fr-fr, pt-pt and pt-br (drafts).From the list of DAV plugin improvements of 2026-09-30.