SShortSingh.
Back to feed

How developers handle HTTP Basic auth in WordPress maintenance tools using Playwright and urllib

0
·1 views

Developers maintaining WordPress sites behind HTTP Basic authentication face a split-path problem where SSH-based tools work fine but HTTP-based tools like Playwright and urllib return 401 errors. The Playwright path fails visibly by capturing auth-prompt screenshots instead of real page thumbnails, while the urllib path silently masks real failures by treating repeated 401 responses as a healthy baseline. To fix this, a shared utility module called basic_auth_utils.py was built to supply credentials in the correct format to both paths from a single source, preventing format mismatches. The credentials are stored in the site configuration JSON using safe dictionary lookups so existing sites without Basic auth are unaffected. Basic auth passwords are also Fernet-encrypted at rest, consistent with how WordPress admin passwords are already handled in the tool.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

From Chatbot to AI Agent: The Key Components That Make It Work

Basic large language models like ChatGPT function as simple text-in, text-out systems with no memory, internet access, or ability to take real-world actions. Developers transform these models into capable AI agents by layering in several components: a system prompt that defines the AI's identity and role, and tools that allow it to browse the web, read files, or run terminal commands. An agent loop enables the AI to chain multiple tool calls together autonomously until a task is fully completed, rather than responding in a single step. Persistent memory allows the agent to retain user preferences and past decisions across separate sessions. Finally, built-in reasoning prompts the AI to plan its approach before acting, reducing errors on complex or multi-step tasks.

0
ProgrammingDEV Community ·

SibFly API lets AI agents query real satellite ground-subsidence data by address

A tool called SibFly now allows AI agents built with LangChain to retrieve measured ground-motion data for any US address, returning vertical displacement rates in millimeters per year. The data is sourced from NASA's OPERA Sentinel-1 InSAR satellite dataset, which tracks sub-centimeter ground movement across North America. Unlike flood-zone or soil models, this signal reflects actual physical measurements, making it useful for screening properties at risk of foundation damage from ground subsidence. Developers can integrate the tool in roughly 30 lines of code, with queries priced at $0.40 per covered result and no charge for out-of-coverage or low-confidence responses. SibFly also offers a hosted MCP server, enabling any compatible AI client to access the ground-motion data without requiring a dedicated SDK.

0
ProgrammingDEV Community ·

Developer's 100-pass staging test still failed on first production run, exposing dry-run flaws

A software developer running AI agents on a solo project suffered a four-hour production rollback after a staging-to-production data inconsistency slipped through despite 100 successful dry-run tests. The core issue was environment drift — schema changes in the production database were not mirrored in staging — combined with the non-deterministic execution paths that AI agents can take. A secondary problem emerged when mock responses during dry-runs tricked the agent into treating skipped writes as completed, causing real metadata to be written to the database while the associated file upload was never actually performed. The developer's fix involved propagating a dry-run flag across an entire run session so that once any write is intercepted, all subsequent writes in that run are also held back. A further vulnerability was identified when hook failures caused agents to bypass dry-run controls entirely and write directly to production, highlighting the need for independent alerting on hook-level failures.

How developers handle HTTP Basic auth in WordPress maintenance tools using Playwright and urllib · ShortSingh