Skip to main content

6 posts tagged with "security"

View All Tags

Wait, You're Exposing Your Password?! Understanding Input vs Output DTOs in Spring Boot

· 14 min read
Mahmut Salman
Software Developer

I'll never forget the day I accidentally exposed user passwords in my API responses. I returned the entire User entity from a GET endpoint, thinking "Spring Boot will handle it!" Spoiler alert: It returned EVERYTHING—including hashed passwords, internal IDs, and timestamps. My code reviewer nearly had a heart attack. 😱 That's when I learned about DTOs. Let me save you from this nightmare.

My 'Aha!' Moment: Why Public/Private Actually Matters (And I Was Wrong About Security)

· 14 min read
Mahmut Salman
Software Developer

"Why make something private? Just make everything public. If the coder knows which method to call, they call it. Problem solved, right?" That was me a week ago. I was so wrong. Here's my journey from "public/private is just fancy nonsense" to "holy crap, this actually makes sense!" 🤯

Dev vs Prod: Why You Can't Store Secrets in Files on Production Servers

· 9 min read
Mahmut Salman
Software Developer

"Why do we use application.properties for secrets in development but environment variables in production?" Because file-based secrets are fine for your local machine (only you have access), but dangerous on production servers (many people have access, files can be compromised). Let's understand why this distinction matters and how to properly manage secrets across environments.

Is It Safe to Send Passwords in Login Requests? HTTP vs HTTPS Security

· 14 min read
Mahmut Salman
Software Developer

"Is it safe to add password in LoginRequest? Can someone reach the user's request?" Great security question! The answer depends entirely on whether you're using HTTP or HTTPS. With HTTP, anyone on the network can see your password in plain text. With HTTPS, it's encrypted end-to-end. Let's understand the difference and how to secure your login.

Why Spring Security Locks All Endpoints Just By Adding the Dependency

· 8 min read
Mahmut Salman
Software Developer

"I just added spring-boot-starter-security to my pom.xml and now ALL my endpoints return 401 Unauthorized! I didn't write any security code - why is this happening?" This is Spring Security's "secure by default" philosophy at work. Let's understand why this design choice makes sense and how to configure it.