thycotic.secretserver icon indicating copy to clipboard operation
thycotic.secretserver copied to clipboard

method ‎Template::GetField does not warn user when attempting to get nonexistent field

Open jagger opened this issue 1 year ago • 0 comments

https://github.com/thycotic-ps/thycotic.secretserver/blob/996427548cdefd482d1c0b14ec0824e7a4633e82/src/Thycotic.SecretServer/classes/secret-templates/Template.cs#L28C4-L28C4

Field slugs are case sensitive leading to confusion when attempting to retrieve values from the API. If I attempt to call getField('User-Name') and the underlying slug is user-name a blank field is returned rather than receiving an error. This is also compounded by the method referencing a field and users often assume we are using the field name rather than the slug so 'User Name' would also come back with a blank field rather than throwing an error.

We should not use a .toLower() on the values as when the field is sent back to secret server the slug will be updated by Set-TssSecretField and we should avoid making any changes (even minor) unless specifically made by the user.

jagger avatar Aug 18 '23 22:08 jagger