Skip to content

Possible fix for #207? #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Possible fix for #207? #235

wants to merge 6 commits into from

Conversation

wcastello
Copy link

@wcastello wcastello commented Jan 6, 2019

Could anyone please check if this would be ok for fixing #207 ?

Uses __ for service.post() on binding.py for arguments like app, owner, sharing needed for example for post requests to the /acl path for changing permissions and also adds an access_update() to client.py so that the client can transparently call an update in permissions without having to use the __ in the start of those arguments.

At least I believe this approach won't cause a breaking change by changing the method signature as said by @tdhellmann on #208

When one of the query parameters is, for instance, owner, app or sharing, as when sending a POST request to the + /acl for updating permissions, this call would normally fail because those are stripped out of the actual self.http.post() and used only for self._abspath(). This is a workaround for calling post() with those parameters starting with __. The query dict is then rebuilt stripping the __ so that in the end both self._abspath() and self.http.post() can receive owner, app and sharing arguments.
This access_update() uses service.post() as changed in 0724a3d
@wcastello
Copy link
Author

Hum, this is breaking now because there are calls like post(__conf=name), would have to think of another prefix or something.

Use _dup__ as per service.post for app/sharing/owner arguments that need to be sent to http.post()
@wcastello
Copy link
Author

Ok I'll look into the tests better later to see what's happening but it still seems to be due to the prefix addition/strip.

my bad, lstrip() clearly doesn't make sense as it takes chars as arguments not a full prefix so 'password'.lstrip('_dup__') == 'assword'
missed .get on self.access for 'sharing'
@fantavlik
Copy link
Contributor

I believe this has been addressed in #352 and now released as https://github.com/splunk/splunk-sdk-python/releases/tag/1.6.15 please upgrade via pip install splunk-sdk==1.6.15 and let us know if you continue to see these issues.

@fantavlik fantavlik closed this Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants