Skip to content

Commit

Permalink
[Feat] implementation Notion analyzer (#3869)
Browse files Browse the repository at this point in the history
### Description:
Since `Notion.co` allows to enable [capabilities](https://developers.notion.com/reference/capabilities) against integration token, It is a good candidate to build an analyzer for it.
![Screenshot 2025-02-04 at 6 46 37 PM](https://github.com/user-attachments/assets/2fb711fe-466f-4b78-9b25-56852f08cd3b)

This PR implements notion analyzer along with its integration test.


### Checklist:
* [ ] Tests passing (`make test-community`)?
* [x] Lint passing (`make lint` this requires [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation))?
  • Loading branch information
abmussani authored Feb 11, 2025
1 parent 0761334 commit f2dc96e
Show file tree
Hide file tree
Showing 9 changed files with 643 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/analyzer/analyzers/analyzers.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const (
AnalyzerTypeStripe
AnalyzerTypeTwilio
AnalyzerTypePrivateKey
AnalyzerTypeNotion
// Add new items here with AnalyzerType prefix
)

Expand Down Expand Up @@ -110,6 +111,7 @@ var analyzerTypeStrings = map[AnalyzerType]string{
AnalyzerTypeStripe: "Stripe",
AnalyzerTypeTwilio: "Twilio",
AnalyzerTypePrivateKey: "PrivateKey",
AnalyzerTypeNotion: "Notion",
// Add new mappings here
}

Expand Down
1 change: 1 addition & 0 deletions pkg/analyzer/analyzers/notion/expected_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"AnalyzerType":22,"Bindings":[{"Resource":{"Name":"hooman","FullyQualifiedName":"notion.so/bot/62faeec3-a948-4dd4-90ae-426e0b192902","Type":"bot","Metadata":{"workspace":"hoomanit"},"Parent":null},"Permission":{"Value":"insert_content","Parent":null}},{"Resource":{"Name":"hooman","FullyQualifiedName":"notion.so/bot/62faeec3-a948-4dd4-90ae-426e0b192902","Type":"bot","Metadata":{"workspace":"hoomanit"},"Parent":null},"Permission":{"Value":"read_content","Parent":null}},{"Resource":{"Name":"hooman","FullyQualifiedName":"notion.so/bot/62faeec3-a948-4dd4-90ae-426e0b192902","Type":"bot","Metadata":{"workspace":"hoomanit"},"Parent":null},"Permission":{"Value":"read_users_with_email","Parent":null}},{"Resource":{"Name":"hooman","FullyQualifiedName":"notion.so/bot/62faeec3-a948-4dd4-90ae-426e0b192902","Type":"bot","Metadata":{"workspace":"hoomanit"},"Parent":null},"Permission":{"Value":"update_content","Parent":null}}],"UnboundedResources":[{"Name":"hooman","FullyQualifiedName":"notion.so/person/3d0600fa-fa18-427d-8abc-58b662f0d209","Type":"person","Metadata":{"email":"[email protected]"},"Parent":null}],"Metadata":null}
Loading

0 comments on commit f2dc96e

Please sign in to comment.