Skip to content

Commit

Permalink
feat(jans-cedarling): update test_files/README.md and some other smal…
Browse files Browse the repository at this point in the history
…l tweaks

Signed-off-by: John Anderson <[email protected]>
  • Loading branch information
djellemah committed Nov 4, 2024
1 parent e631845 commit 62240ff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
19 changes: 9 additions & 10 deletions jans-cedarling/test_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@ This folder contains policy store files used for unit testing purposes.

## Descriptions of json policy store test fixtures

These are required to have base64 encodings becaseu they're used in testing decoding of base64
These are required to have base64 encodings because they're used in testing decoding of base64

1. `policy-store_blobby.json`: fails because cedar-json appears to be unable to read policies in cedar-json format.
1. `policy-store_policy_err_base64.json`: contains broken base64 encoded policy.
1. `policy-store_policy_err_broken_utf8.json`: contains broken UTF8 policy base64 string.

policy-store_blobby.json
policy-store_ok.json
policy-store_readable.json
policy-store_schema_err_base64.json

1. `policy-store_ok.json`: This file contains a valid policy store.
- Human readable version of this file is available at the folder `policy-store_ok`.
1. `policy-store_readable.json`: Somewhat readable policies in json, as an example. Identical to `policy-store_readable.yaml`
1. `policy-store_schema_err_base64.json`: must be in json to test base64 decoding

## Descriptions of yaml policy store test fixtures

These are fully human-readable

1. `policy-store_ok.yaml`: The default "everything is fine" fixture - used in multiple tests.
1. `policy-store_ok_2.yaml`: Compared to previous - minimised fields in schema entities.
1. `policy-store_policy_err_broken_policy.yaml`: contains broken policy (should be error on compilation policy).
1. `policy-store_readable.yaml`: Similar to `policy-store_ok.yaml`, but no `Role` in schema. Identical to `policy-store_readable.json`.
1. `policy-store_schema_err_cedar_mistake.yaml`: contains broken cedar-policy schema (should be error on compilation).
1. `policy-store_schema_err_json.yaml`: contains broken json cedar-policy schema (should be error on reading json value).
1. `policy-store_schema_err.yaml`: contains broken json cedar-policy schema (should be error on reading json value).
1. `policy-store_with_trusted_issuers_ok.yaml`: list of trusted issues, seems to be newer current version of `policy-store_with_multiple_role_mappings_err.yaml`

## unused files
- policy-store_with_multiple_role_mappings_err.yaml
Expand Down
4 changes: 2 additions & 2 deletions jans-cedarling/test_files/policy-store_ok.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cedar_version: v2.4.7
cedar_policies:
840da5d85403f35ea76519ed1a18a33989f855bf1cf8:
description: simple policy example for pricipal workload
description: simple policy example for principal workload
creation_date: '2024-09-20T17:22:39.996050'
policy_content:
encoding: none
Expand All @@ -16,7 +16,7 @@ cedar_policies:
principal.org_id == resource.org_id
};
444da5d85403f35ea76519ed1a18a33989f855bf1cf8:
description: simple policy example for pricipal user
description: simple policy example for principal user
creation_date: '2024-09-20T17:22:39.996050'
policy_content:
encoding: none
Expand Down
2 changes: 1 addition & 1 deletion jans-cedarling/test_files/policy-store_ok_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cedar_schema:
encoding: none
content_type: cedar
# we minimize amount of field in entites to simplify test cases
body: |
body: |-
namespace Jans {
type Url = {"host": String, "path": String, "protocol": String};
entity TrustedIssuer = {"issuer_entity_id": Url};
Expand Down
2 changes: 1 addition & 1 deletion jans-cedarling/test_files/policy-store_readable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cedar_policies:
cedar_schema:
encoding: none
content_type: cedar
body: |
body: |-
namespace Jans {
type Url = {"host": String, "path": String, "protocol": String};
entity Access_token = {"aud": String, "exp": Long, "iat": Long, "iss": TrustedIssuer, "jti": String};
Expand Down

0 comments on commit 62240ff

Please sign in to comment.