Skip to content

[HttpFoundation] #[VerifySignature] attribute #60189

@kbond

Description

@kbond

Description

The ability to add a #[VerifySignature] above a controller to automatically verify it's signature before executing.

Example

#[VerifySignature] // default behaviour (400/404?)
public function someAction(): Response

#[VerifySignature(statusCode: 401)] // customize the status code
public function someAction(): Response

With #60102, the following behaviour could be added:

#[VerifySignature(throw: true)]
public function someAction(): Response

This would throw a UnsignedUriException|UnverifiedSignedUriException|ExpiredSignedUriException to be caught/handled by an exception listener or converted with framework.exceptions:

framework:
    exceptions:
        Symfony\Component\HttpFoundation\Exception\UnsignedUriException:
            status_code: 404
        Symfony\Component\HttpFoundation\Exception\UnverifiedSignedUriException:
            status_code: 400
        Symfony\Component\HttpFoundation\Exception\ExpiredSignedUriException:
            status_code: 410

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy