Change connection limit to -1 for unlimited so it works with TF (#383)

* Migrate connection limit unlimited value to -1

* Fix authorization check
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-20 15:53:49 -04:00
1 parent 5214f14105
commit edffc7863d
18 files changed
+152 -124

No files matched your search

+3
View File
@@ -87,6 +87,7 @@ var (
stringValueName = (&wrapperspb.StringValue{}).ProtoReflect().Descriptor().FullName()
boolValueName = (&wrapperspb.BoolValue{}).ProtoReflect().Descriptor().FullName()
uInt32ValueName = (&wrapperspb.UInt32Value{}).ProtoReflect().Descriptor().FullName()
int32ValueName = (&wrapperspb.Int32Value{}).ProtoReflect().Descriptor().FullName()
structValueName = (&_struct.Struct{}).ProtoReflect().Descriptor().FullName()
timestampName = (&timestamppb.Timestamp{}).ProtoReflect().Descriptor().FullName()
)
@@ -99,6 +100,8 @@ func messageKind(fd protoreflect.FieldDescriptor) (ptr, pkg, name string) {
return "", "", "bool"
case uInt32ValueName:
return "", "", "uint32"
case int32ValueName:
return "", "", "int32"
case structValueName:
return "", "", "map[string]interface{}"
case timestampName:
+1 -1
View File
@@ -111,7 +111,7 @@ func DefaultName() Option {
}
}
func WithSessionConnectionLimit(inSessionConnectionLimit uint32) Option {
func WithSessionConnectionLimit(inSessionConnectionLimit int32) Option {
return func(o *options) {
o.postMap["session_connection_limit"] = inSessionConnectionLimit
}
+1 -1
View File
@@ -28,7 +28,7 @@ type Target struct {
HostSetIds []string `json:"host_set_ids,omitempty"`
HostSets []*HostSet `json:"host_sets,omitempty"`
SessionMaxSeconds uint32 `json:"session_max_seconds,omitempty"`
SessionConnectionLimit uint32 `json:"session_connection_limit,omitempty"`
SessionConnectionLimit int32 `json:"session_connection_limit,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
responseBody *bytes.Buffer