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

Add GitHub App API token authentication to clone custom policy inside a private repository #51

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

4bg0P
Copy link
Contributor

@4bg0P 4bg0P commented Dec 22, 2021

As stated in issue #50, the custom policy clone using GitHub App API token is not possible as x-access-tokenusername need to be set in the https clone link.

I've added an optionnal argument --is-github-app-token to specify if the authentication token is a GitHub App API token, and set the x-access-token username needed to clone the policy.

I've also added the branch argument to Policy()call, as it was actually never used.

@4bg0P
Copy link
Contributor Author

4bg0P commented Jan 5, 2022

Hi @GeekMasher,

Hope you are doing well!

First, thank you for this great tool! I don't know if you have seen this PR, but it might be really useful for me and my company to get this feature directly in the tool. The changes are minor, and could help us to use a GitHub App token instead of a classic GitHub API token.

Thank you in advance,

Théo

@GeekMasher GeekMasher self-assigned this Jan 5, 2022
@GeekMasher
Copy link
Owner

@4bg0P Thank you for the PR and Issue raised. I'll take a look later today or tomorrow and merge the changes. I will have to create an Issue for the documentation request after merging as docs are still in the docs branch.

@4bg0P
Copy link
Contributor Author

4bg0P commented Jan 5, 2022

@GeekMasher Thank your for your answer! Do not hesitate to reach me if you need more details, or need me to help you with the documentation.

Have a great day! 😄

@@ -30,7 +30,8 @@
parser.add_argument("--disable-dependabot", action="store_true")
parser.add_argument("--disable-dependency-licensing", action="store_true")
parser.add_argument("--disable-dependencies", action="store_true")
parser.add_argument("--disable-secret-scanning", action="store_true")
parser.add_argument("--disable-secret-scanning", action="store_true")
parser.add_argument("--is-github-app-token", action="store_true", default=False)
Copy link
Owner

Choose a reason for hiding this comment

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

@4bg0P Do you think that this argument should / could be set via the Actions?

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GeekMasher Sure, it is a great idea to set it using Actions also!

Copy link
Owner

Choose a reason for hiding this comment

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

I'll add this as an upcoming update

@GeekMasher
Copy link
Owner

Main is failing due to the PAT used so the E2E tests are failing. Everything else looks good so merging.

@GeekMasher GeekMasher merged commit 1e8b4c2 into GeekMasher:main Jan 5, 2022
EwiththeBowtie pushed a commit to CloudBoltSoftware/advanced-security-compliance that referenced this pull request Jan 25, 2022
… a private repository (GeekMasher#51)

* Add GitHub App authentication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants