Merge pull request #168 from travis-ci/rkh-less-gh-error-noise
Rkh less gh error noise
This commit is contained in:
commit
5fb2feb7e7
|
@ -39,7 +39,7 @@ class Travis::Api::App
|
|||
# Logging is set up by custom middleware
|
||||
disable :protection, :logging, :setup
|
||||
enable :raise_errors
|
||||
# disable :dump_errors
|
||||
disable :dump_errors
|
||||
register :subclass_tracker, :expose_pattern
|
||||
helpers :respond_with, :mime_types
|
||||
end
|
||||
|
@ -48,6 +48,7 @@ class Travis::Api::App
|
|||
# We want error pages in development, but only
|
||||
# when we don't have an error handler specified
|
||||
set :show_exceptions, :after_handler
|
||||
enable :dump_errors
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -274,6 +274,9 @@ class Travis::Api::App
|
|||
user = manager.fetch
|
||||
halt 403, 'not a Travis user' if user.nil?
|
||||
user
|
||||
rescue GH::Error
|
||||
# not a valid token actually, but we don't want to expose that info
|
||||
halt 403, 'not a Travis user'
|
||||
end
|
||||
|
||||
def get_token(endpoint, values)
|
||||
|
|
|
@ -138,9 +138,18 @@ describe Travis::Api::App::Endpoint::Authorization do
|
|||
end
|
||||
|
||||
it "errors if no token is given" do
|
||||
User.stubs(:find_by_github_id).with(111).returns(user)
|
||||
post("/auth/github").should_not be_ok
|
||||
last_response.status.should == 422
|
||||
body.should_not include("access_token")
|
||||
end
|
||||
|
||||
it "errors if github throws an error" do
|
||||
GH.stubs(:with).raises(GH::Error)
|
||||
post("/auth/github", github_token: 'foo bar').should_not be_ok
|
||||
last_response.status.should == 403
|
||||
body.should_not include("access_token")
|
||||
body.should include("not a Travis user")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,28 +9,31 @@ Gem::Specification.new do |s|
|
|||
s.require_path = 'lib'
|
||||
|
||||
s.authors = [
|
||||
"Piotr Sarnacki",
|
||||
"Konstantin Haase",
|
||||
"Piotr Sarnacki",
|
||||
"Sven Fuchs",
|
||||
"Hiro Asari",
|
||||
"Mathias Meyer",
|
||||
"Josh Kalderimis",
|
||||
"Henrik Hodne",
|
||||
"carlad",
|
||||
"Tyranja",
|
||||
"Andre Arko",
|
||||
"Dan Buch",
|
||||
"C. Scott Ananian",
|
||||
"Erik Michaels-Ober",
|
||||
"Steve Richert",
|
||||
"Brian Ford",
|
||||
"Patrick Williams",
|
||||
"Bryan Goldstein",
|
||||
"Steve Richert",
|
||||
"Puneeth Chaganti",
|
||||
"Thais Camilo and Konstantin Haase",
|
||||
"Tim Carey-Smith",
|
||||
"Bryan Goldstein",
|
||||
"Zachary Scott",
|
||||
"James Dennes",
|
||||
"rainsun",
|
||||
"Dan Rice",
|
||||
"Nick Schonning"
|
||||
"Nick Schonning",
|
||||
"Patrick Williams",
|
||||
"Dan Rice"
|
||||
]
|
||||
|
||||
s.email = [
|
||||
|
@ -43,24 +46,28 @@ Gem::Specification.new do |s|
|
|||
"me@henrikhodne.com",
|
||||
"henrik@hodne.io",
|
||||
"konstantin.haase@gmail.com",
|
||||
"carla@travis-ci.org",
|
||||
"tyranja@cassiopeia.uberspace.de",
|
||||
"andre@arko.net",
|
||||
"svenfuchs@artweb-design.de",
|
||||
"dan@travis-ci.org",
|
||||
"sferik@gmail.com",
|
||||
"cscott@cscott.net",
|
||||
"henrik@travis-ci.com",
|
||||
"steve.richert@gmail.com",
|
||||
"bford@engineyard.com",
|
||||
"henrik@travis-ci.com",
|
||||
"brysgo@gmail.com",
|
||||
"jdennes@gmail.com",
|
||||
"patrick@bittorrent.com",
|
||||
"punchagan@muse-amuse.in",
|
||||
"carlad@users.noreply.github.com",
|
||||
"dan@zoombody.com",
|
||||
"rainsuner@gmail.com",
|
||||
"dev+narwen+rkh@rkh.im",
|
||||
"tim@spork.in",
|
||||
"brysgo@gmail.com",
|
||||
"e@zzak.io",
|
||||
"punchagan@muse-amuse.in",
|
||||
"dan@zoombody.com",
|
||||
"dan@meatballhat.com",
|
||||
"jdennes@gmail.com",
|
||||
"nschonni@gmail.com",
|
||||
"patrick@bittorrent.com"
|
||||
"dan@meatballhat.com"
|
||||
]
|
||||
|
||||
s.files = [
|
||||
|
@ -101,6 +108,7 @@ Gem::Specification.new do |s|
|
|||
"lib/travis/api/app/endpoint/singleton_settings_endpoint.rb",
|
||||
"lib/travis/api/app/endpoint/uptime.rb",
|
||||
"lib/travis/api/app/endpoint/users.rb",
|
||||
"lib/travis/api/app/error_handling.rb",
|
||||
"lib/travis/api/app/extensions.rb",
|
||||
"lib/travis/api/app/extensions/expose_pattern.rb",
|
||||
"lib/travis/api/app/extensions/scoping.rb",
|
||||
|
@ -170,11 +178,54 @@ Gem::Specification.new do |s|
|
|||
"lib/travis/api/v3/access_control/scoped.rb",
|
||||
"lib/travis/api/v3/access_control/signature.rb",
|
||||
"lib/travis/api/v3/access_control/user.rb",
|
||||
"lib/travis/api/v3/constant_resolver.rb",
|
||||
"lib/travis/api/v3/error.rb",
|
||||
"lib/travis/api/v3/extensions/belongs_to.rb",
|
||||
"lib/travis/api/v3/extensions/encrypted_column.rb",
|
||||
"lib/travis/api/v3/github.rb",
|
||||
"lib/travis/api/v3/model.rb",
|
||||
"lib/travis/api/v3/models.rb",
|
||||
"lib/travis/api/v3/models/branch.rb",
|
||||
"lib/travis/api/v3/models/broadcast.rb",
|
||||
"lib/travis/api/v3/models/build.rb",
|
||||
"lib/travis/api/v3/models/commit.rb",
|
||||
"lib/travis/api/v3/models/email.rb",
|
||||
"lib/travis/api/v3/models/job.rb",
|
||||
"lib/travis/api/v3/models/log.rb",
|
||||
"lib/travis/api/v3/models/log_part.rb",
|
||||
"lib/travis/api/v3/models/membership.rb",
|
||||
"lib/travis/api/v3/models/organization.rb",
|
||||
"lib/travis/api/v3/models/permission.rb",
|
||||
"lib/travis/api/v3/models/repository.rb",
|
||||
"lib/travis/api/v3/models/request.rb",
|
||||
"lib/travis/api/v3/models/ssl_key.rb",
|
||||
"lib/travis/api/v3/models/token.rb",
|
||||
"lib/travis/api/v3/models/user.rb",
|
||||
"lib/travis/api/v3/opt_in.rb",
|
||||
"lib/travis/api/v3/queries.rb",
|
||||
"lib/travis/api/v3/queries/branch.rb",
|
||||
"lib/travis/api/v3/queries/build.rb",
|
||||
"lib/travis/api/v3/queries/organization.rb",
|
||||
"lib/travis/api/v3/queries/organizations.rb",
|
||||
"lib/travis/api/v3/queries/repositories.rb",
|
||||
"lib/travis/api/v3/queries/repository.rb",
|
||||
"lib/travis/api/v3/queries/request.rb",
|
||||
"lib/travis/api/v3/queries/requests.rb",
|
||||
"lib/travis/api/v3/queries/user.rb",
|
||||
"lib/travis/api/v3/query.rb",
|
||||
"lib/travis/api/v3/renderer.rb",
|
||||
"lib/travis/api/v3/renderer/accepted.rb",
|
||||
"lib/travis/api/v3/renderer/branch.rb",
|
||||
"lib/travis/api/v3/renderer/build.rb",
|
||||
"lib/travis/api/v3/renderer/collection_renderer.rb",
|
||||
"lib/travis/api/v3/renderer/error.rb",
|
||||
"lib/travis/api/v3/renderer/model_renderer.rb",
|
||||
"lib/travis/api/v3/renderer/organization.rb",
|
||||
"lib/travis/api/v3/renderer/organizations.rb",
|
||||
"lib/travis/api/v3/renderer/repositories.rb",
|
||||
"lib/travis/api/v3/renderer/repository.rb",
|
||||
"lib/travis/api/v3/renderer/requests.rb",
|
||||
"lib/travis/api/v3/renderer/user.rb",
|
||||
"lib/travis/api/v3/result.rb",
|
||||
"lib/travis/api/v3/router.rb",
|
||||
"lib/travis/api/v3/routes.rb",
|
||||
|
@ -183,8 +234,22 @@ Gem::Specification.new do |s|
|
|||
"lib/travis/api/v3/service.rb",
|
||||
"lib/travis/api/v3/service_index.rb",
|
||||
"lib/travis/api/v3/services.rb",
|
||||
"lib/travis/api/v3/services/find_repository.rb",
|
||||
"lib/travis/api/v3/services/branch/find.rb",
|
||||
"lib/travis/api/v3/services/build/find.rb",
|
||||
"lib/travis/api/v3/services/organization/find.rb",
|
||||
"lib/travis/api/v3/services/organizations/for_current_user.rb",
|
||||
"lib/travis/api/v3/services/repositories/for_current_user.rb",
|
||||
"lib/travis/api/v3/services/repository/disable.rb",
|
||||
"lib/travis/api/v3/services/repository/enable.rb",
|
||||
"lib/travis/api/v3/services/repository/find.rb",
|
||||
"lib/travis/api/v3/services/requests/create.rb",
|
||||
"lib/travis/api/v3/services/requests/find.rb",
|
||||
"lib/travis/api/workers/build_cancellation.rb",
|
||||
"lib/travis/api/workers/build_restart.rb",
|
||||
"lib/travis/api/workers/job_cancellation.rb",
|
||||
"lib/travis/api/workers/job_restart.rb",
|
||||
"lib/travis/private_key.rb",
|
||||
"lib/travis/sidekiq.rb",
|
||||
"public/favicon.ico",
|
||||
"public/images/result/canceled.png",
|
||||
"public/images/result/canceled.svg",
|
||||
|
@ -201,6 +266,7 @@ Gem::Specification.new do |s|
|
|||
"script/console",
|
||||
"script/repos_stats.rb",
|
||||
"script/server",
|
||||
"spec/integration/error_handling_spec.rb",
|
||||
"spec/integration/formats_handling_spec.rb",
|
||||
"spec/integration/responders_spec.rb",
|
||||
"spec/integration/routes.backup.rb",
|
||||
|
@ -278,9 +344,15 @@ Gem::Specification.new do |s|
|
|||
"spec/unit/middleware/user_agent_tracker_spec.rb",
|
||||
"spec/unit/responders/json_spec.rb",
|
||||
"spec/unit/responders/service_spec.rb",
|
||||
"spec/v3/extensions/belongs_to_spec.rb",
|
||||
"spec/v3/result_spec.rb",
|
||||
"spec/v3/service_index_spec.rb",
|
||||
"spec/v3/services/find_repository_spec.rb",
|
||||
"spec/v3/services/branch/find_spec.rb",
|
||||
"spec/v3/services/organization/find_spec.rb",
|
||||
"spec/v3/services/organizations/for_current_user_spec.rb",
|
||||
"spec/v3/services/repositories/for_current_user_spec.rb",
|
||||
"spec/v3/services/repository/find_spec.rb",
|
||||
"spec/v3/services/requests/create_spec.rb",
|
||||
"tmp/.gitkeep",
|
||||
"travis-api.gemspec"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user