Urgent.News

What's breaking now, across thousands of outlets.

Tech

Per-User Logins and an Audit Trail in Supabase: Auth, RLS and Triggers, a Tamper Drill, and a Small Support Portal

If your team shares one login, an audit log can't tell you who did what. I wanted to see that for myself, then build the fix with Supabase Auth, RLS and database triggers, and try to break it. Everything is from my run on 2026-10-27 on a Free project. Prices change, so every number is dated. How this was made: I wrote this with Claude's help: it drafted, and I ran every step, edited the text, and…

When sharing a single login, an audit log cannot differentiate between individual users. This made the author realize the need to build an audit trail using Supabase Auth, Row Level Security (RLS) and database triggers, and attempt to break it for testing purposes. All actions were performed on a Free project on 2026-10-27, and prices were subject to change.

The system consists of two tables - support_requests (the work) and activity_log (who did what). The trigger writes the log, not the page, as the code in the page can be skipped, edited, or forged. The actor's identity comes from the login, using the auth.uid() and auth.jwt() functions, and the email inside the trigger.

To ensure tamper-proofing, the log is read-only for the API, with no insert, update or delete policies. The client cannot claim to be someone else, and the who and when are stamped on the row itself. The function `public.stamp_request()` is a security definer, which runs with the owner's rights, allowing it to write even when the caller cannot. The audit log is secured by revoking insert, update, and delete privileges on the `public.activity_log` table from the 'anon' and 'authenticated' roles.

The author created three fictional demo users, Case A with a shared login (shared-desk) used by two real people, and Case B with each person using their own login. When a shared-login scenario was tested, the audit log showed only the shared-desk@example.com email address for both users. In the case of individual logins, the activity log accurately recorded each user's actions - sato added the request, tanaka moved it to in progress, and sato marked it done.

The log cannot be tampered with as the changes are recorded with who and when they occurred. The author tried to tamper with the log as staff-sato, but all attempts were unsuccessful, resulting in 403 errors. Accessing requests without signing in was allowed, while adding a request without signing in resulted in a 401 error. The author suggests treating error hints as suggestions to check against their intent, not as commands.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to Turn Vertical Photos into WhatsApp Stickers (512 512 WebP, Under 100 KB)

Every phone gallery is full of tall photos — your cat mid-yawn, a birthday cake, a friend pulling a face. WhatsApp stickers are square.

  • WhatsApp stickers must be 512x512 pixels and WebP format under 100KB
  • Crop or pad portrait photos to fit 512x512 canvas without losing subject
  • Adjust WebP quality from 90 to 30 to achieve desired file size

Turning an Old Gaming Laptop into a Home Lab

I work in security evaluation, which mostly means looking at systems from the outside and checking whether they do what they say.

  • Author repurposes old Dell G7 7588 gaming laptop as home lab.
  • Installs Proxmox VE 9.2 hypervisor, allocates storage for guests.
  • Runs Debian 13 container as unprivileged LXC for security learning.

Building a photo-to-video window scene without a prompt box

I have been building a small photo-to-video product called Burger Window AI. The whole product is one scene: upload a bright, front-facing photo of a person or a pet, and it returns a vertical clip of…

  • Burger Window AI generates 12-second video clips of subjects in night window setting.
  • Users upload single photo, no prompts needed for lighting, angles, timing.
  • Clip features mid-bite freeze, direct stare, and curtain closing for short-form feeds.

Statement date vs due date: I built a tiny free planner because my own cards confused me

Most of us with two or more credit cards know the feeling: a banking app shows a "statement balance", an email mentions a "due date", and the reminder you set in your phone's calendar is three weeks…

  • Statement date marks when bank tallies charges for billing cycle
  • Due date typically 2-3 weeks after statement date
  • Tiny free planner organizes card due dates and payments

More from Friday 30 October →