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

feat: sourcehut auto-discovery #24

Open
algernon opened this issue Oct 31, 2023 · 2 comments
Open

feat: sourcehut auto-discovery #24

algernon opened this issue Oct 31, 2023 · 2 comments

Comments

@algernon
Copy link
Collaborator

I don't have the bandwidth at the moment to implement this, but I did a little bit of research and thinking, which I'm sharing here: similar to Forgejo, the autodetection is a little bit fragile. There's no endpoint we can hit that'd 100% tell us its sourcehut. However, sourcehut has API endpoints that are unique among the supported forges (just like Forgejo): /api/user will return a 401, which tells us that the endpoint exists. It's a rather generic endpoint, but none of the other forges use it, so it's not terrible.

Thus, checking if /api/user returns 401 is a reasonably strong indication that we're dealing with SourceHut.

@cafkafk
Copy link
Owner

cafkafk commented Oct 31, 2023

I'll maybe do this then, thanks for finding this!

@algernon
Copy link
Collaborator Author

algernon commented Nov 4, 2023

Hrm. There's a downside of /api/user: the REST API is in the process of being deprecated, and replaced with a GraphQL API, which is at /query - and that one is way too generic, and there's nothing particularly identifiable there.

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

No branches or pull requests

2 participants