-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Summary
The auth abilities already exist in core (datamachine/get-auth-status, datamachine/disconnect-auth, datamachine/save-auth-config) but there's no CLI surface for them. Need a wp datamachine auth command.
Proposed subcommands
wp datamachine auth status [<handler_slug>]
- No arg: show table of all registered auth providers with configured/authenticated status
- With arg: show detailed status for one provider
wp datamachine auth connect <handler_slug>
- For OAuth providers (Twitter, Instagram, Facebook, Reddit, Threads): calls
get-auth-statusability which returnsoauth_url, prints it for the user to click in browser. Existing callback handlers complete the flow. - For non-OAuth providers (Bluesky): accepts
--configflags directly (e.g.--handle=x --app-password=y), callssave-auth-configability.
wp datamachine auth disconnect <handler_slug>
- Wraps
disconnect-authability. Clears stored account data.
wp datamachine auth config <handler_slug>
- Wraps
save-auth-configability. Saves API keys / client credentials. - Shows required config fields via
get_config_fields()on the provider.
Context
- All three abilities are in
inc/Abilities/AuthAbilities.php - Auth providers register via
datamachine_auth_providersfilter - Base classes:
BaseAuthProvider,BaseOAuth1Provider,BaseOAuth2Providerininc/Core/OAuth/ - Each provider implements
get_authorization_url()andhandle_oauth_callback()for OAuth flow - New command class should go in
inc/Cli/Commands/AuthCommand.phpextendingBaseCommand - Register in
Bootstrap.phpaswp datamachine auth
Current state
The data-machine-socials plugin has per-platform status subcommands (e.g. wp datamachine-socials twitter status) but these are convenience wrappers — the core auth management belongs in data-machine.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels