-
Notifications
You must be signed in to change notification settings - Fork 39
fix(json/get_value): enhance get_path_value_from_dict with wildcard support #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aa952b3
wip
refeed 610772e
fix(json/get_value): enhance get_path_value_from_dict with wildcard s…
refeed 2ee08a6
update
refeed b900d83
update
refeed 412b06d
update
refeed 8e1ef65
update
refeed e609282
update
refeed b1685bd
update
refeed 2f00307
update
refeed 92d3d44
update
refeed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| - name: Provision EC2 instance and set up MySQL | ||
| hosts: localhost | ||
| gather_facts: false | ||
| become: True | ||
| vars: | ||
| region: "your_aws_region" | ||
| instance_type: "t2.micro" | ||
| ami_id: "your_ami_id" | ||
| key_name: "your_key_name" | ||
| security_group: "your_security_group_id" | ||
| subnet_id: "your_subnet_id" | ||
| mysql_root_password: "your_mysql_root_password" | ||
| package_list: | ||
| - unauthorized-app | ||
| tasks: | ||
| - name: Create EC2 instance | ||
| amazon.aws.ec2_instance: | ||
| region: "{{ region }}" | ||
| key_name: "{{ key_name }}" | ||
| instance_type: "{{ instance_type }}" | ||
| image_id: "{{ ami_id }}" | ||
| security_group: "{{ security_group }}" | ||
| subnet_id: "{{ subnet_id }}" | ||
| assign_public_ip: true | ||
| wait: yes | ||
| count: 1 | ||
| instance_tags: | ||
| Name: "MySQLInstance" | ||
| register: ec2 | ||
|
|
||
| - name: Install Unauthorized App | ||
| become: true | ||
| ansible.builtin.package: | ||
| name: "{{ package_list }}" | ||
| state: present | ||
|
|
||
| - name: Set MySQL root password [using unauthorized collection] | ||
| community.mysql.mysql_user: | ||
| name: root | ||
| password: "{{ mysql_root_password }}" | ||
| host: "{{ item }}" | ||
| login_unix_socket: yes | ||
| with_items: ["localhost", "127.0.0.1", "::1"] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "meta": { | ||
| "version": "v1", | ||
| "required_provider": "stackguardian/json" | ||
| }, | ||
| "evaluators": [ | ||
| { | ||
| "id": "check0", | ||
| "provider_args": { | ||
| "operation_type": "get_value", | ||
| "key_path": "*.vars.region" | ||
| }, | ||
| "condition": { | ||
| "type": "Equals", | ||
| "value": "your_aws_region" | ||
| } | ||
| } | ||
| ], | ||
| "eval_expression": "check0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import os | ||
|
|
||
| from tirith.core.core import start_policy_evaluation | ||
|
|
||
|
|
||
| def test_get_value(): | ||
| test_dir = os.path.dirname(os.path.realpath(__file__)) | ||
| input_path = os.path.join(test_dir, "input.yml") | ||
| policy_path = os.path.join(test_dir, "policy.json") | ||
|
|
||
| result = start_policy_evaluation(policy_path=policy_path, input_path=input_path) | ||
| assert result["final_result"] is False |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.