-
Notifications
You must be signed in to change notification settings - Fork 65
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
Change CreatedAt types for KMS from string to time.Time #296
Conversation
Are any of the fields currently used? A bit worried about old minio + new mc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klauspost You're right. The most common used client would be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add custom unmarshalling for:
func (k *KMSKeyInfo) UnmarshalJSON(data []byte) error
func (k *KMSPolicyInfo) UnmarshalJSON(data []byte) error
func (k *KMSIdentityInfo) UnmarshalJSON(data []byte) error
func (k *KMSDescribePolicy) UnmarshalJSON(data []byte) error
func (k *KMSDescribeIdentity) UnmarshalJSON(data []byte) error
https://go.dev/play/p/7RUcboegpkz - yeah... It even triggers an error on empty strings :( |
4/5 of the structs aren't used anywhere meaningfully, that I can see. Think they are just vestigal. I would prefer to remove them, if we can? Please check my searches below:
The only place that catches my attention is in
For Which means existing builds of MinIO respond as follows:
(I would paste some test commands for play.min.io here but it's currently offline for maintenance) The struct To be effective it would have had to use time.IsZero and a pointer, here is how it should have worked: (comment/uncomment the Marshal function: https://play.golang.com/p/zCfC8oopWiu). Do we want to reproduce this pattern on KMSKeyInfo? It would probably be cleaner to other languages to omit the So what about other KMSKeyInfo usage? Here is a search:
I don't see anything noteworthy in the above results. This is a bit of a rabbit hole, I think to summarize my preferred actions are just to remove all the structs except KMSKeyInfo and not do any override of the unmarshalling. If you guys spot errors or potential issues in my reasoning, please link directly to lines of code so I can follow up and test, thanks. |
Note that these searches are not really valid. If you call I don't think we will have any issues. Go serializes a |
@klauspost Happy with the above? :) |
Discussion here: minio/minio#20223 (comment)
Other pull requests: