Kevin Bond

Kevin Bond

@zenstruck.com

Open Source, #PHP, #Symfony Developer. Writer @SymfonyCasts.com, @Symfony.com Core Member. Author of https://github.com/zenstruck packages.

438 followers45 following28 posts

Kevin Bond reposted

πŸ” Symfony Security: Going Further #12 Want stronger passwords - and a way to reject any that have already leaked in a data breach? Symfony ships a constraint for each, and we'll bundle them into one reusable constraint of our own! symfonycasts.com/screencast/s...

Kevin Bond reposted

πŸ” Symfony Security: Going Further #9 Let's swap the built-in switch_user role for a custom attribute, let a voter make the call, & see how to check the permissions of any user - not just the one logged in. And, now our admins can't impersonate each other! symfonycasts.com/screencast/s...

Kevin Bond reposted

πŸ” Symfony Security: Going Further #7 After logging in, users should return to the page they were on, not the homepage! Let's use Symfony's _target_path to send them right back where they left off, making the login experience a little smoother! symfonycasts.com/screencast/s...

Kevin Bond reposted

πŸ” Symfony Security: Going Further #6 Need a super admin who can do (almost) anything? Let's build a custom voter that grants sweeping permissions across our app, while making sure important authentication checks still behave normally! symfonycasts.com/screencast/s...

Kevin Bond reposted

πŸ” Symfony Security: Going Further #5 Ever notice how GitHub asks you to confirm your password before sensitive actions? Let's build that same "sudo mode" in Symfony, requiring full authentication with a smooth password confirmation flow! symfonycasts.com/screencast/s...

Kevin Bond reposted

Symfony Cache Contracts have a sneaky little trick πŸ‘€ Use `beta: INF` to force-refresh a cached value without deleting the old one first - so other requests can keep using it while the fresh value is computed. See how it works πŸ‘‡ symfonycasts.com/blog/symfony...

symfonycasts.comForce Refresh a Symfony Cache Item with beta: INFSymfony's Cache Contracts have a mysterious third argument: "$beta". Here's where its name comes from, how it prevents cache stampedes, and how "beta: INF" lets you force a cache item to refresh…

Kevin Bond reposted

πŸš€ New on the blog: our ideal GitHub Actions setup for Symfony apps! Tests, linting, PHPStan, code style, database/schema checks, Symfony-aware diagnostics, asset compilation, plus a scheduled Composer security audit. A solid CI baseline you can actually build from: symfonycasts.com/blog/ideal-g...

symfonycasts.comIdeal GitHub Actions for Symfony AppsA practical, modern GitHub Actions setup for Symfony apps, covering tests, linting, static analysis, database checks, Symfony-aware diagnostics, and scheduled dependency security audits.

Kevin Bond reposted

πŸ” Symfony Security Basics #19 Let's finish by building a complete user registration flow! We'll generate the registration form, add validation, save our new user, log them in automatically, and finish with a discussion about user enumeration. symfonycasts.com/screencast/s...

Kevin Bond reposted

πŸ” Symfony Security Basics #17 Let's protect our login form from brute-force attacks! We'll enable Symfony's login throttling, see what happens when we trip the limiter, then dig into its configuration and how it works. Delightful nerdery!

symfonycasts.comLimiting Login AttemptsEnables Symfony login throttling to limit failed login attempts, explains the required RateLimiter dependency and cache-backed storage, and shows how the default per-IP/per-username and global IP limits...

Kevin Bond reposted

πŸ” Symfony Security Basics #16 User impersonation is super useful... until you forget you're impersonating someone! Let's make it painfully obvious when we're switched to another user and add an easy way to exit.

symfonycasts.comExiting Impersonation & IS_IMPERSONATORAdds a visible production indicator for Symfony user impersonation and provides a dedicated way to exit impersonation, including redirecting back to the admin user list afterward.

Kevin Bond reposted

πŸ” Symfony Security Basics #15 Need to debug a problem from a user's perspective? Let's enable Symfony's user impersonation feature so admins can temporarily switch to another user without ever knowing their password.

symfonycasts.comImpersonating Users with switch_userImpersonation with switch_user lets an admin temporarily log in as another user, and this chapter shows how to enable it in Symfony security, expose switch links in a user admin CRUD, and route the impersonated...

I’m really proud to be part of this one. @smnandre.dev had the brilliant idea to connect Playwright’s request interception directly to Symfony’s kernel - and I’m incredibly excited about what we’re building on top of it. Real browser. Real JS. Symfony kernel. 🀯

SymfonyCasts@symfonycasts.com

End-to-end tests with JS but no web server?! 🎭 Playwright-PHP + Symfony hands the request straight to your Symfony kernel - so you get container access, PHP exception catching, DAMA rollbacks and ParaTest. From a real browser. 🀯 symfonycasts.com/blog/playwri...

