diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2011-05-31 20:01:36 +0200 |
|---|---|---|
| committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-07-26 14:04:28 -0700 |
| commit | 7e6fc0d80ccd29f206c3b56960ee1eef3afc33a3 (patch) | |
| tree | aae7597cf9e6730a27506877774cf76eaf268837 /spec/unit | |
| parent | 6401dfe5602fd39cc59ec1f1b3822110e4ad864a (diff) | |
| download | puppet-7e6fc0d80ccd29f206c3b56960ee1eef3afc33a3.tar.gz puppet-7e6fc0d80ccd29f206c3b56960ee1eef3afc33a3.tar.xz puppet-7e6fc0d80ccd29f206c3b56960ee1eef3afc33a3.zip | |
Deprecate RestAuthConfig#allowed? in favor of #check_authorization
#allowed? was a poorly named method since it isn't actually a predicate
method. Instead of returning a boolean, this methods throws an
exception when the access is denied (in order to keep the full context
of what ACE triggered the deny).
Given that #allowed? was overriding the behavior from AuthConfig, we
leave a version of #allowed? in place that will issue a deprecation
warning before delegating to #check_authorization. Once support for
XML-RPC agents is removed from the master, we will be able to remove
this delegation, since there should no longer be a reason for a
distinction between AuthConfig and RestAuthConfig.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec/unit')
| -rwxr-xr-x | spec/unit/network/rest_authconfig_spec.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/unit/network/rest_authconfig_spec.rb b/spec/unit/network/rest_authconfig_spec.rb index e1403997f..bebbb874f 100755 --- a/spec/unit/network/rest_authconfig_spec.rb +++ b/spec/unit/network/rest_authconfig_spec.rb @@ -29,7 +29,7 @@ describe Puppet::Network::RestAuthConfig do params = {:ip => "127.0.0.1", :node => "me", :environment => :env, :authenticated => true} @acl.expects(:is_request_forbidden_and_why?).with("path", :save, "to/resource", params).returns(nil) - @authconfig.allowed?("path", :save, "to/resource", params) + @authconfig.check_authorization("path", :save, "to/resource", params) end describe "when defining an acl with mk_acl" do |
