SShortSingh.
Back to feed

Node.js Avatar Uploads to S3-Compatible Storage: Metadata, Retention and Private Links

0
·3 views

The article argues that avatars should be stored as private objects, with their generated keys and metadata recorded in a database, and accessed through short-lived signed URLs only when needed. Node.js handles authentication, file validation, key generation and the database transaction, while the storage service holds the image bytes. It recommends checking the decoded file type rather than trusting the Content-Type header, enforcing a byte limit before reading the request body, and treating the size limit and deletion schedule as separate controls. The piece includes sample TypeScript code for saving an avatar and notes that an idempotent replacement path and a cleanup strategy for failed inserts are needed. It concludes with a brief example of a REST-based upload request.

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
ProgrammingHacker News ·

Outlook.com Reportedly Rejecting Email From Domains Lacking DMARC

A blog post from MailRoute reports that Outlook.com is rejecting messages from domains that do not have DMARC configured. The behavior is described as occurring quietly, without prominent notice to senders. DMARC is an email authentication standard that helps verify a sender's identity and guards against spoofing. The item was shared on Hacker News, where it drew modest attention with 20 points and 12 comments. The details available here come from a secondary source and the linked article, so the scope of the change is not independently confirmed.

0
ProgrammingDEV Community ·

Claude Code 'Don't Ask Again' feature linked to passwords exposed in 1,122 public GitHub files

A report highlighted that Claude Code's 'Don't Ask Again' feature, intended to remember user preferences and reduce repetitive prompts, was associated with sensitive credentials appearing in 1,122 public GitHub files. The article frames the issue as a security lapse arising from prioritizing convenience over protection. The author draws on a personal experience of accidentally publishing API keys to illustrate the risk. Recommended safeguards include storing secrets in environment variables, conducting code reviews, and using GitHub Secrets to keep sensitive data out of repositories. The piece emphasizes that developers should remain vigilant about what they publish.

0
ProgrammingDEV Community ·

NVKE: Open Source Tool for Running Managed GPU Kubernetes Clusters on Your Own Hardware

NVIDIA Kubernetes Engine (NVKE) is an open source, Apache-2.0 licensed project that lets platform teams create and operate isolated Kubernetes clusters on bare-metal GPU servers they own. It runs as a management plane on the hardware and provisions machines through NVIDIA Infra Controller, with each workload cluster getting its own control plane, etcd and node pools. Users interact with their clusters using standard kubectl, without needing to know NVKE exists. The project is currently in preview, its APIs may change between releases, and it is not recommended for production workloads. It is aimed mainly at organizations building internal Kubernetes-as-a-service offerings on GPU infrastructure.