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

Feature Request: add CORS API indicating 'gitea' #16563

Closed
coolaj86 opened this issue Jul 27, 2021 · 3 comments
Closed

Feature Request: add CORS API indicating 'gitea' #16563

coolaj86 opened this issue Jul 27, 2021 · 3 comments
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@coolaj86
Copy link
Contributor

coolaj86 commented Jul 27, 2021

TL;DR

I'd like there to be some way to indicate that the service is gitea, as opposed to gitlab.

Example

I'd like to be able to do something like this:

await fetch('https://try.gitea.io/api/v1/version', { mode: 'cors' }).toJSON()
// { "name": "gitea", "version": "1.15.0" }

Or similar to this:

await fetch('https://try.gitea.io/.well-known/openid-configuration', { mode: 'cors' }).toJSON()
// { "service_documentation": "https://docs.gitea.io" }

Just something that reveals "yes, this is gitea".

Rationalé

The reason is that I'm building a tool Bliss, which works with GitHub, GitLab, and Gitea and I'd like to be able to detect which system a user-supplied URL represents, since they have slightly different APIs.

@coolaj86 coolaj86 changed the title Feature Request: add CORS API indicating name Feature Request: add CORS API indicating 'gitea' Jul 27, 2021
@techknowlogick techknowlogick added modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jul 28, 2021
@techknowlogick
Copy link
Member

I wouldn't necessarily recommend the oidc wellknown endpoint for discovery of software type based on a docs URL (there must be a wellknown endpoint for what type of forge is in place), although regardless of purpose if a PR were to be made for the docs URL I'd recommend using https://docs.gitea.io/en-us/oauth2-provider/

I'd also hesitate to use the version endpoint, because users are able to mandate that endpoint require credentials.

@techknowlogick
Copy link
Member

A PR for the wellknown nodeinfo endpoint can be found here: #16953

@techknowlogick
Copy link
Member

Closing per linked PR

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants