Skip to content

Latest commit

 

History

History
107 lines (87 loc) · 2.63 KB

debug.md

File metadata and controls

107 lines (87 loc) · 2.63 KB

Features to Debug

Table of Contents

Get policy cache

  • Only accepts HTTP GET request
  • The endpoint is /debug/cache/policy
  • Response body contains below information in JSON format.
  • It will expose the entire policy cache to the client.

Configuration

Example configuration for debug policy cache interface:

version: v2.0.0
server:
  debug:
    enable: true
    port: 6083
    dump: true
...

The example configuration file is here. For more information, please refer to config.go.

Example:

curl -X GET http://127.0.0.1:6083/debug/cache/policy

Output:

{
    "domain1:role.role1":  [
        {
           "resource_domain": "resource_domain1",
            "effect": null,
            "action": "action_name1",
            "resource": "resource_name1",
            "action_regexp_string": "^action_name1$",
            "resource_regexp_string": "^resource_name1$"
        },
        {
           "resource_domain": "resource_domain2",
            "effect": null,
            "action": "*",
            "resource": "*",
            "action_regexp_string": "^.*$",
            "resource_regexp_string": "^.*$"
        },
    ],
    "domain2:role.role2":  [
        {
           "resource_domain": "resource_domain3",
            "effect": null,
            "action": "action_name3",
            "resource": "resource_name3",
            "action_regexp_string": "^action_name3$",
            "resource_regexp_string": "^resource_name3$"
        },
    ]
}

Profiling

  • Only accepts HTTP GET request
  • The endpoint is /debug/pprof
  • User can access this endpoint though web browser.

Configuration

Example configuration for profiling interface:

version: v2.0.0
server:
  debug:
    enable: true
    port: 6083
    profiling: true
...

The example configuration file is here. For more information, please refer to config.go.