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