Commit a7360736 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

[OPENBUS-2864] Erros de validadores de senha ou token resultam em ServiceFailure para o cliente

- Correções devido a uma confusão no uso da função lançamento da exceção ServiceFailure e seu repID.
- Implementação de testes.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/branches/02_00_00@168726 ae0415b3-e90b-0410-900d-d0be9363c56b
parent dec1870b
......@@ -53,6 +53,7 @@ local assert = idl.serviceAssertion
local BusEntity = idl.const.BusEntity
local BusLogin = idl.const.BusLogin
local EncryptedBlockSize = idl.const.EncryptedBlockSize
local ServiceFailureId = idl.types.services.ServiceFailure
local ServiceFailure = idl.throw.services.ServiceFailure
local accexp = idl.throw.services.access_control
local AccessDenied = accexp.AccessDenied
......@@ -310,7 +311,7 @@ function AccessControl:__init(data)
entity = login.entity,
})
local ok, ex = pcall(login.remove, login) -- catch I/O errors
if not ok and (type(ex)~="table" or ex._repid~=ServiceFailure) then
if not ok and (type(ex)~="table" or ex._repid~=ServiceFailureId) then
error(ex)
end
end
......
......@@ -384,7 +384,9 @@ Options:
log:config(msg.BadPasswordLimitedTries:tag{limit=Configs.badpasswordtries})
log:config(msg.BadPasswordTotalLimit:tag{value=Configs.badpasswordlimit})
log:config(msg.BadPasswordMaxRate:tag{value=Configs.badpasswordrate})
log:config(msg.MaximumChannelLimit:tag{value=Configs.maxchannels})
if orb.maxchannels ~= nil then
log:config(msg.MaximumChannelLimit:tag{value=Configs.maxchannels})
end
if not params.enforceAuth then
log:config(msg.OfferAuthorizationDisabled)
end
......
return function (configs)
return function (entity, password)
if entity == "error" and password == "Oops!" then
error("Oops!")
end
end
end
......@@ -45,10 +45,11 @@ passwordpenalty=`$runconsole -l openbus.test.configs -e 'print(passwordpenalty)'
genkey $OPENBUS_TEMP/$name
$buscore \
-port=$port \
-database=$OPENBUS_TEMP/$name.db \
-privatekey=$OPENBUS_TEMP/$name.key \
-port $port \
-database $OPENBUS_TEMP/$name.db \
-privatekey $OPENBUS_TEMP/$name.key \
-validator openbus.test.core.services.TesterUserValidator \
-validator openbus.test.core.services.BadPasswordValidator \
-admin $admin \
-badpasswordpenalty $passwordpenalty \
-leasetime $leasetime \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment