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: Repo license check #9
Conversation
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.
Very nice!
Tested with the https://github.com/grafana/grafana repo (which is copy left AGPL-3)
{
"owner": "grafana",
"name": "grafana",
"branch": "main"
}
And this gives a 403 response:
Impermissible repository license
Could we decorate this error alittle bit? Maybe something like
Error: Impermissible repository license for
https://api.github.com/repos/grafana/grafana/license
Found: AGPL-3.0 license
just so the user has abit more info one what's going on?
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.
This looks good. Thanks for the turnaround. I have been slowly sharing this repo with folks, and this has come as a concern.
Be sure to commit John's spelling fix before merging.
Co-authored-by: John McBride <john@opensauced.pizza>
New 403 response: {
"license":{
"name":"GNU Affero General Public License v3.0",
"url":"https://github.com/grafana/grafana/blob/main/LICENSE"
},
"message":"Impermissible repository license"
} |
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.
ππΌ ππΌ ππΌ
Description
This PR updates the dependencies in the Cargo.lock file. It removes the
actix-tls
package and updates the versions ofactix-utils
,rustls
,tokio-rustls
, andtokio
packages. The changes in the Cargo.toml file include removing the feature flag forrustls
in theactix-web
package. Additionally, this PR introduces a new functionis_indexing_allowed
in thegithub/mod.rs
file to check if indexing is allowed based on the repository's license. The function is used in theembeddings
route in theroutes/mod.rs
file to validate the repository's license before processing the request. The PR also includes tests for the new function.Generated using OpenSauced.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Resolves #7.
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?