Skip to content
Permalink
Browse files

Merge pull request #1634 from privacyidea/branch-3.0

Merge current branch-3.0 into master
  • Loading branch information...
cornelinux committed May 18, 2019
2 parents 4f3f8a3 + 9b0054c commit 5cd6730e3925931740e0ea72c051140f17c57aff
Showing with 16 additions and 1 deletion.
  1. +6 −1 privacyidea/api/lib/prepolicy.py
  2. +10 −0 tests/test_api_roles.py
@@ -1218,12 +1218,17 @@ def is_remote_user_allowed(req):
get_from_config(SYSCONF.OVERRIDECLIENT))
if "policy_object" not in g:
g.policy_object = PolicyClass()
if "audit_object" in g:
audit_data = g.audit_object.audit_data
else:
audit_data = None

ruser_active = g.policy_object.get_action_values(ACTION.REMOTE_USER,
scope=SCOPE.WEBUI,
user=loginname,
realm=realm,
client=g.client_ip,
audit_data=g.audit_object.audit_data)
audit_data=audit_data)

res = bool(ruser_active)

@@ -84,6 +84,16 @@ def test_02_REMOTE_USER(self):
self.assertEqual(result.get("value").get("role"), "admin")
self.assertTrue(result.get("status"), res.data)

# Check if the /auth request writes the policyname "remote" to the audit entry
with self.app.test_request_context('/audit/',
method='GET',
headers={'Authorization':
self.at}):
res = self.app.full_dispatch_request()
self.assertTrue(res.status_code == 200, res)
auditentry = res.json.get("result").get("value").get("auditdata")[0]
self.assertTrue("remote" in auditentry.get("policies"))

self.setUp_user_realms()
# User "cornelius" from the default realm as normale user
with self.app.test_request_context('/auth', method='POST',

0 comments on commit 5cd6730

Please sign in to comment.
You can’t perform that action at this time.