Add multi connection parameters through targets and into session creation (#375)
* Update protos and gen * Add new values to targets CLI command * Lots more plumbing of new parameters through everything * allow fields to be set to zero value. * Disallow set but empty name/description strings in create/update verifiers Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
This commit is contained in:
1 parent
07a7e9750a
commit
62baef1b7e
34 files changed
+725
-229
No files matched your search
@@ -57,6 +57,18 @@ func DefaultAttributes() Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithConnectionIdleTimeoutDuration(inConnectionIdleTimeoutDuration uint32) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["connection_idle_timeout_duration"] = inConnectionIdleTimeoutDuration
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultConnectionIdleTimeoutDuration() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["connection_idle_timeout_duration"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithTcpTargetDefaultPort(inDefaultPort uint32) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
@@ -110,3 +122,27 @@ func DefaultName() Option {
|
||||
o.postMap["name"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithSessionConnectionLimit(inSessionConnectionLimit uint32) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["session_connection_limit"] = inSessionConnectionLimit
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultSessionConnectionLimit() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["session_connection_limit"] = nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithSessionMaxDuration(inSessionMaxDuration uint32) Option {
|
||||
return func(o *options) {
|
||||
o.postMap["session_max_duration"] = inSessionMaxDuration
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultSessionMaxDuration() Option {
|
||||
return func(o *options) {
|
||||
o.postMap["session_max_duration"] = nil
|
||||
}
|
||||
}
|
||||
+15
-12
@@ -16,18 +16,21 @@ import (
|
||||
)
|
||||
|
||||
type Target struct {
|
||||
Id string `json:"id,omitempty"`
|
||||
ScopeId string `json:"scope_id,omitempty"`
|
||||
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
CreatedTime time.Time `json:"created_time,omitempty"`
|
||||
UpdatedTime time.Time `json:"updated_time,omitempty"`
|
||||
Version uint32 `json:"version,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
HostSetIds []string `json:"host_set_ids,omitempty"`
|
||||
HostSets []*HostSet `json:"host_sets,omitempty"`
|
||||
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
||||
Id string `json:"id,omitempty"`
|
||||
ScopeId string `json:"scope_id,omitempty"`
|
||||
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
CreatedTime time.Time `json:"created_time,omitempty"`
|
||||
UpdatedTime time.Time `json:"updated_time,omitempty"`
|
||||
Version uint32 `json:"version,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
HostSetIds []string `json:"host_set_ids,omitempty"`
|
||||
HostSets []*HostSet `json:"host_sets,omitempty"`
|
||||
SessionMaxDuration uint32 `json:"session_max_duration,omitempty"`
|
||||
SessionConnectionLimit uint32 `json:"session_connection_limit,omitempty"`
|
||||
ConnectionIdleTimeoutDuration uint32 `json:"connection_idle_timeout_duration,omitempty"`
|
||||
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
||||
|
||||
responseBody *bytes.Buffer
|
||||
responseMap map[string]interface{}
|
||||
|
||||
Reference in new issue
Block a user