Skip to content

Commit

Permalink
(PUP-3851) Remove v2.0 endpoints
Browse files Browse the repository at this point in the history
Remove the v2.0 endpoints (the only one of which is `/v2.0/environmnets`),
since there is now a prefix before all routes, so it is not backwards
compatible.
  • Loading branch information
rlinehan committed Jan 27, 2015
1 parent 7556106 commit 826cee5
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 239 deletions.
Expand Up @@ -30,7 +30,7 @@
step 'run master; ensure production environment created'
with_puppet_running_on(master, master_opts, testdir) do
if master.is_using_passenger?
on(master, "curl -k --cert #{cert_path} --key #{key_path} --cacert #{cacert_path} https://localhost:8140/puppet/v2.0/environments")
on(master, "curl -k --cert #{cert_path} --key #{key_path} --cacert #{cacert_path} https://localhost:8140/puppet/v3/environments")
end
on(master, "test -d '#{testdir}/environments/production'")

Expand Down
4 changes: 0 additions & 4 deletions conf/auth.conf
Expand Up @@ -60,10 +60,6 @@
### Authenticated ACLs - these rules apply only when the client
### has a valid certificate and is thus authenticated

path /puppet/v2.0/environments
method find
allow *

path /puppet/v3/environments
method find
allow *
Expand Down
3 changes: 0 additions & 3 deletions lib/puppet/network/authconfig.rb
Expand Up @@ -16,9 +16,6 @@ def self.ca_url_prefix

def self.default_acl
[
# Master API V2.0
{ :acl => "#{master_url_prefix}/v2.0/environments", :method => :find, :allow => '*', :authenticated => true },

# Master API V3
{ :acl => "#{master_url_prefix}/v3/environments", :method => :find, :allow => '*', :authenticated => true },

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/network/http.rb
Expand Up @@ -13,7 +13,6 @@ module Puppet::Network::HTTP
require 'puppet/network/http/api/ca'
require 'puppet/network/http/api/ca/v1'
require 'puppet/network/http/api/master'
require 'puppet/network/http/api/master/v2'
require 'puppet/network/http/api/master/v3'
require 'puppet/network/http/handler'
require 'puppet/network/http/response'
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/network/http/api.rb
Expand Up @@ -12,7 +12,6 @@ def self.master_routes
Puppet::Network::HTTP::Route.path(master_prefix).
any.
chain(Puppet::Network::HTTP::API::Master::V3.routes,
Puppet::Network::HTTP::API::Master::V2.routes,
Puppet::Network::HTTP::API.not_found)
end

Expand Down
26 changes: 0 additions & 26 deletions lib/puppet/network/http/api/master/v2.rb

This file was deleted.

15 changes: 0 additions & 15 deletions lib/puppet/network/http/api/master/v2/authorization.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/puppet/network/http/api/master/v2/environments.rb

This file was deleted.

57 changes: 0 additions & 57 deletions spec/unit/network/http/api/master/v2/authorization_spec.rb

This file was deleted.

63 changes: 0 additions & 63 deletions spec/unit/network/http/api/master/v2/environments_spec.rb

This file was deleted.

25 changes: 0 additions & 25 deletions spec/unit/network/http/api/master/v2_spec.rb

This file was deleted.

9 changes: 1 addition & 8 deletions spec/unit/network/http/api_spec.rb
Expand Up @@ -67,14 +67,7 @@ def respond(text)
expect(res[:status]).to eq(200)
end

it "responds to v2.0 environments requests" do
req = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_prefix}/v2.0/environments")
res = {}
handler.process(req, res)
expect(res[:status]).to eq(200)
end

it "responds with a not found error to non-v3/2.0 requests" do
it "responds with a not found error to non-v3 requests" do
req = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_prefix}/unknown")
res = {}
handler.process(req, res)
Expand Down

0 comments on commit 826cee5

Please sign in to comment.