Closed kevdoran closed 6 years ago
@ragerin here is my PR that is designed to make it easier to create and set the authentication token. See my example in nipyapi.demo.secure_connection.py
. Try it out and let me know if it addresses what you found in Issue #42. Thanks!
@Chaffelson - great feedback, thanks for taking the time to look this over!
I agree with your structural changes - will do that.
I think the introduction of 1.6.0-SNAPSHOT in the version metadata was unintentional. I was careful not to bring in anything (such as new endpoints or fields) that would not be available in NiFi 1.5.0 or NiFi Registry 0.1.0). I did leverage the snapshot swagger specs to test that fixes in those project do in fact fix the auto-generated python client. The version numbers must have slipped in, I'll revert those.
Yes, currently it's mostly been tested by by the demo.secure_connection module, as well as manual testing I've done (running that demo creates a nice test environment in docker that you can then interact with from a Python console using nipyapi).
When I extract the security helper methods to their own module as part of this PR, I'll also add unit tests for that module, so that will help a bit. A full integration test will require tweaks to the docker-compose and tox setup, which I do want to get to soon. If not as part of this PR, it might be worth opening a new issue to keep track of that item!
Thanks @kevdoran If you want to handle the structural changes and update this PR, then I'll merge it and prepare the stubs for the tox/fixture/docker-compose integration - I've done a lot of work with them recently so I think I can probably knock them together quite quickly, and this will get the PR in place for other users to test out. I'm happy with testing via the demo.secure_connection for this PR.
@Chaffelson sounds like a plan! thanks!
Closing this PR as work has moved to a new branch: https://github.com/Chaffelson/nipyapi/tree/pr/43
Adds the ability to connect to a secured NiFi or NiFi Registry instance using two methods:
A number of bugs in the swager-generated client, particularly for the registry client, have also been addressed.
Note: In order to make these improvements, modifications were made to the stock swagger-codegen Python generator templates that were originally used to bootstrap the REST API clients. The modified templates, along with instructions for how to used them to generate new client code as the Swagger specs evolve, were added to this repository. A note of attribution to the swagger-codegen project was added to the LICENSE.