英文:
Custom policy does not maintain previous values on properties array
问题
我正在按照这个文档创建自定义策略。
我创建了一个策略,它正常工作。策略的 JSON 模式如下所示:
{
"title": "ACME Custom Basic Auth Policy",
"description": "基本认证策略,根据自定义消费者凭据强制执行安全性",
"type": "object",
"properties": {
"users": {
"title": "用户",
"type": "array",
"items": {
"type": "object",
"required": [
"username",
"password"
],
"properties": {
"username": {
"title": "用户名",
"type": "string",
"default": []
},
"password": {
"title": "用户密码",
"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"
}
当我进入 API 管理器时,我可以在第一次尝试中配置这些值,但当我回去更改这些值时,它们不会出现。
这仅在我配置一个数组时发生。如果我将其配置为对象,它可以正常工作。我应该如何修复这个问题?
英文:
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.
This happens only when I configure an array. If I configure as an object, it works. How can I fix this?
答案1
得分: 0
他们解释当一个字段被声明为:
"characteristics": [
"security:sensitive"
]
在重新编辑策略时,不会提示值。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论