Skip to content
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

Fix create empty group #207

Merged
merged 2 commits into from
Jun 26, 2020
Merged

Fix create empty group #207

merged 2 commits into from
Jun 26, 2020

Conversation

razdob15
Copy link
Contributor

@razdob15 razdob15 commented Jun 25, 2020

Fix this bug-issue.
Now the developer can create a users-group by specifying only the group-identity and the service name, like this:
In Nifi:
nipyapi.security.create_service_user_group('groupname')

And In Nifi-Registry:
nipyapi.security.create_service_user_group('groupname', service='registry').

Solution Explanation:
My solution based on the type of the list that create_service_user_group passes to: nipyapi.nifi.UserGroupEntit or nipyapi.registry.UserGroup, that can be None. So If the given users argument is None, we can pass None to the constructors.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 66.323% when pulling c0dd352 on razdob15:fix-create-empty-group into e8a53b7 on Chaffelson:master.

@Chaffelson Chaffelson self-requested a review June 26, 2020 08:56
@Chaffelson Chaffelson added the bug label Jun 26, 2020
@Chaffelson Chaffelson added this to the 0.15.0 milestone Jun 26, 2020
@Chaffelson Chaffelson linked an issue Jun 26, 2020 that may be closed by this pull request
Copy link
Owner

@Chaffelson Chaffelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix, current tests pass though I note that we do not explicitly test this currently.

@Chaffelson Chaffelson merged commit de7bb47 into Chaffelson:master Jun 26, 2020
@Chaffelson
Copy link
Owner

Thanks for this fix! All merged.

@razdob15
Copy link
Contributor Author

razdob15 commented Jun 26, 2020

Perfect! Thank you, Dan.
Yes, I saw that the test_security.py tests are skipped... Why? Do you want me to fix these tests?

When I tested my code I connected to the secured-Nifi using the client certificate from ./nipyapi/demo/keys/, so I can do the same in test_securty.py and make sure all the tests are well written and worked well.
What do you think?

@Chaffelson
Copy link
Owner

Sorry I didn't see that you had commented further on this thread. Using the certs in demo/keys is how I test that particular Auth method, correct.
For the 0.15 release I'll leave it as it, I intend the next cycle to include a reworking of the security around authentication and tokens as I appear to have partially broken it in the 0.14.x line where I introduced BasicAuth as an option.

rsaggino added a commit to rsaggino/nipyapi that referenced this pull request Mar 29, 2021
* Patch for authentication issue (Chaffelson#193)

bumpversion to 0.14.3
Patch authentication issue to provide control for which authentication method is used in the config. Default is set to tokenAuth per previous behavior.

* Fix create empty group (Chaffelson#207)

* Fixed: Can create a group without pass users list

* Fixed: Can create a group without pass users list #1

* Allow deploy_template to use floats for positions (Chaffelson#191)

* Fix searching by unique identifier (Chaffelson#205)

* Fix the search according unique identifier

* Fix the search according unique identifier and update functions doc

* Minor typo correction

Co-authored-by: Dan Chaffelson <chaffelson@gmail.com>

* Added Parameter Contexts API to docs (Chaffelson#196)

* Added Parameter Contexts API to docs

* omit docs from coverage stats.

* keep track of the docker container object, and use it to kill the container when we are done (Chaffelson#203)

set auto remove to true

* fixed funnel position (Chaffelson#224)

* fixed funnel position, added test and contribution markdown

* removed duplicate file

* add functions for working reading template.xml files into TemplateEnt… (Chaffelson#223)

* add functions for working reading template.xml files into TemplateEntity instances

* undo formatting

* fix import

* fix test assertion and type

* Merge 0.15.0 release from Next to Master (Chaffelson#228)

* Add greedy control to get_processor to support exact matching on get operation
Add basicAuth support to nifi client and security module

* Add greedy control to several get_ functions to support exact matching on operation
Add basicAuth support to nifi client and security module
Updated test containers to 1.11.4
Added special case for 'root' to get_processor
Corrected list_invalid_processors to correctly report an empty list
update_controller now has a refresh option
get_template now correctly returns None if Template not found
is_endpoint_up now has a reasonable default timeout
automatically trim API endpoint URLs of trailing slash to avoid really really annoying errors

* Added configuration control for NiFi Authentication mode, either tokenAuth or basicAuth
Improved Linting and Logging statements in security.py

* Adding vscode to gitignore because OSX is bloody stupid and invasive

* Bump version: 0.14.1 → 0.14.2

* Bump version: 0.14.2 → 0.14.3

* Add greedy control to get_processor to support exact matching on get operation
Add basicAuth support to nifi client and security module

* Added configuration control for NiFi Authentication mode, either tokenAuth or basicAuth
Improved Linting and Logging statements in security.py

* Update base clients to NiFi-1.12.1 and Registry-0.7.0

* Add greedy control to get_processor to support exact matching on get operation
Add basicAuth support to nifi client and security module

* Added configuration control for NiFi Authentication mode, either tokenAuth or basicAuth
Improved Linting and Logging statements in security.py

* Update base clients to NiFi-1.12.1 and Registry-0.7.0

* Updated contributing.rst to include guidance on new features going into Next branch
Added create and delete port to _all_ in canvas.py. Fixes Chaffelson#192
Coding style fixes.

* Bump version: 0.14.3 → 0.15.0

* Doc fixes for release
Update history for release

* Update ruamel.yaml from 0.16.10 to 0.16.12 (Chaffelson#219)

* check-version should ignore snapshot (Chaffelson#232)

* add public api for deserializing models (Chaffelson#236)

* update dump so that it supports dumping swagger entities
this pr also fixes a bug where the nifi style of xml was resulting
in incomplete objects

* update to sync with next branch

Co-authored-by: Dan Chaffelson <chaffelson@gmail.com>
Co-authored-by: Raz <razdob@gmail.com>
Co-authored-by: Bernhard Geisberger <41961259+bgeisberger@users.noreply.github.com>
Co-authored-by: Eric Secules <esecules@gmail.com>
Co-authored-by: Otto Fowler <ottobackwards@gmail.com>
Co-authored-by: Clément Vial <clement.vial@gmail.com>
Co-authored-by: pyup.io bot <github-bot@pyup.io>
rsaggino pushed a commit to rsaggino/nipyapi that referenced this pull request Mar 29, 2021
* Fixed: Can create a group without pass users list

* Fixed: Can create a group without pass users list #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot create empty groups
3 participants