-
-
Notifications
You must be signed in to change notification settings - Fork 5
Feature: Indicate default endpoints for authorization #82
Comments
That's a really nice idea. I had something similar in mind for endpoints that require authentication, but never thought of authorization. Maybe the gutter icon could have a little 🔒 in the lower right corner. The implementation might require lots of effort. At the moment the plugin receives its information by running |
Originally I was only going only for a marking based on method name, but it seems like it's actually not that difficult, the middleware appears in the JSON output: {
"domain": "demo.test",
"method": "GET|HEAD",
"uri": "ajax/cis/create",
"name": "ajax.cis.create",
"action": "App\\Http\\Controllers\\Ajax\\CiAjaxController@create",
"middleware": [
"web",
"backend",
"auth",
"can:create,App\\Models\\Ci" // <-- here
]
} |
That's very good news and simplifies the implementation a lot! I think a "proper" would also check that the For the logo I think it would be reasonable to replace the globe in the existing icon with a lock (e.g. search for "lock" on the JetBrains Icons List). Not sure how to differentiate authorization and authentication here (maybe only one applies, but as in your example, both could be required). Since the endpoint is also "connected" to a specific policy method, the plugin could maybe add it to the "related symbol" list, which might ease navigation. But I am not 100% sure how to do that or if this API is publicly accessible. |
Assuming that |
We've started to use Laravel's controller-based authorization via the authorizeResource method. This protects the default endpoint methods via the Laravel authorization system. Since this plugin indicates route endpoints via a gutter icon it would be great if there was a visual distiction between these default endpoints (Reference:
AuthorizesRequests::resourceAbilityMap
) and other custom endpoints that (possibly) need authorization handled manually (to remind the developer to implement that if required).The text was updated successfully, but these errors were encountered: