Skip to content

Commit

Permalink
test(jans-cedarling): fix python unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Bohzok <[email protected]>
  • Loading branch information
olehbozhok committed Oct 29, 2024
1 parent 58febd3 commit 334f5a9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"8b805e22fdd39f3dd33a13d9fb446d8e6314153ca997": {
"name": "gluustore",
"description": "gluu",
"policies": {
"840da5d85403f35ea76519ed1a18a33989f855bf1cf8": {
"description": "simple policy example for principal workload",
"creation_date": "2024-09-20T17:22:39.996050",
"policy_content": "cGVybWl0KAogICAgcHJpbmNpcGFsIGlzIEphbnM6Oldvcmtsb2FkLAogICAgYWN0aW9uIGluIFtKYW5zOjpBY3Rpb246OiJVcGRhdGUiXSwKICAgIHJlc291cmNlIGlzIEphbnM6Oklzc3VlCil3aGVuewogICAgcHJpbmNpcGFsLm9yZ19pZCA9PSByZXNvdXJjZS5vcmdfaWQKfTs="
},
"444da5d85403f35ea76519ed1a18a33989f855bf1cf8": {
"description": "simple policy example for principal user",
"creation_date": "2024-09-20T17:22:39.996050",
"policy_content": "cGVybWl0KAogICAgcHJpbmNpcGFsIGlzIEphbnM6OlVzZXIsCiAgICBhY3Rpb24gaW4gW0phbnM6OkFjdGlvbjo6IlVwZGF0ZSJdLAogICAgcmVzb3VyY2UgaXMgSmFuczo6SXNzdWUKKXdoZW57CiAgICBwcmluY2lwYWwuY291bnRyeSA9PSByZXNvdXJjZS5jb3VudHJ5Cn07"
}
"cedar_version": "v2.4.7",
"cedar_policies": {
"840da5d85403f35ea76519ed1a18a33989f855bf1cf8": {
"description": "simple policy example for principal workload",
"creation_date": "2024-09-20T17:22:39.996050",
"policy_content": "cGVybWl0KAogICAgcHJpbmNpcGFsIGlzIEphbnM6Oldvcmtsb2FkLAogICAgYWN0aW9uIGluIFtKYW5zOjpBY3Rpb246OiJVcGRhdGUiXSwKICAgIHJlc291cmNlIG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RlZElzc3VlciJ9LCJqdGkiOnsidHlwZSI6IkVudGl0eU9yQ29tbW9uIiwibmFtZSI6IlN0cmluZyJ9LCJzdWIiOnsidHlwZSI6IkVudGl0eU9yQ29tbW9uIiwibmFtZSI6IlN0cmluZyJ9fX19LCJUcnVzdGVkSXNzdWVyIjp7InNoYXBlIjp7InR5cGUiOiJSZWNvcmQiLCJhdHRyaWJ1dGVzIjp7Imlzc3Vlcl9lbnRpdHlfaWQiOnsidHlwZSI6IkVudGl0eU9yQ29tbW9uIiwibmFtZSI6IlVybCJ9fX19fSwiYWN0aW9ucyI6eyJVcGRhdGUiOnsiYXBwbGllc1RvIjp7InJlc291cmNlVHlwZXMiOlsiSXNzdWUiXSwicHJpbmNpcGFsVHlwZXMiOlsiV29ya2xvYWQiLCJVc2VyIl19fX19fQo="
}
"444da5d85403f35ea76519ed1a18a33989f855bf1cf8": {
"description": "simple policy example for principal user",
"creation_date": "2024-09-20T17:22:39.996050",
"policy_content": "cGVybWl0KAogICAgcHJpbmNpcGFsIGlzIEphbnM6OlVzZXIsCiAgICBhY3Rpb24gaW4gW0phbnM6OkFjdGlvbjo6IlVwZGF0ZSJdLAogICAgcmVzb3VyY2UgaXMgSmFuczo6SXNzdWUKKXdoZW57CiAgICBwcmluY2lwYWwuY291bnRyeSA9PSByZXNvdXJjZS5jb3VudHJ5Cn07"
}
},
"cedar_schema": "eyJKYW5zIjp7ImNvbW1vblR5cGVzIjp7IlVybCI6eyJ0eXBlIjoiUmVjb3JkIiwiYXR0cmlidXRlcyI6eyJob3N0Ijp7InR5cGUiOiJFbnRpdHlPckNvbW1vbiIsIm5hbWUiOiJTdHJpbmcifSwicGF0aCI6eyJ0eXBlIjoiRW50aXR5T3JDb21tb24iLCJuYW1lIjoiU3RyaW5nIn0sInByb3RvY29sIjp7InR5cGUiOiJFbnRpdHlPckNvbW1vbiIsIm5hbWUiOiJTdHJpbmcifX19fSwiZW50aXR5VHlwZXMiOnsiV29ya2xvYWQiOnsic2hhcG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2VyIl19fX19fQo="
}
2 changes: 1 addition & 1 deletion jans-cedarling/bindings/cedarling_python/tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def sample_bootstrap_config():
policy_source = PolicyStoreSource(json=policy_raw_json)

policy_store_config = PolicyStoreConfig(
source=policy_source, store_id=None)
source=policy_source)

jwt_config = JwtConfig(enabled=False)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
("policy-store_policy_err_broken_utf8.json",
"unable to decode policy_content to utf8 string"),
("policy-store_policy_err_broken_policy.json",
'unable to decode policy with id: 840da5d85403f35ea76519ed1a18a33989f855bf1cf8, error: unable to decode policy_content from human readable format: unexpected token `)` at line 15 column 1'),
"unable to decode policy with id: 840da5d85403f35ea76519ed1a18a33989f855bf1cf8, error: unable to decode policy_content from human readable format: unexpected token `)`"),
# cases with schema errors
("policy-store_schema_err_base64.json",
"unable to decode cedar policy schema base64"),
("policy-store_schema_err_json.json",
"unable to unmarshal cedar policy schema json to the structure"),
("policy-store_schema_err_cedar_mistake.json",
"Could not load policy: unable to parse cedar policy schema json: failed to resolve type: User_TypeNotExist at line 35 column 1"),
"Could not load policy: failed to parse the policy store from `policy_store.json`: unable to parse cedar policy schema json: failed to resolve type: User_TypeNotExist at line 32 column 1"),
]


Expand Down

0 comments on commit 334f5a9

Please sign in to comment.