-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 SourceHut (sr.ht) provider #2359
base: master
Are you sure you want to change the base?
Conversation
providers/srht.go
Outdated
s.Email = email | ||
|
||
username, err := json.Get("data").Get("me").Get("username").String() | ||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So errors / missing usernames are going to be ignored? Shouldn't we at least log something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, not sure what I had in mind there. I made it a hard error, for if a response is received but it does not contain a username, something is certainly amiss.
As I just learned from #2357 I guess I should add an item to the Changelog. However, to avoid a merge conflict, I'll wait until you merged that one, so I can rebase this branch. |
Hi @bitfehler does sourcehut only offer a oauth2 integration or oidc as well? |
There is no OIDC right now. |
Added a changelog, now that the potentially conflicting branch was merged. Let me know if there is anything else I was missing! |
Thanks for the clarification. I'll check the code once more when I find the time. Probably on the weekend. |
521b961
to
bb0a911
Compare
Fixed the outstanding CI failures, sorry for the delay. |
This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed. |
@tuunit gentle ping 🙂 |
This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed. |
This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed. |
Co-authored-by: Jan Larwig <[email protected]>
Description
This adds a provider for SourceHut instances, defaulting to the main public instance at sr.ht, but custom instances can be used by overriding the usual URLs (see added documentation).
Motivation and Context
Full disclosure: I am affiliated with SourceHut. Nevertheless, I'd simply like to use oauth2-proxy with sr.ht accounts for one of my projects, and I think others might benefit from this as well.
How Has This Been Tested?
I have tested this against both the public instance as well as a local development instance.
Checklist:
I added documentation, not sure about the Changelog. Let me know if you'd like me to put something in there...