From ebadfdae1d975a5a937a1f1d67fd909b728c7386 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Sun, 6 Sep 2020 19:58:08 -0600 Subject: [PATCH] add support for KIP-554 --- README.md | 1 + generate/DEFINITIONS | 83 +++++ pkg/kerr/kerr.go | 6 + pkg/kmsg/generated.go | 758 ++++++++++++++++++++++++++++++++++++++- pkg/kversion/kversion.go | 5 + 5 files changed, 852 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ac7b419..ae405067 100644 --- a/README.md +++ b/README.md @@ -325,6 +325,7 @@ a protocol is supported by code generation. - [KIP-525](https://cwiki.apache.org/confluence/display/KAFKA/KIP-525+-+Return+topic+metadata+and+configs+in+CreateTopics+response) (create topics v5 returns configs; 2.4.0) - [KIP-526](https://cwiki.apache.org/confluence/display/KAFKA/KIP-526%3A+Reduce+Producer+Metadata+Lookups+for+Large+Number+of+Topics) (reduce metadata lookups; done minus part 2, which we wont do) - [KIP-546](https://cwiki.apache.org/confluence/display/KAFKA/KIP-546%3A+Add+Client+Quota+APIs+to+the+Admin+Client) (client quota APIs; 2.5.0) +- [KIP-554](https://cwiki.apache.org/confluence/display/KAFKA/KIP-554%3A+Add+Broker-side+SCRAM+Config+API) (broker side SCRAM API; 2.7.0) - [KIP-559](https://cwiki.apache.org/confluence/display/KAFKA/KIP-559%3A+Make+the+Kafka+Protocol+Friendlier+with+L7+Proxies) (protocol info in sync / join; 2.5.0) - [KIP-569](https://cwiki.apache.org/confluence/display/KAFKA/KIP-569%3A+DescribeConfigsResponse+-+Update+the+schema+to+include+additional+metadata+information+of+the+field) (doc/type in describe configs; 2.6.0) - [KIP-570](https://cwiki.apache.org/confluence/display/KAFKA/KIP-570%3A+Add+leader+epoch+in+StopReplicaRequest) (leader epoch in stop replica; 2.6.0) diff --git a/generate/DEFINITIONS b/generate/DEFINITIONS index a7eb502a..7db6c688 100644 --- a/generate/DEFINITIONS +++ b/generate/DEFINITIONS @@ -3529,3 +3529,86 @@ AlterClientQuotasResponse => Type: string // Name is the name of the entity, or null for the default. Name: nullable-string + +// DescribeUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced +// with Kafka 2.7.0, describes user SCRAM credentials. +// +// This request was introduced as part of the overarching KIP-500 initiative, +// which is to remove Zookeeper as a dependency. +// +// This request requires DESCRIBE on CLUSTER. +DescribeUserSCRAMCredentialsRequest => key 50, max version 0, flexible v0+ + // The users to describe, or null to describe all. + Users: [=>] + // The user name. + Name: string + +// DescribeUserSCRAMCredentialsResponse is a response for a +// DescribeUserSCRAMCredentialsRequest. +DescribeUserSCRAMCredentialsResponse => + // ThrottleMillis is how long of a throttle Kafka will apply to the client + // after responding to this request. + ThrottleMillis: int32 + // The request-level error code. This is 0 except for user or infra issues. + ErrorCode: int16 + // The request-level error message, if any. + ErrorMessage: nullable-string + // Results for descriptions, one per user. + Results: [=>] + // The name this result corresponds to. + User: string + // The user-level error code. + ErrorCode: int16 + // The user-level error message, if any. + ErrorMessage: nullable-string + // Information about the SCRAM credentials for this user. + CredentialInfos: [=>] + // The SCRAM mechanism for this user, where 0 is UNKNOWN, 1 is SCRAM_SHA_256, + // and 2 is SCRAM_SHA_512. + Mechanism: int8 + // The number of iterations used in the SCRAM credential. + Iteractions: int32 + +// AlterUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced +// with Kafka 2.7.0, alters or deletes user SCRAM credentials. +// +// This request was introduced as part of the overarching KIP-500 initiative, +// which is to remove Zookeeper as a dependency. +// +// This request requires ALTER on CLUSTER. +AlterUserSCRAMCredentialsRequest => key 51, max version 0, flexible v0+, admin + // The SCRAM credentials to remove. + Deletions: [=>] + // The user name to match for removal. + Name: string + // The mechanism for the user name to remove. + Mechanism: int8 + // The SCRAM credentials to update or insert. + Upsertions: [=>] + // The user name to use. + Name: string + // The mechanism to use for creating. See + // DescribeUserSCRAMCredentialsResponse for more information. + Mechanism: int8 + // The number of iterations to use. This must be more than the minimum for + // the mechanism and cannot be more than 16384. + Iterations: int32 + // A random salt generated by the client. + Salt: bytes + // The salted password to use. + SaltedPassword: bytes + +// AlterUserSCRAMCredentialsResponse is a response for an +// AlterUserSCRAMCredentialsRequest. +AlterUserSCRAMCredentialsResponse => + // ThrottleMillis is how long of a throttle Kafka will apply to the client + // after responding to this request. + ThrottleMillis: int32 + // The results for deletions and upsertions. + Results: [=>] + // The name this result corresponds to. + User: string + // The user-level error code. + ErrorCode: int16 + // The user-level error message, if any. + ErrorMessage: nullable-string diff --git a/pkg/kerr/kerr.go b/pkg/kerr/kerr.go index b810e866..831c9787 100644 --- a/pkg/kerr/kerr.go +++ b/pkg/kerr/kerr.go @@ -134,6 +134,9 @@ var ( UnstableOffsetCommit = &Error{"UNSTABLE_OFFSET_COMMIT", 88, true, "There are unstable offsets that need to be cleared."} ThrottlingQuotaExceeded = &Error{"THROTTLING_QUOTA_EXCEEDED", 89, true, "The throttling quota has been exceeded."} ProducerFenced = &Error{"PRODUCER_FENCED", 90, true, "There is a newer producer with the same transactionalId which fences the current one."} + ResourceNotFound = &Error{"RESOURCE_NOT_FOUND", 91, false, "A request illegally referred to a resource that does not exist."} + DuplicateResource = &Error{"DUPLICATE_RESOURCE", 92, false, "A request illegally referred to the same resource twice."} + UnacceptableCredential = &Error{"UNACCEPTABLE_CREDENTIAL", 91, false, "Requested credential would not meet criteria for acceptability."} ) var code2err = map[int16]error{ @@ -229,4 +232,7 @@ var code2err = map[int16]error{ 88: UnstableOffsetCommit, 89: ThrottlingQuotaExceeded, 90: ProducerFenced, + 91: ResourceNotFound, + 92: DuplicateResource, + 93: UnacceptableCredential, } diff --git a/pkg/kmsg/generated.go b/pkg/kmsg/generated.go index 2499de70..d2414479 100644 --- a/pkg/kmsg/generated.go +++ b/pkg/kmsg/generated.go @@ -6,7 +6,7 @@ import "github.com/twmb/kafka-go/pkg/kbin" // MaxKey is the maximum key used for any messages in this package. // Note that this value will change as Kafka adds more messages. -const MaxKey = 49 +const MaxKey = 51 // MessageV0 is the message format Kafka used prior to 0.10. // @@ -20262,6 +20262,750 @@ func (v *AlterClientQuotasResponse) ReadFrom(src []byte) error { return b.Complete() } +type DescribeUserSCRAMCredentialsRequestUser struct { + // The user name. + Name string +} + +// DescribeUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced +// with Kafka 2.7.0, describes user SCRAM credentials. +// +// This request was introduced as part of the overarching KIP-500 initiative, +// which is to remove Zookeeper as a dependency. +// +// This request requires DESCRIBE on CLUSTER. +type DescribeUserSCRAMCredentialsRequest struct { + // Version is the version of this message used with a Kafka broker. + Version int16 + + // The users to describe, or null to describe all. + Users []DescribeUserSCRAMCredentialsRequestUser +} + +func (*DescribeUserSCRAMCredentialsRequest) Key() int16 { return 50 } +func (*DescribeUserSCRAMCredentialsRequest) MaxVersion() int16 { return 0 } +func (v *DescribeUserSCRAMCredentialsRequest) SetVersion(version int16) { v.Version = version } +func (v *DescribeUserSCRAMCredentialsRequest) GetVersion() int16 { return v.Version } +func (v *DescribeUserSCRAMCredentialsRequest) IsFlexible() bool { return v.Version >= 0 } +func (v *DescribeUserSCRAMCredentialsRequest) ResponseKind() Response { + return &DescribeUserSCRAMCredentialsResponse{Version: v.Version} +} + +func (v *DescribeUserSCRAMCredentialsRequest) AppendTo(dst []byte) []byte { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + { + v := v.Users + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.Name + if isFlexible { + dst = kbin.AppendCompactString(dst, v) + } else { + dst = kbin.AppendString(dst, v) + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + return dst +} +func (v *DescribeUserSCRAMCredentialsRequest) ReadFrom(src []byte) error { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + b := kbin.Reader{Src: src} + s := v + { + v := s.Users + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]DescribeUserSCRAMCredentialsRequestUser, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + var v string + if isFlexible { + v = b.CompactString() + } else { + v = b.String() + } + s.Name = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.Users = v + } + if isFlexible { + SkipTags(&b) + } + return b.Complete() +} + +type DescribeUserSCRAMCredentialsResponseResultCredentialInfo struct { + // The SCRAM mechanism for this user, where 0 is UNKNOWN, 1 is SCRAM_SHA_256, + // and 2 is SCRAM_SHA_512. + Mechanism int8 + + // The number of iterations used in the SCRAM credential. + Iteractions int32 +} +type DescribeUserSCRAMCredentialsResponseResult struct { + // The name this result corresponds to. + User string + + // The user-level error code. + ErrorCode int16 + + // The user-level error message, if any. + ErrorMessage *string + + // Information about the SCRAM credentials for this user. + CredentialInfos []DescribeUserSCRAMCredentialsResponseResultCredentialInfo +} + +// DescribeUserSCRAMCredentialsResponse is a response for a +// DescribeUserSCRAMCredentialsRequest. +type DescribeUserSCRAMCredentialsResponse struct { + // Version is the version of this message used with a Kafka broker. + Version int16 + + // ThrottleMillis is how long of a throttle Kafka will apply to the client + // after responding to this request. + ThrottleMillis int32 + + // The request-level error code. This is 0 except for user or infra issues. + ErrorCode int16 + + // The request-level error message, if any. + ErrorMessage *string + + // Results for descriptions, one per user. + Results []DescribeUserSCRAMCredentialsResponseResult +} + +func (*DescribeUserSCRAMCredentialsResponse) Key() int16 { return 50 } +func (*DescribeUserSCRAMCredentialsResponse) MaxVersion() int16 { return 0 } +func (v *DescribeUserSCRAMCredentialsResponse) SetVersion(version int16) { v.Version = version } +func (v *DescribeUserSCRAMCredentialsResponse) GetVersion() int16 { return v.Version } +func (v *DescribeUserSCRAMCredentialsResponse) IsFlexible() bool { return v.Version >= 0 } +func (v *DescribeUserSCRAMCredentialsResponse) RequestKind() Request { + return &DescribeUserSCRAMCredentialsRequest{Version: v.Version} +} + +func (v *DescribeUserSCRAMCredentialsResponse) AppendTo(dst []byte) []byte { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + { + v := v.ThrottleMillis + dst = kbin.AppendInt32(dst, v) + } + { + v := v.ErrorCode + dst = kbin.AppendInt16(dst, v) + } + { + v := v.ErrorMessage + if isFlexible { + dst = kbin.AppendCompactNullableString(dst, v) + } else { + dst = kbin.AppendNullableString(dst, v) + } + } + { + v := v.Results + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.User + if isFlexible { + dst = kbin.AppendCompactString(dst, v) + } else { + dst = kbin.AppendString(dst, v) + } + } + { + v := v.ErrorCode + dst = kbin.AppendInt16(dst, v) + } + { + v := v.ErrorMessage + if isFlexible { + dst = kbin.AppendCompactNullableString(dst, v) + } else { + dst = kbin.AppendNullableString(dst, v) + } + } + { + v := v.CredentialInfos + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.Mechanism + dst = kbin.AppendInt8(dst, v) + } + { + v := v.Iteractions + dst = kbin.AppendInt32(dst, v) + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + return dst +} +func (v *DescribeUserSCRAMCredentialsResponse) ReadFrom(src []byte) error { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + b := kbin.Reader{Src: src} + s := v + { + v := b.Int32() + s.ThrottleMillis = v + } + { + v := b.Int16() + s.ErrorCode = v + } + { + var v *string + if isFlexible { + v = b.CompactNullableString() + } else { + v = b.NullableString() + } + s.ErrorMessage = v + } + { + v := s.Results + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]DescribeUserSCRAMCredentialsResponseResult, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + var v string + if isFlexible { + v = b.CompactString() + } else { + v = b.String() + } + s.User = v + } + { + v := b.Int16() + s.ErrorCode = v + } + { + var v *string + if isFlexible { + v = b.CompactNullableString() + } else { + v = b.NullableString() + } + s.ErrorMessage = v + } + { + v := s.CredentialInfos + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]DescribeUserSCRAMCredentialsResponseResultCredentialInfo, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + v := b.Int8() + s.Mechanism = v + } + { + v := b.Int32() + s.Iteractions = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.CredentialInfos = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.Results = v + } + if isFlexible { + SkipTags(&b) + } + return b.Complete() +} + +type AlterUserSCRAMCredentialsRequestDeletion struct { + // The user name to match for removal. + Name string + + // The mechanism for the user name to remove. + Mechanism int8 +} +type AlterUserSCRAMCredentialsRequestUpsertion struct { + // The user name to use. + Name string + + // The mechanism to use for creating. See + // DescribeUserSCRAMCredentialsResponse for more information. + Mechanism int8 + + // The number of iterations to use. This must be more than the minimum for + // the mechanism and cannot be more than 16384. + Iterations int32 + + // A random salt generated by the client. + Salt []byte + + // The salted password to use. + SaltedPassword []byte +} + +// AlterUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced +// with Kafka 2.7.0, alters or deletes user SCRAM credentials. +// +// This request was introduced as part of the overarching KIP-500 initiative, +// which is to remove Zookeeper as a dependency. +// +// This request requires ALTER on CLUSTER. +type AlterUserSCRAMCredentialsRequest struct { + // Version is the version of this message used with a Kafka broker. + Version int16 + + // The SCRAM credentials to remove. + Deletions []AlterUserSCRAMCredentialsRequestDeletion + + // The SCRAM credentials to update or insert. + Upsertions []AlterUserSCRAMCredentialsRequestUpsertion +} + +func (*AlterUserSCRAMCredentialsRequest) Key() int16 { return 51 } +func (*AlterUserSCRAMCredentialsRequest) MaxVersion() int16 { return 0 } +func (v *AlterUserSCRAMCredentialsRequest) SetVersion(version int16) { v.Version = version } +func (v *AlterUserSCRAMCredentialsRequest) GetVersion() int16 { return v.Version } +func (v *AlterUserSCRAMCredentialsRequest) IsFlexible() bool { return v.Version >= 0 } +func (v *AlterUserSCRAMCredentialsRequest) IsAdminRequest() {} +func (v *AlterUserSCRAMCredentialsRequest) ResponseKind() Response { + return &AlterUserSCRAMCredentialsResponse{Version: v.Version} +} + +func (v *AlterUserSCRAMCredentialsRequest) AppendTo(dst []byte) []byte { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + { + v := v.Deletions + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.Name + if isFlexible { + dst = kbin.AppendCompactString(dst, v) + } else { + dst = kbin.AppendString(dst, v) + } + } + { + v := v.Mechanism + dst = kbin.AppendInt8(dst, v) + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + { + v := v.Upsertions + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.Name + if isFlexible { + dst = kbin.AppendCompactString(dst, v) + } else { + dst = kbin.AppendString(dst, v) + } + } + { + v := v.Mechanism + dst = kbin.AppendInt8(dst, v) + } + { + v := v.Iterations + dst = kbin.AppendInt32(dst, v) + } + { + v := v.Salt + if isFlexible { + dst = kbin.AppendCompactBytes(dst, v) + } else { + dst = kbin.AppendBytes(dst, v) + } + } + { + v := v.SaltedPassword + if isFlexible { + dst = kbin.AppendCompactBytes(dst, v) + } else { + dst = kbin.AppendBytes(dst, v) + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + return dst +} +func (v *AlterUserSCRAMCredentialsRequest) ReadFrom(src []byte) error { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + b := kbin.Reader{Src: src} + s := v + { + v := s.Deletions + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]AlterUserSCRAMCredentialsRequestDeletion, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + var v string + if isFlexible { + v = b.CompactString() + } else { + v = b.String() + } + s.Name = v + } + { + v := b.Int8() + s.Mechanism = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.Deletions = v + } + { + v := s.Upsertions + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]AlterUserSCRAMCredentialsRequestUpsertion, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + var v string + if isFlexible { + v = b.CompactString() + } else { + v = b.String() + } + s.Name = v + } + { + v := b.Int8() + s.Mechanism = v + } + { + v := b.Int32() + s.Iterations = v + } + { + var v []byte + if isFlexible { + v = b.CompactBytes() + } else { + v = b.Bytes() + } + s.Salt = v + } + { + var v []byte + if isFlexible { + v = b.CompactBytes() + } else { + v = b.Bytes() + } + s.SaltedPassword = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.Upsertions = v + } + if isFlexible { + SkipTags(&b) + } + return b.Complete() +} + +type AlterUserSCRAMCredentialsResponseResult struct { + // The name this result corresponds to. + User string + + // The user-level error code. + ErrorCode int16 + + // The user-level error message, if any. + ErrorMessage *string +} + +// AlterUserSCRAMCredentialsResponse is a response for an +// AlterUserSCRAMCredentialsRequest. +type AlterUserSCRAMCredentialsResponse struct { + // Version is the version of this message used with a Kafka broker. + Version int16 + + // ThrottleMillis is how long of a throttle Kafka will apply to the client + // after responding to this request. + ThrottleMillis int32 + + // The results for deletions and upsertions. + Results []AlterUserSCRAMCredentialsResponseResult +} + +func (*AlterUserSCRAMCredentialsResponse) Key() int16 { return 51 } +func (*AlterUserSCRAMCredentialsResponse) MaxVersion() int16 { return 0 } +func (v *AlterUserSCRAMCredentialsResponse) SetVersion(version int16) { v.Version = version } +func (v *AlterUserSCRAMCredentialsResponse) GetVersion() int16 { return v.Version } +func (v *AlterUserSCRAMCredentialsResponse) IsFlexible() bool { return v.Version >= 0 } +func (v *AlterUserSCRAMCredentialsResponse) RequestKind() Request { + return &AlterUserSCRAMCredentialsRequest{Version: v.Version} +} + +func (v *AlterUserSCRAMCredentialsResponse) AppendTo(dst []byte) []byte { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + { + v := v.ThrottleMillis + dst = kbin.AppendInt32(dst, v) + } + { + v := v.Results + if isFlexible { + dst = kbin.AppendCompactArrayLen(dst, len(v)) + } else { + dst = kbin.AppendArrayLen(dst, len(v)) + } + for i := range v { + v := &v[i] + { + v := v.User + if isFlexible { + dst = kbin.AppendCompactString(dst, v) + } else { + dst = kbin.AppendString(dst, v) + } + } + { + v := v.ErrorCode + dst = kbin.AppendInt16(dst, v) + } + { + v := v.ErrorMessage + if isFlexible { + dst = kbin.AppendCompactNullableString(dst, v) + } else { + dst = kbin.AppendNullableString(dst, v) + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + } + } + if isFlexible { + dst = kbin.AppendUvarint(dst, 0) + } + return dst +} +func (v *AlterUserSCRAMCredentialsResponse) ReadFrom(src []byte) error { + version := v.Version + _ = version + isFlexible := version >= 0 + _ = isFlexible + b := kbin.Reader{Src: src} + s := v + { + v := b.Int32() + s.ThrottleMillis = v + } + { + v := s.Results + a := v + var l int32 + if isFlexible { + l = b.CompactArrayLen() + } else { + l = b.ArrayLen() + } + if !b.Ok() { + return b.Complete() + } + if l > 0 { + a = make([]AlterUserSCRAMCredentialsResponseResult, l) + } + for i := int32(0); i < l; i++ { + v := &a[i] + s := v + { + var v string + if isFlexible { + v = b.CompactString() + } else { + v = b.String() + } + s.User = v + } + { + v := b.Int16() + s.ErrorCode = v + } + { + var v *string + if isFlexible { + v = b.CompactNullableString() + } else { + v = b.NullableString() + } + s.ErrorMessage = v + } + if isFlexible { + SkipTags(&b) + } + } + v = a + s.Results = v + } + if isFlexible { + SkipTags(&b) + } + return b.Complete() +} + // RequestForKey returns the request corresponding to the given request key // or nil if the key is unknown. func RequestForKey(key int16) Request { @@ -20368,6 +21112,10 @@ func RequestForKey(key int16) Request { return new(DescribeClientQuotasRequest) case 49: return new(AlterClientQuotasRequest) + case 50: + return new(DescribeUserSCRAMCredentialsRequest) + case 51: + return new(AlterUserSCRAMCredentialsRequest) } } @@ -20477,6 +21225,10 @@ func ResponseForKey(key int16) Response { return new(DescribeClientQuotasResponse) case 49: return new(AlterClientQuotasResponse) + case 50: + return new(DescribeUserSCRAMCredentialsResponse) + case 51: + return new(AlterUserSCRAMCredentialsResponse) } } @@ -20586,5 +21338,9 @@ func NameForKey(key int16) string { return "DescribeClientQuotas" case 49: return "AlterClientQuotas" + case 50: + return "DescribeUserSCRAMCredentials" + case 51: + return "AlterUserSCRAMCredentials" } } diff --git a/pkg/kversion/kversion.go b/pkg/kversion/kversion.go index 5618abe8..80dc0129 100644 --- a/pkg/kversion/kversion.go +++ b/pkg/kversion/kversion.go @@ -396,5 +396,10 @@ func Tip() Versions { v[25]++ // 2 add offsets to txn v[26]++ // 2 end txn + v = append(v, + 0, // 50 describe user scram creds, KAFKA-10259 e8524ccd8fca0caac79b844d87e98e9c055f76fb KIP-554 + 0, // 51 alter user scram creds, same + ) + return v }