diff options
| author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-03-30 23:10:19 +0200 |
|---|---|---|
| committer | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-04-23 20:52:03 +0200 |
| commit | c0c824548e03e603f5a51c61262ae6a58e7549fb (patch) | |
| tree | c2fff712f555006a7569ec1b2b4324311532b375 /spec/unit/network/rest_authconfig.rb | |
| parent | aac996ed17e0ec72c5098b1225eb159aae4901fc (diff) | |
| download | puppet-c0c824548e03e603f5a51c61262ae6a58e7549fb.tar.gz puppet-c0c824548e03e603f5a51c61262ae6a58e7549fb.tar.xz puppet-c0c824548e03e603f5a51c61262ae6a58e7549fb.zip | |
Refactor rest authorization to raise exceptions deeper
The idea is to raise an AuthorizationException at the same place
we check the authorization instead of in an upper level to be
able to spot where the authorization took place in the exception
backtrace.
Moreover, this changes also makes Rights::allowed? to return
the matching acl so that the upper layer can have a chance to
report which ACL resulted in the match.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec/unit/network/rest_authconfig.rb')
| -rwxr-xr-x | spec/unit/network/rest_authconfig.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/unit/network/rest_authconfig.rb b/spec/unit/network/rest_authconfig.rb index ea5a82cce..7dc97382c 100755 --- a/spec/unit/network/rest_authconfig.rb +++ b/spec/unit/network/rest_authconfig.rb @@ -33,7 +33,7 @@ describe Puppet::Network::RestAuthConfig do end it "should ask for authorization to the ACL subsystem" do - @acl.expects(:allowed?).with("/path/to/resource", "me", "127.0.0.1", :save, :env) + @acl.expects(:fail_on_deny).with("/path/to/resource", :node => "me", :ip => "127.0.0.1", :method => :save, :environment => :env) @authconfig.allowed?(@request) end |
