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

API Authentication #103

Closed
nikoksr opened this issue Feb 17, 2020 · 2 comments · Fixed by #122
Closed

API Authentication #103

nikoksr opened this issue Feb 17, 2020 · 2 comments · Fixed by #122

Comments

@nikoksr
Copy link
Collaborator

nikoksr commented Feb 17, 2020

Is your feature request related to a problem? Please describe.
When importing a repo with proji, it uses the GitHub and GitLab API respectively to pull the informations about the specified repo. The GitHub and GitLab API are both limited to a certain number of requests per hour. For an unauthenticated user GitHub allows 60 requests per hour and 5000 for an authenticated user. Additionally private repos are currently unaccessible for proji beacuse of the missing authentication feature.

Describe the solution you'd like
Add the option for the user to authenticate himself with a GitHub and/or GitLab account. Ideally there should be an array in the main config for every hosting platform respectively which holds API relevant parameters.

Relevant proji code:

Authentication docs:

Additional context
When the user reaches the rate limit both APIs return an error code 403. Proji should interpret this error code and return a well formatted description of why the request failed and calculate foe how long the user has to wait until he can use the API again.

Open for debate (comments welcome)
- Should proji make authenticated API calls by default (in case that any auth relevant data was defined in the config at all) or ask the user every time if he wants to make an authenticated or unauthenticated API call? Maybe add an option in the main config which determines this behaviour? For example something like like use_api_auth_if_possible = true.

@nikoksr
Copy link
Collaborator Author

nikoksr commented May 15, 2020

Updated issue description.

@nikoksr nikoksr added this to the Version 0.21.0 milestone May 15, 2020
@nikoksr
Copy link
Collaborator Author

nikoksr commented May 21, 2020

I'm thinking about replacing the manual implementation of the GitHub and GitLab API by dedicated Go libraries. This would immediately solve the missing authentication feature, make it probably more stable and easier to maintain in the future since we don't have to react and adapt to changes in the GitHub/GitLab API ourselves.

Go GitHub API Lib: https://github.com/google/go-github
Go GitLab API Lib: https://github.com/xanzy/go-gitlab

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

Successfully merging a pull request may close this issue.

1 participant