Closed seiimonn closed 5 months ago
Hi @seiimonn , Sorry for the delay in response. We are unable to reproduce the issue on our end with similar environment. Also can you please elaborate more on how Splunk allows users to have non existent roles
, which may help us to reproduce the issue.
Hi @akaila-splunk It's a bit tricky to reproduce. I was only able to get this situation once and I think the order was the following.
Somehow the role is still in the users roles even though it does not exist anymore in the system. But in general I think it makes sense to check if an object is existing before getting it from the API.
Hi @seiimonn , we have tried the below steps, but couldn't reproduce the issue.
Note - When we verified the user roles through code and UI, the deleted role was not present. So please let us know if we have missed any step while reproducing the issue.
Hi @seiimonn , sorry for the delay but we have published a new version of Python SDK v2.0.1 with the suggested change. Request you to test with the latest SDK and let us know if the issue is resolved. Thanks
Closing the Issue as we haven't received any response. @seiimonn please reopen the Issue if you are still facing the issue.
Describe the bug As Splunk allows users to have non existent roles, calling role_entites on a user with roles assigned that are not existent leads to exceptions.
Defective code:
Possible solution:
Or with (I suppose more calls to the API)
return [self.service.roles[name] for name in self.content.roles if name in self.content.roles]
Splunk (please complete the following information):
SDK (please complete the following information):