Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpFoundation] #[VerifySignature] attribute #60189

Copy link
Copy link
Open
@kbond

Description

@kbond
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.