PermissionTarget fails when updating group-based targets
Opened this issue · 0 comments
Version:
2.8.2
Environment:
RHEL7
Scenario:
When attempting to update an existing permissions target with no user in the principal, the gem fails with an exception. I believe it's failing because the user portion of the principal is nil and abbreviate_principal is expecting it. This could cause a variety of issues since principal is not a required field in the PermissionTarget api, but the gem always uses it.
Steps to Reproduce:
Create a permission target with permissions assigned only by group, with no users. Attempt to update the repository list on the permissions target.
Expected Result:
The permissions target should update with the configuration parameters passed in to the request.
Actual Result:
NoMethodError: undefined method
'map' for nil:NilClass /home/ec2-user/.rvm/gems/ruby-2.4.2/gems/artifactory-2.8.2/lib/artifactory/resources/permission_target.rb:116:in
abbreviate_principal'
/home/ec2-user/.rvm/gems/ruby-2.4.2/gems/artifactory-2.8.2/lib/artifactory/resources/permission_target.rb:96:into_abbreviated' /home/ec2-user/.rvm/gems/ruby-2.4.2/gems/artifactory-2.8.2/lib/artifactory/resources/permission_target.rb:151:in
save'
/opt/scratch/src/platform-bootstrap-omnibus/rakelib/bug.rake:10:inblock (2 levels) in <top (required)>' /home/ec2-user/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in
eval'
/home/ec2-user/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `
Thank you!