-
Notifications
You must be signed in to change notification settings - Fork 75
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
GithubApp Auth #554
Comments
You're right we don't support github apps authorization. |
Agreed, maybe we can make But if it's part of Github Auth flow user will do same code over and over. |
So, do you have any suggestions how to implement it? |
I'm 👍 on that |
But as I mention before, users will do same code over and over and not in the best way. It's like give them domain and say, use own http sender. |
We can add that code as documentation, it doesn't seem to me like the usage will be so huge that it would need to be part of the library. |
Okay, next week I'm going to prepare this changes and will discuss it with real example. |
@loonydev Hi! Are you still planning to make a PR with this changes? |
Morning @kusaeva, not yet, it's in plan, but not in a near future. If you have a time to make it, it would be great. |
Hello - I'm interested about the status of this issue We have a standalone service in our infrastructure that requires broad access to GH's REST api and the repositories under our organisation (DHL-Parcel) - preferably using the github4s library and authorise not via a personal access token - but either via JWT tokens or - as requested in this issue - via GH Apps authorisation. We did try the new If authorisation via JWT or GH App tokens is currently not possible we would able to spend some time on getting this to work with github4s provided that we get some help and pointers on how the preferred integration should look like in the API. Thanks in advance :) |
Hi @nmcb, thanks for your interest. This is how it's currently built. We have an algebra that allows generating tokens: github4s/github4s/shared/src/main/scala/github4s/algebras/AccessToken.scala Lines 31 to 34 in 9c18225
This algebra has a single implementation called github4s/github4s/shared/src/main/scala/github4s/interpreters/StaticAccessToken.scala Lines 25 to 29 in 9c18225
When you create a new
This is then used to create the internal
That, in a similar way, pass it to the internal
The
The github4s/github4s/shared/src/main/scala/github4s/http/RequestBuilder.scala Lines 44 to 48 in 9c18225
This is mapped to a
Potential solution @loonydev's approach looks good, so I've created a draft with a potential solution: In that way, you can implement your algebra for generating auth headers, having complete control. Let me know your thoughts. The docs need to be updated accordingly. |
thanks @fedefernandez! we'll give it a try. cc @thijsnissen |
Hi,
As I understand, for now this library don't support GithubApps authorization?
If so, I want to discuss the best way for implementation.
In my code I used
trait GithubAuth
with methoddef getAuthHeader():String
.GithubClient
taken instance ofGithubAuth
and call this function for token. In case of PAT it's return token from constructor, in case of private key it's looks like:WDYT?
The text was updated successfully, but these errors were encountered: