You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are quite a few structs in libcnb that are both public read/writeable. We should make sure that any fields generated by the library and expected to have a consistent value cannot be changed by end users.
The text was updated successfully, but these errors were encountered:
@samj1912 What were you thinking here. As far as I know, there's no magic "read-only" flag for structs. I think we'd have to change all the fields to private and export getters for the values, which would be a pretty big API change.
I've not observed this as a problem, having someone change fields that shouldn't be changed. You're really just shooting yourself in the foot by doing that. Have you observed this as an issue? or were you thinking of this as a nice to have?
We've got quite a few changes to the API already, just trying to gauge the impact of this change and see if it's worth adding more changes to the list. Thanks
I'm going to close this as we've cut release v2 and this didn't make it in. If we want to revisit this, I'll let whomever is interested in driving the effort open a new issue.
There are quite a few structs in libcnb that are both public read/writeable. We should make sure that any fields generated by the library and expected to have a consistent value cannot be changed by end users.
The text was updated successfully, but these errors were encountered: