Skip to content

Commit

Permalink
APP-15932 - Fix rule tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jzolo22 committed Nov 7, 2024
1 parent f42401e commit c4b0c9a
Show file tree
Hide file tree
Showing 8 changed files with 299 additions and 130 deletions.
82 changes: 41 additions & 41 deletions jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ interactions:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 1132
content_length: 1114
transfer_encoding: []
trailer: {}
host: graphql.us.jupiterone.io
host: graphql.dev.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nmutation CreateInlineQuestionRuleInstance ($instance: CreateInlineQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createInlineQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\n\t\t}\n\t}\n}\n","variables":{"instance":{"question":{"queries":[{"query":"Find DataStore with classification=(''critical'' or ''sensitive'' or ''confidential'' or ''restricted'') and encrypted!=true","name":"query0","version":"v1","includeDeleted":false}]},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"test","specVersion":1,"operations":[],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_DAY","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"remediationSteps":"","collectionId":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}'
body: '{"query":"\nmutation CreateInlineQuestionRuleInstance ($instance: CreateInlineQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createInlineQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\n\t\t}\n\t}\n}\n","variables":{"instance":{"question":{"queries":[{"query":"Find DataStore with classification=(''critical'' or ''sensitive'' or ''confidential'' or ''restricted'') and encrypted!=true","name":"query0","version":"v1","includeDeleted":false}]},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"test","specVersion":1,"operations":[],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_DAY","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"remediationSteps":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}'
form: {}
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json
url: https://graphql.us.jupiterone.io/
url: https://graphql.dev.jupiterone.io/
method: POST
response:
proto: HTTP/2.0
Expand All @@ -30,7 +30,7 @@ interactions:
content_length: 350
uncompressed: false
body: |
{"data":{"createQuestionRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea","version":1,"specVersion":1,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"labels":[]}}}
{"data":{"createQuestionRuleInstance":{"id":"2cb574d2-0cf1-4f41-8b57-bfca2a6eb5cc","version":1,"specVersion":1,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"labels":[]}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Expand Down Expand Up @@ -78,42 +78,42 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 609.287625ms
duration: 746.634084ms
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 632
content_length: 650
transfer_encoding: []
trailer: {}
host: graphql.us.jupiterone.io
host: graphql.dev.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nquery GetQuestionRuleInstance ($id: ID!) {\n\tquestionRuleInstance(id: $id) {\n\t\tid\n\t\tname\n\t\tdescription\n\t\tversion\n\t\tspecVersion\n\t\tlatest\n\t\tpollingInterval\n\t\tdeleted\n\t\ttype\n\t\ttemplates\n\t\tnotifyOnFailure\n\t\ttriggerActionsOnNewEntitiesOnly\n\t\tignorePreviousResults\n\t\tquestionId\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\toutputs\n\t\ttags\n\t}\n}\n","variables":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea"},"operationName":"GetQuestionRuleInstance"}'
body: '{"query":"\nquery GetQuestionRuleInstance ($id: ID!) {\n\tquestionRuleInstance(id: $id) {\n\t\tid\n\t\tname\n\t\tcollectionId\n\t\tdescription\n\t\tversion\n\t\tspecVersion\n\t\tlatest\n\t\tpollingInterval\n\t\tdeleted\n\t\ttype\n\t\ttemplates\n\t\tnotifyOnFailure\n\t\ttriggerActionsOnNewEntitiesOnly\n\t\tignorePreviousResults\n\t\tquestionId\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\toutputs\n\t\ttags\n\t}\n}\n","variables":{"id":"2cb574d2-0cf1-4f41-8b57-bfca2a6eb5cc"},"operationName":"GetQuestionRuleInstance"}'
form: {}
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json
url: https://graphql.us.jupiterone.io/
url: https://graphql.dev.jupiterone.io/
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 668
content_length: 688
uncompressed: false
body: |
{"data":{"questionRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea","name":"tf-provider-test-rule","description":"test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_DAY","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":null,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}}
{"data":{"questionRuleInstance":{"id":"2cb574d2-0cf1-4f41-8b57-bfca2a6eb5cc","name":"tf-provider-test-rule","collectionId":null,"description":"test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_DAY","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":null,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Content-Length:
- "668"
- "688"
Content-Security-Policy:
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;form-action ''self'';frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
Content-Type:
Expand Down Expand Up @@ -156,7 +156,7 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 188.905125ms
duration: 219.746958ms
- id: 2
request:
proto: HTTP/1.1
Expand All @@ -165,17 +165,17 @@ interactions:
content_length: 200
transfer_encoding: []
trailer: {}
host: graphql.us.jupiterone.io
host: graphql.dev.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nmutation DeleteRuleInstance ($id: ID!) {\n\tdeleteRuleInstance(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea"},"operationName":"DeleteRuleInstance"}'
body: '{"query":"\nmutation DeleteRuleInstance ($id: ID!) {\n\tdeleteRuleInstance(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"2cb574d2-0cf1-4f41-8b57-bfca2a6eb5cc"},"operationName":"DeleteRuleInstance"}'
form: {}
headers:
Cache-Control:
- no-cache
Content-Type:
- application/json
url: https://graphql.us.jupiterone.io/
url: https://graphql.dev.jupiterone.io/
method: POST
response:
proto: HTTP/2.0
Expand All @@ -186,7 +186,7 @@ interactions:
content_length: 78
uncompressed: false
body: |
{"data":{"deleteRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea"}}}
{"data":{"deleteRuleInstance":{"id":"2cb574d2-0cf1-4f41-8b57-bfca2a6eb5cc"}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Expand Down Expand Up @@ -234,4 +234,4 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 200.725ms
duration: 228.711917ms
Loading

0 comments on commit c4b0c9a

Please sign in to comment.