pullrequest creation API
Thomas De Schampheleire
patrickdepinguin at gmail.com
Wed Mar 11 16:56:49 EDT 2015
Hi,
I would like to create a way to create a pull request
programmatically, through an API call.
At first sight, using the api_access=True method to create a callable
web view is the easiest, since you could take in the request and pass
it to the existing PullrequestsController:create() method. However,
this existing create method is decorated with @NotAnonymous, causing
it to be unavailable for API calls.
The alternative is to create an API method in controllers/api/api.py,
but it's unclear to me how to hook this into the
PullrequestsController.
How to proceed here?
Should I remove the NotAnonymous decorator and pass the requested user
as argument to the API call?
I was also a bit confused on how these API keys are working: it seems
that whenever you call an API, you are really the default (anonymous)
user, regardless of the API key you are using.
For this use case, it would be better to determine the user this API
key is belonging to.
I'm not sure how such things are supposed to be handled wrt security.
Any feedback is appreciated.
Thanks,
Thomas
More information about the kallithea-general
mailing list