And this is the part that really changes things: Real JS browser tests can be fast, parallel, and still run inside your test process - which means things like DAMA transaction rollbacks still work. That makes adding another browser test feel cheap instead of expensive.

Kevin Bond reposted

Kevin Bond reposted

Kevin Bond reposted

Kevin Bond reposted

Kevin Bond reposted

Kevin Bond reposted

TailwindBundle 1.0 is here! :tada: Add Tailwind CSS to your Symfony + AssetMapper app, with no Node required. A huge thank you to everyone who contributed, reported issues, and helped us reach 1.0! Check out the release: github.com/SymfonyCasts...

github.comRelease v1.0.0 Β· SymfonyCasts/tailwind-bundleWhat's Changed Remove deprecation layer by @kbond in #130 Remind users to clear the cache after config changes by @kbond in #136 Authenticate the GitHub API call to avoid rate limiting by @Amoifr ...

Kevin Bond reposted

Kevin Bond reposted

πŸ” Symfony Security Basics #7 We're using session-based authentication, so let's take a peek behind the curtain to see how it works. Then we'll enable Symfony's "Remember Me" feature so users don't need to log in every time they reopen their browser.

symfonycasts.comEnabling "Remember Me" FeatureEnables Symfony’s β€œremember me” login persistence so users stay authenticated across browser sessions instead of being logged out when the session ends.

Kevin Bond reposted

Kevin Bond reposted

Upgrading to Symfony 8 #6 (Bonus) AI is changing security research, and that means more vulnerabilities are being found and fixed than ever before. Let's explore "composer audit", CVEs, and how to automate dependency security checks.

symfonycasts.comComposer Audit and Security UpdatesUses composer audit to find dependency vulnerabilities, interpret advisories/CVEs, temporarily ignore known risks in composer.json, apply fixed updates, and automate recurring security checks with GitHub...

Kevin Bond reposted

πŸ” Symfony Security Basics #5 Time to improve our user experience! We'll detect whether someone is logged in, show the appropriate login/logout links, and learn a handy trick for generating logout URLs. symfonycasts.com/screencast/s...

symfonycasts.comapp.user and Login/Logout LinksUses Symfony’s app.user variable and route-based login/logout links to show the current authentication state in templates and let users sign in or sign out cleanly

Kevin Bond reposted

πŸ” Symfony Security Basics #4 Hashing and encryption are very different things. We'll compare them, & see how Symfony automatically chooses the best password hashing algorithm and transparently upgrades your users as better algorithms become available.

symfonycasts.comUnderstanding Password HashingOk, we left off trying to login with a valid username and password, but it didn't work... Let's take a moment to understand why. Over in the terminal, dump our user table with: """terminal symfony console...

I've been thinking about this for years. Most Symfony best practices encourage code that's explicit and hard to misuse. Doctrine entities have always felt like a strange exception. There are reasons we do it this way... but I think ObjectMapper changes the equation.

SymfonyCasts@symfonycasts.com

πŸ€” Your #Doctrine entities are lying to you. Or at least... they might be. We've spent years making required properties nullable so entities can double as form models. #Symfony's new ObjectMapper component has me wondering if there's a better way. symfonycasts.com/blog/honest-...

Kevin Bond reposted

πŸ” Symfony Security Basics #3 Time to log in! We'll generate a login form with MakerBundle, see how Symfony's built-in form authenticator works, explore the generated code, and take a peek at the CSRF protection that's keeping us safe.

symfonycasts.comCreating a Login FormWe have our user provider configured and a user in our database. Now we need a way to log them in! There are several different ways to do this, but we'll focus on *session-based* authentication with an...

Kevin Bond reposted

πŸ” Symfony Security Basics #2 In order for users to log in, we need a user object and a user provider. Let’s build the most common implementation: a database-backed user/provider + a user factory to quickly spin them up in our dev & test environments.

symfonycasts.comCreating the User ClassThe first thing we need to actually authenticate someone is a special *user* class. This is a class that must implement "UserInterface" provided by Symfony

Kevin Bond reposted

🚨 New course 🚨 πŸ” Symfony Security Basics #1 Symfony Security is the gatekeeper of your application. We'll install the Security component, explore the default configuration, talk firewalls, & learn the difference between authentication & authorization.

symfonycasts.comInstalling the Security BundleHey Friends! Welcome to the Symfony Security course! In this tutorial, we're going to explore one of the most important parts of any web application: controlling who can access your site and what they're...

Thanks, #SymfonyDay Montreal! We had a great time at the @SymfonyCasts.com booth meeting members of the community and talking #Symfony. Also pictured: future #Symfony developers?! Maybe someday they'll finally get my 10-year-old Doctrine ORM PR merged. πŸ™ƒπŸ€ͺ🀞