Skip to content
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

[analyze] Add analyzer interface for Shopify #3226

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

abmussani
Copy link
Contributor

Description:

This PR implements the analyzer interface for shopify.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@abmussani abmussani requested a review from a team as a code owner August 16, 2024 14:47
@abmussani abmussani force-pushed the impl-data-model-shopify branch from 2bdf69c to 1b15793 Compare August 28, 2024 15:37

resource := &analyzers.Resource{
Name: info.ShopInfo.Shop.Name,
FullyQualifiedName: info.ShopInfo.Shop.Email,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems plausible that the email can be reused across shops. Maybe we can use the domain instead? There's a lot of information in the shop.json API to choose from.

Comment on lines 4 to 33
{
"Resource":{
"Name":"My Store",
"FullyQualifiedName":"[email protected]",
"Type":"shop",
"Metadata":{
"created_at":"2024-08-16T17:16:17+05:00"
},
"Parent":null
},
"Permission":{
"Value":"Read",
"Parent":null
}
},
{
"Resource":{
"Name":"My Store",
"FullyQualifiedName":"[email protected]",
"Type":"shop",
"Metadata":{
"created_at":"2024-08-16T17:16:17+05:00"
},
"Parent":null
},
"Permission":{
"Value":"Read",
"Parent":null
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These bindings look exactly the same. Are we setting the permission correctly?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also just "Read" which makes me think we're not using the generated permission values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for pointing it out. I noted that permissions where being assigned to shop resource instead of categories. Fixed this issue.

abasit-folio3 and others added 6 commits September 9, 2024 22:24
- key validations
- linked analyzer with detectors
- moved redundant initialize to global.
moved expected output of test in json file to neat the code.
@abmussani abmussani force-pushed the impl-data-model-shopify branch from da3b527 to 273e8db Compare September 9, 2024 17:25
- Fixed permission and category resource issue in shopify analyzer
- corrected test for shopify analyzer
@mcastorina mcastorina merged commit dc9c9a3 into trufflesecurity:main Sep 12, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants