Close proxy listener if session is no longer active (#4850)
* Close proxy listener if session is no longer active
This commit is contained in:
3 files changed
+50
No files matched your search
@@ -9,6 +9,7 @@ import (
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/boundary/api"
|
||||
"github.com/hashicorp/boundary/api/targets"
|
||||
)
|
||||
|
||||
@@ -37,6 +38,7 @@ type Options struct {
|
||||
WithSessionAuthorizationData *targets.SessionAuthorizationData
|
||||
WithSkipSessionTeardown bool
|
||||
withSessionTeardownTimeout time.Duration
|
||||
withApiClient *api.Client
|
||||
}
|
||||
|
||||
// Option is a function that takes in an options struct and sets values or
|
||||
@@ -129,3 +131,14 @@ func WithSessionTeardownTimeout(with time.Duration) Option {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithApiClient provides an optional Boundary API client
|
||||
// Experimental: It is unclear whether the current usage of this option is the
|
||||
// approach that we want to take in the long term. This may be removed at any
|
||||
// point going forward.
|
||||
func WithApiClient(with *api.Client) Option {
|
||||
return func(o *Options) error {
|
||||
o.withApiClient = with
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user