sensiolabs / GotenbergBundle

A Symfony Bundle for interacting with Gotenberg. Integrates natively with twig, router, PHPStorm and more !
MIT License
35 stars 9 forks source link

Forward cookie from request #35

Open Jean-Beru opened 6 months ago

Jean-Beru commented 6 months ago

Add a forwardCookie(string $name) that would fetch a cookie from the request and send it to Gotenberg.

It could be useful to authenticate Gotenberg when it tries to access to an URL.

_Originally posted by @Neirda24 in https://github.com/sensiolabs/GotenbergBundle/pull/33#discussion_r1565828062_

Neirda24 commented 5 months ago

I'd go even further. A ->forwardAuthenticatedUser() + ->asUser(UserInterface $user) WDYT ?

Jean-Beru commented 5 months ago

->forwardAuthenticatedUser() => ->forwardAuthentication() ?

Is ->asUser(UserInterface $user) needed ? I an user doesn't have access to a resource, it may not be allowed to generate the same resource in PDF.

Neirda24 commented 5 months ago

If you generate from a CLI you'll need this.

Jean-Beru commented 5 months ago

If you generate from a CLI you'll need this.

Indeed