Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
Fix policy schema (#228)
Browse files Browse the repository at this point in the history
* Add new vault properties

* Update policy schema
  • Loading branch information
djenriquez authored Jan 2, 2018
1 parent 28e6378 commit 7ea0ea6
Showing 1 changed file with 106 additions and 44 deletions.
150 changes: 106 additions & 44 deletions app/components/Policies/vault-policy-schema.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,112 @@
{
"type": "object",
"required": [ "path" ],
"properties": {
"path": {
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^[^\/].*$": {
"type": "object",
"additionalProperties": false,
"anyOf": [
{
"required": [
"capabilities"
]
},
{
"required": [
"policy"
]
},
{
"optional": [
"required_parameters"
]
},
{
"optional": [
"allowed_parameters"
]
},
{
"optional": [
"denied_parameters"
]
}
],
"properties": {
"capabilities": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"create",
"read",
"update",
"delete",
"list",
"sudo",
"deny"
]
}
},
"required_parameters": {
"type": "array",
"minItems": 0,
"uniqueItems": true,
"items": {
"type": "string"
}
},
"allowed_parameters": {
"type": "object",
"minProperties": 0,
"additionalProperties": true,
"patternProperties": {
"^[^\/].*$": {
"type": "array",
"minItems": 0,
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
},
"denied_parameters": {
"type": "object",
"minProperties": 0,
"additionalProperties": true,
"patternProperties": {
"^[^\/].*$": {
"type": "object",
"additionalProperties": false,
"anyOf": [
{"required": ["capabilities"]},
{"required": ["policy"]}
],
"properties": {
"capabilities" : {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"create",
"read",
"update",
"delete",
"list",
"sudo",
"deny"
]
}
},
"policy" : {
"type": "string",
"enum": [
"read",
"write",
"sudo",
"deny"
]
}
}

"type": "array",
"minItems": 0,
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
},
"policy": {
"type": "string",
"enum": [
"read",
"write",
"sudo",
"deny"
]
}
}
}
}
}
}
}
}

0 comments on commit 7ea0ea6

Please sign in to comment.