Initial implementation of Github APIs for the plugin#1
Merged
chris-cmsoft merged 12 commits intomainfrom Apr 13, 2025
Merged
Conversation
Logic is stored within a validator map that can be changed. At some point we should add some more complex structures within it to check if it is required on the wire and if we can add sensible defaults. e.g. for api_url, default to https://api.github.com/ References BCH-868
Firstly, opted against re-inventing the wheel by querying the APIs manually, as going forward, it will help with rate limiting and other queries we can pass into the functions
A unit test has also been created to simulate the output from the /org/{org} endpoint so we can replicate items uniformly. In the future, proper fixtures should be put in place so we can test unauthenticated responses from GH which will fail a lot of the audit rules due to the sensitive nature
Finally, A single test rego policy is in place just to aide with testing. Future policies will be created in an isolated repository
References BCH-868
- add context about the plugin - Update pre-reqs - describe expected configuration References BCH-868
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
go-githublibrary as the abstraction to query the Github API