0

I am creating a custom policy following this documentation.

I created one, and it is working. The JSON schema for the policy is shown below:

{
    "title": "ACME Custom Basic Auth Policy",
    "description": "Basic Authentication policy which enforces security according with custom consumer credentials",
    "type": "object",
    "properties": {
        "users": {
            "title": "users",
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "username",
                    "password"
                ],
                "properties": {
                    "username": {
                        "title": "User Name",
                        "type": "string",
                        "default": []
                    },
                    "password": {
                        "title": "User Password",
                        "type": "string",
                        "@context": {
                            "@characteristics": [
                                "security:sensitive"
                            ]
                        }
                    }
                }
            },
            "minItems": 1
        }
    },
    "@context": {
        "@vocab": "anypoint://vocabulary/policy.yaml#",
        "security": "anypoint://vocabulary/policy.yaml#"
    },
    "$id": "allow-dynamic-resources",
    "$schema": "https://json-schema.org/draft/2019-09/schema"
}

When I go to API Manager, I can configure the values on first attempt, but when I go back to change the values, they do not appear.

enter image description here

This happens only when I configure an array. If I configure as an object, it works. How can I fix this?

enter image description here

mhery
  • 2,097
  • 4
  • 26
  • 35
  • When you say the values do not appear, I assume that you are talking in the UI? This seems to be one of the few cases where a few screenshots would be appropriate to clarify the issue. – aled Feb 08 '23 at 22:13
  • @aled, I've just edited the post with screenshots – mhery Feb 09 '23 at 10:35

1 Answers1

0

I opened a support ticket for MuleSoft and they explained when a field is declared with

"@characteristics": [
    "security:sensitive"
]

the values are not prompted when reediting policy.

mhery
  • 2,097
  • 4
  • 26
  • 35