travis-api/lib/travis/api/app/endpoint/artifacts.rb
2013-01-30 08:50:27 +01:00

23 lines
638 B
Ruby

require 'travis/api/app'
class Travis::Api::App
class Endpoint
# Artifacts are generated by builds. Currently we only expose logs as
# artifacts
class Artifacts < Endpoint
# Fetches an artifact by it's *id*.
get '/:id' do |id|
respond_with service(:find_artifact, params)
end
put '/:id' do |id|
# TODO @rkh ... rather lost in the auth/scopes code.
token = env['HTTP_TOKEN']
halt 403, 'no token' unless token
halt 403, 'internal' unless token == Travis.config.tokens.internal
respond_with service(:update_artifact, params)
end
end
end
end