imperva / imperva/imperva-sdk-python

mx.IsAuthenticated returns true, nonetheless - user is not logged in. Perhaps a better means of checking whether the user is Authenticated is required

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14
Forks
10
PR merge metrics
No merged PRs in 30d

Description

`
mx.IsAuthenticated
Out[396]: True

pol.Severity = 'medium'
Traceback (most recent call last):

File "", line 1, in
pol.Severity = 'medium'

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/WebServiceCustomPolicy.py", line 154, in Severity
self._connection._update_web_service_custom_policy(Name=self._Name, Parameter='severity', Value=Severity)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 934, in _update_web_service_custom_policy
return WebServiceCustomPolicy._update_web_service_custom_policy(connection=self, Name=Name, Parameter=Parameter, Value=Value)

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/WebServiceCustomPolicy.py", line 337, in _update_web_service_custom_policy
connection._mx_api('PUT', '/conf/webServiceCustomPolicies/%s' % Name, data=json.dumps(body))

File "/anaconda3/lib/python3.7/site-packages/imperva_sdk-0.2.0-py3.7.egg/imperva_sdk/MxConnection.py", line 257, in _mx_api
raise MxException("MX returned errors - %s" % str(error_message))

MxException: MX returned errors - [{'error-code': 'IMP-10000', 'description': 'User is not logged in'}]
`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failing policy update and compare mx.IsAuthenticated with the _mx_api call that raises the “User is not logged in” error. Start with MxConnection.py and WebServiceCustomPolicy.py, especially _mx_api and _update_web_service_custom_policy. Done means the authentication check reliably reflects whether the subsequent API operation can run, with a test covering this mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.