* stripe analyzer unit test
* add huggingface analyzer unit test
* add permissions.yaml for huggingface and fix in analyzer
* square permissions generated
* permissions generated for stripe
* change permissions to lowercase
* skip unknown permissions for square and stripe
---------
Co-authored-by: Abdul Basit <abasit@folio3.com>
* Implement SourceUnitEnumChunker for GitHub
This change refactors the internal scan method to introduce a scanRepo
method to perform the actual scan.
* Export unit fields so the values are captured in the report
* Add comment for scanRepo
* Break out ensureRepoInfoCache into a method
* Update comments and check errors
* Ensure that the repoInfoCache contains the repo during ChunkUnit
* Add integration test for ChunkUnit
* Move s.scanOptions initialization to Init()
* implement analyzer interface for shopify
* fixed shopify analyzer according to new code and generated permissions
* shopify analyzer test added
* [chore]
- key validations
- linked analyzer with detectors
* [chore]
- moved redundant initialize to global.
* [chore]
moved expected output of test in json file to neat the code.
* [Fixes]
- Fixed permission and category resource issue in shopify analyzer
- corrected test for shopify analyzer
---------
Co-authored-by: Abdul Basit <abasit@folio3.com>
* implement analyzer interface, add unit test and link with detector for mailgun
* [chore] moved expected output of test in json file to neat the code.
corrected variable name for test in detector bucket
* append domain id in fully qualified name of domain resources
* [Fixes]
domains will be added as resource in bindings and permissions.
updated the test.
---------
Co-authored-by: Abdul Basit <abasit@folio3.com>
* implement analyzer interface for mysql
* add integration test for mysql analyzer
* linked detectors with analyzers for jdbc and mysql
validation for connection string in analyzer
* refactored secretInfoToAnalyzerResult func
* generated permissions for mysql analyzer
* [chore]
- optimization in execution flow
- use test-container library for analyze test.
* added host in secret info struct
simplified the mysql test due to huge structure
---------
Co-authored-by: Abdul Basit <abasit@folio3.com>
* Fix GitHub integration test
* Instrument GitHub source with a UnitReporter
The reporter is currently unused, but is the first step to support
scanning while enumerating.
* Update GitHub unit tests
When normalizing the git source config, the base and head refs should be normalized to commit hashes, in case
a branch or tag name was used. The `resolveAndSetCommit` function was returning a boolean value which should
indicate whether the input ref was changed from its original value. While this is in itself not a problem,
the caller (`normalizeConfig`) was using this boolean as an error marker, and returning early in case of `false`.
This meant that if the config was already containing a commit hash for the base or head ref, `resolveAndSetCommit`
would set the flag to `false` and `normalizeConfig` would early return erreneously. This caused the logic to find
the ancestor commit to be skipped which caused the bug in the issue #3220.
Since the `resolveAndSetCommit` function was only used in `normalizeConfig`, the signature has been changed to only
return the commit object and an error. The check for early return in `normalizeConfig` now instead relies on the
commit object being `nil` to indicate a failure to resolve the ref.
Refs: #3220