Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Upload artifacts via API with token #50

Open
jan-auer opened this issue Nov 14, 2017 · 1 comment
Open

Upload artifacts via API with token #50

jan-auer opened this issue Nov 14, 2017 · 1 comment

Comments

@jan-auer
Copy link
Member

Currently we use Zeus hook URLs to upload artifacts. It would be much better to use the API for this. We already have user-based and repository-based tokens which can be used for authorization.

The current endpoint also does not include the provider id and might potentially collide on external ids. For now, this will not happen as Travis and AppVeyor use different ID schemas.

Ideally, we'd split the current endpoint in two requests:

  1. Obtain the job by external build and job ID:
    GET /api/repos/provider/<p>/<o>/<r>/jobs?build_xid=<BUILD_ID>&job_xid=<JOB_ID>
  2. Push an artifact to the job:
    POST /api/repos/provider/<p>/<o>/<r>/builds/<b>/jobs/<j>/artifacts

Both requests require bearer authorization. The CLI would obtain a token from ZEUS_TOKEN and then run both requests in sequence.

@dcramer
Copy link
Member

dcramer commented Dec 7, 2017

The reason for the hook is two fold:

  1. It automatically binds and restricts authentication on a per-repository scope. With that, it doesn't actually require authentication as the URL itself is considered authenticated.
  2. It is coupled to the provider, which means theres no concern of interacting with different systems in different ways.

I don't think its appropriate to try and replace it with a harder to use API, but thats not to say we couldn't use the API in other cases.

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

No branches or pull requests

2 participants