PaloAltoNetworks / PaloAltoNetworks/pan.dev

[CWPP] Mark `/current/role` endpoint as supported

Open
#557 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
MDX
Stars
78
Forks
88
Avg merge
5d 17h
Merged PRs (30d)
18

Description

Is your feature request related to a problem?

Looking the documentation on pan.dev, I notice there is no endpoint to get precises permissions of the current user (using the API).
However the openapi file available in the web interface contains a lot of endpoint.
But as described in pan.dev cwpp documentation about endpoints: « In the OpenAPI spec, supported endpoints are tagged as supported ».
I notice /current/role is not tag as it, but only with :

tags:
   - Current
Describe the solution you'd like

I like to be sure this endpoint is marked as supported, since the functionality is really useful and pretty straight forward.

Describe alternatives you've considered

Currently I'm requesting directly endpoints (/hosts, /images, whatever), and handle HTTP error and/or JSON error message.

Additional context

Using the API, i'm trying to check if the current permissions are enough to perform future operations. Currently i'm trying to access directory the required endpoint, if the current profile doesn't have the right to do so, i handle using the HTTP error and/or json error message.

However using the alternative, to generate a nice message with explains what specific permission is missing is like playing try & error. We need to try all endpoints in order to check actual permissions...

However using one request (targeting /current/role), we can check the required permissions and avoid useless requests. Moreover we can nicely return what permissions is missing..

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OpenAPI definition for the /current/role endpoint and the supported-endpoint documentation linked in the issue. Mark the endpoint as supported in the OpenAPI tags, then verify that the generated or published CWPP documentation lists it among the supported endpoints.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.