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

Setting a Policy type Custom Field by label fails #131

Closed
Saadi6 opened this issue Jul 13, 2022 · 0 comments · Fixed by #132
Closed

Setting a Policy type Custom Field by label fails #131

Saadi6 opened this issue Jul 13, 2022 · 0 comments · Fixed by #132

Comments

@Saadi6
Copy link
Collaborator

Saadi6 commented Jul 13, 2022

Environment

Operating System: any
VenafiPS version: 4.6.0
PowerShell version: 5.1+
TPP version (if applicable): 21.4

Steps to reproduce

Reading a Custom Field using its label works, however, setting the value by label returns an error when this custom field can be controlled by Policy. You can still set the value for such a custom field by its' guid.

Custom fields that are not policy enabled can be set by their label.

PS /Users/saad.humayun> Set-TppAttribute -Path '\VED\Policy\Certificates\Teams\New team' -Policy -ClassName 'x509 certificate' -Attribute @{'SNow_number'='CI45332'}
Set-TppAttribute: Write policy for "x509 certificate:SNow_number"; "\VED\Policy\Certificates\Teams\New team" CacheEntryNotFound.

Set value for non-policy custom field by label works.

PS /Users/saad.humayun> Set-TppAttribute -Path '\VED\Policy\Certificates\Teams\New team\test cert' -Attribute @{'Application Id'='My App 23'}

Expected behavior

Since reading work by label, so should writing.

Actual behavior

An error is returned.

More Info

If the provided custom field label conflicts with a built-in attribute then an error can be returned. Alternatively, please add an optional switch in the function to explicitly state the passed attribute is a custom field.

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 a pull request may close this issue.

1 participant