Skip to content

Commit

Permalink
Issue #59, Updated docs to 0.7, updated some more JSON policies
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Hunt <phil.hunt@independentid.com>
  • Loading branch information
independentid committed Sep 11, 2024
1 parent 98e6253 commit 487d3b1
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 332 deletions.
2 changes: 1 addition & 1 deletion cmd/hexa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/hexa-org/policy-mapper/sdk"
)

const Version string = "0.6.13"
const Version string = "0.7.0"

type ParserData struct {
parser *kong.Kong
Expand Down
138 changes: 49 additions & 89 deletions docs/Developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Policies retrieved for shK:
"policies": [
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "STATIC",
"principal": null,
Expand All @@ -137,35 +137,22 @@ Policies retrieved for shK:
"PapId": "K21RFtX...A93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"Subjects": [
"any"
]
},
,
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::ReadAccount"
},
{
"ActionUri": "cedar:hexa_avp::Action::Transfer"
},
{
"ActionUri": "cedar:hexa_avp::Action::Deposit"
},
{
"ActionUri": "cedar:hexa_avp::Action::Withdrawl"
},
{
"ActionUri": "cedar:hexa_avp::Action::UpdateAccount"
}
"cedar:hexa_avp::Action::ReadAccount",
"cedar:hexa_avp::Action::Transfer",
"cedar:hexa_avp::Action::Deposit",
"cedar:hexa_avp::Action::Withdrawl",
"cedar:hexa_avp::Action::UpdateAccount"
],
"Object": {
"resource_id": ""
}
"Object": ""
},
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "TEMPLATE_LINKED",
"principal": {
Expand All @@ -185,19 +172,14 @@ Policies retrieved for shK:
"PapId": "K21RFtX...A93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"Subjects": [
"?principal"
]
},
,
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::ReadAccount"
}
"cedar:hexa_avp::Action::ReadAccount"
],
"Object": {
"resource_id": "cedar:?resource"
}
"Object": "cedar:?resource"
}
],
"app": "K21RFtX...A93DH7z5"
Expand Down Expand Up @@ -270,47 +252,37 @@ Ignoring AVP policyid UaN2xdjgv1Dhdpuoa3ebRU. Template updates not currently sup
0: DIF: UPDATE [ACTION]
{
"Meta": {
"Version": "0.6",
"SourceData": {
"policyType": "STATIC",
"principal": null,
"resource": null
},
"Description": "Hexa demo canary policy",
"Created": "2023-12-26T21:45:53.558204Z",
"Modified": "2023-12-27T22:20:18.592795Z",
"Etag": "20-f2ec1edc53e44c07e4d790d8936ade24b27f04eb",
"PolicyId": "KDqUKMRNEg6aEjZ6mz9dJq",
"PapId": "K21...93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"any"
]
},
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::ReadAccount"
},
{
"ActionUri": "cedar:hexa_avp::Action::Transfer"
},
{
"ActionUri": "cedar:hexa_avp::Action::Deposit"
{
"Meta": {
"Version": "0.7",
"SourceData": {
"policyType": "STATIC",
"principal": null,
"resource": null
},
"Description": "Hexa demo canary policy",
"Created": "2023-12-26T21:45:53.558204Z",
"Modified": "2023-12-27T22:20:18.592795Z",
"Etag": "20-f2ec1edc53e44c07e4d790d8936ade24b27f04eb",
"PolicyId": "KDqUKMRNEg6aEjZ6mz9dJq",
"PapId": "K21...93DH7z5",
"ProviderType": "avp"
},
{
"ActionUri": "cedar:hexa_avp::Action::Withdrawl"
}
],
"Object": {
"resource_id": ""
}
"Subjects": [
"any"
],
"Actions": [
"cedar:hexa_avp::Action::ReadAccount",
"cedar:hexa_avp::Action::Transfer",
"cedar:hexa_avp::Action::Deposit",
"cedar:hexa_avp::Action::Withdrawl"
],
"Object": ""
}
1: DIF: UNSUPPORTED
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "TEMPLATE_LINKED",
"principal": {
Expand All @@ -330,19 +302,13 @@ Ignoring AVP policyid UaN2xdjgv1Dhdpuoa3ebRU. Template updates not currently sup
"PapId": "K21...93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"Subjects": [
"?principal"
]
},
],
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::ReadAccount"
}
"cedar:hexa_avp::Action::ReadAccount"
],
"Object": {
"resource_id": "cedar:?resource"
}
"Object": "cedar:?resource"
}

Applying 2 policies to rKO
Expand Down Expand Up @@ -405,21 +371,15 @@ or an attribute "policies" which is assigned an array of policies. For example:
"policies": [
{
"Meta": {
"Version": "0.6"
"Version": "0.7"
},
"Actions": [
{
"ActionUri": "cedar:Action::view"
}
"cedar:Action::view"
],
"Subject": {
"Members": [
"Subjects": [
"User:\"alice\""
]
},
"Object": {
"resource_id": "cedar:Photo::VacationPhoto94.jpg"
}
],
"Object": "cedar:Photo::VacationPhoto94.jpg"
}
]
}
Expand Down
46 changes: 14 additions & 32 deletions docs/HexaAdmin.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Policies retrieved for rKO:
"policies": [
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "STATIC",
"principal": null,
Expand Down Expand Up @@ -104,7 +104,7 @@ Ignoring AVP policyid UaN2xdjgv1Dhdpuoa3ebRU. Template updates not currently sup
0: DIF: UPDATE [ACTION]
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "STATIC",
"principal": null,
Expand All @@ -118,33 +118,21 @@ Ignoring AVP policyid UaN2xdjgv1Dhdpuoa3ebRU. Template updates not currently sup
"PapId": "K21...93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"Subjects": [
"any"
]
},
],
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::\"ReadAccount\""
},
{
"ActionUri": "cedar:hexa_avp::Action::\"Transfer\""
},
{
"ActionUri": "cedar:hexa_avp::Action::\"Deposit\""
},
{
"ActionUri": "cedar:hexa_avp::Action::\"Withdrawl\""
}
"cedar:hexa_avp::Action::\"ReadAccount\"",
"cedar:hexa_avp::Action::\"Transfer\"",
"cedar:hexa_avp::Action::\"Deposit\"",
"cedar:hexa_avp::Action::\"Withdrawl\""
],
"Object": {
"resource_id": ""
}
"Object": ""
}
1: DIF: UNSUPPORTED
{
"Meta": {
"Version": "0.6",
"Version": "0.7",
"SourceData": {
"policyType": "TEMPLATE_LINKED",
"principal": {
Expand All @@ -164,19 +152,13 @@ Ignoring AVP policyid UaN2xdjgv1Dhdpuoa3ebRU. Template updates not currently sup
"PapId": "K21...93DH7z5",
"ProviderType": "avp"
},
"Subject": {
"Members": [
"Subjects": [
"?principal"
]
},
],
"Actions": [
{
"ActionUri": "cedar:hexa_avp::Action::\"ReadAccount\""
}
"cedar:hexa_avp::Action::\"ReadAccount\""
],
"Object": {
"resource_id": "cedar:?resource"
}
"Object": "cedar:?resource"
}

Applying 2 policies to rKO
Expand Down
Loading

0 comments on commit 487d3b1

Please sign in to comment.