Skip to content

use signed URL by default #40

Closed
Closed
@Gummibeer

Description

@Gummibeer
Contributor

For API driven Apps the current authentication/authorization middleware doesn't work because the link in email can't provide a Bearer token. But the links still shouldn't be fully public.
A nice and easy solution would be a temporary signed URL.

// mail.blade.php
\Illuminate\Support\Facades\URL::temporarySignedRoute('personal-data-exports', $deletionDatetime, ['zipFilename' => $zipFilename]);

// PersonalDataExportServiceProvider
Route::get("$url/{zipFilename}", [PersonalDataExportController::class, 'export'])
    ->middleware('signed')
    ->name('personal-data-exports');

This way there isn't any need for a session/cookie anymore and the export is still protected.

Activity

freekmurze

freekmurze commented on Aug 6, 2020

@freekmurze
Member

That's a nice idea, I'd accept a PR for this!

Gummibeer

Gummibeer commented on Aug 6, 2020

@Gummibeer
ContributorAuthor

PR incoming.

freekmurze

freekmurze commented on Aug 6, 2020

@freekmurze
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @freekmurze@Gummibeer

      Issue actions

        use signed URL by default · Issue #40 · spatie/laravel-personal-data-export