Repository navigation
docs(plugins): plugin documentation brought up to date (accounts boundary, auth_provider, multi-repo ids, real doc links) - #47
Merged
Conversation
…s through auth_provider Answers the recurring design question in code + docs: - plugins/base.py: AuthProviderPlugin docstring no longer says "do not implement until core auth is stable" — core accounts ARE stable now. It documents the real contract: core calls authenticate(request_headers) only for requests without a session or M2M key, the returned username is an opaque identity that does NOT become a User row (no role, no account management). - docs/plugins/AUTHORING.md: the auth_provider type row now describes the implemented interface, and a new subsection "Can a plugin authenticate users?" explains: there is no context.accounts facade (no user list, no password verification, no role management); a plugin CAN act as an authentication source so clients "log in via API" by sending the plugin's own header credential — every /api/* route is then allowed; provider identities get no User row/role/account UI; ordering (session -> M2M key -> providers) and the deliberate fact that the provider check precedes the first-run /setup gate; and that a plugin's server.extension routes are not open paths, so auth must go through authenticate(). - tests/architecture/test_accounts_first_run.py: new test asserts PluginContext exposes exactly the eight documented facades (no accounts, users, auth, login, password, roles, current_user) and that the auth_provider hook takes headers only.
…urrent contract The author guide and core comments pointed at `PLUGIN_ARCHITECTURE.md` and `INTEGRATION.md` — neither file exists in this repo (the design record lives in docs/architecture.md and wayfinder/). Every non-historical reference is repointed at a real document: - AUTHORING.md header -> docs/architecture.md + wayfinder/plugin-architecture-map.md - plugins/registry.py -> AUTHORING.md §8 (repository index shape) - plugins/manager.py, app.py, services/queue_service.py, plugins/api.py, tests/run_smoke_test.py -> real descriptions instead of nonexistent sections Documentation brought up to date with the shipped contract: - §3 server_extension: routes are authenticated like every other route (accounts login; machine clients use the M2M API key; Open_PATHs listed); you cannot host your own unauthenticated login endpoint — use auth_provider. - §7 Versioning: states the current plugin API (1.0.1) and that ^1.0 covers minor bumps. - §8 Publishing: new "Your id is not globally unique" section — one marketplace entry per (repository, plugin), "Also in:" duplicate warnings, installs carry the source repository and are refused when ambiguous, switching source is explicit, reverse-DNS recommendation. - §9 Trust model: fnack requires a login; plugins have no access to accounts. (historical wayfinder tickets/research keep their original references — they are records of what was planned at the time.)
tajanthind
force-pushed
the
docs/plugin-auth-contract
branch
from
September 10, 2026 01:55
8102790 to
88577a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto
mainafter #46 merged (resolves the conflict intests/architecture/test_accounts_first_run.py— both tests kept) and expanded into a proper documentation update.1. Fixes the merge conflict
#46 and this branch both edited
tests/architecture/test_accounts_first_run.py; the rebase keeps both the healthcheck test and the new plugin-context test, both registered in__main__.2. Answers "do plugins have access to accounts? can a plugin log users in via API?"
context.accountsfacade.PluginContextexposes exactlylibrary, settings, events, http, fs, ui, jobs, log— no user list, no password verification, no roles. Reaching around it would mean importingmodels/services.accounts, which the plugin boundary forbids.auth_providertype:authenticate(request_headers) -> Optional[str]. Core calls enabled providers on every request with no session and no valid M2M key; returning a username authorizes the request. Clients can therefore "log in via API" by sending the plugin's own header credential (this is howfnack.reverse-proxy-authworks). Limits: the identity is opaque — noUserrow, no role, no account management, not shown in the UI chip; the provider check runs before the first-run/setupgate (deliberate for SSO).plugins/base.py:AuthProviderPlugindocstring updated (it still said "do not implement until core auth is stable").docs/plugins/AUTHORING.md: new §4 subsection "Can a plugin authenticate users? (auth_provider)" with a code example.PluginContexthas exactly the eight facades (accounts/users/auth/login/password/roles/current_usermust not exist) andauthenticatetakes headers only.3. Repoints documentation at files that actually exist
The author guide and core comments referenced
PLUGIN_ARCHITECTURE.mdandINTEGRATION.md— neither exists in this repo. Fixed indocs/plugins/AUTHORING.md,plugins/registry.py,plugins/manager.py,plugins/api.py,app.py,services/queue_service.py,tests/run_smoke_test.py. Historicalwayfinder/tickets/research keep their original references — they are records of what was planned at the time.4. Documents the shipped contract for plugin authors
server_extension: routes are authenticated like every other route (accounts session, or the M2MX-API-Keyfor machine clients;Open_PATHslisted) — you cannot host your own unauthenticated login endpoint; useauth_provider.^1.0covers minor bumps.Verification
smoke-test+build-and-pushboth SUCCESS.