question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to exclude routes

See original GitHub issue

Let’s say I have some super secret endpoints (/admin/whatever), I’d like to be able to exclude them from the routes that are exposed via the generated JSON.

Maybe this can be achieved by adding a middleware, like how aaronlord/laroute does it.

As an extension of this, it’d be neat if I could use route groups to only expose certain routes to a “named” group, so I could use @routes('admin') in my blade file(s) to only expose routes in the admin group.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
mattstauffercommented, Aug 14, 2017

In case y’all weren’t thinking this, I’d consider using Laravel’s regex matcher that allows for shortcuts like “api.*”" – the thing that is sourced by “Str::is”

2reactions
DanielCoulbournecommented, Aug 11, 2017

@mikemand and @ctf0

Okay I have a compromise for you guys. I don’t like publishing a config file by default, but I don’t mind having an optional config file.

What if we publish all routes by default, then add support for optional config('ziggy.whitelist') and config('ziggy.blacklist') settings.

That way average users who don’t care won’t have to worry about black/white-listing routes, but if someone wants to do that, they have the option of just creating a config/ziggy.php file and adding one of those settings?

I’m thinking the setting could be an array of regular expressions, i.e. -

$whitelist = [
    /^auth./,         // matches for 'auth.login', 'auth.register' etc...
    /bank.vault/      // only matches the specified route.
];

This way it would be relatively simple to target entire route namespaces, or “any delete endpoint” or whatever.

How does that sit with y’all?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add ability to exclude routes · Issue #16 · tighten/ziggy - GitHub
Let's say I have some super secret endpoints ( /admin/whatever ), I'd like to be able to exclude them from the routes that...
Read more >
PM77489: ADD ABILITY TO EXCLUDE SPECIFIC SYSTEMS FROM ...
ROUTE command is used to start the AUIU address space on all systems in a sysplex. The AUIU address space requires certain datasets...
Read more >
ruby on rails - Add constraint to route to exclude certain keyword
I am using Rails and I want to use contraint in route to exclude that route if keyword "incident" is ...
Read more >
Add option to exclude admin routes [#3232306] | Drupal.org
Problem/Motivation It's already possible to exclude certain paths, but it would be useful to be able to exclude all admin paths with one...
Read more >
Is it possible to use "route ADD ... MASK ..." command to ...
Routing works based on the destination IP address, it doesn't care or even know which application is trying to reach it. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found