Skip to content

Commit a79e4d8

Browse files
authored
Add Connect token file to configuration (#346)
1 parent a09ea2e commit a79e4d8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/util/connectutil/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var DefaultConfig = Config{
99
Name: "",
1010
EnforcePassthrough: false,
1111
AllowUnencryptedTunnel: false,
12+
TokenFilePath: tokenFilename,
1213
Service: Service{
1314
Enabled: false,
1415
Addr: "localhost:8443",
@@ -24,6 +25,7 @@ type Config struct {
2425
EnforcePassthrough bool `yaml:"enforcePassthrough,omitempty" json:"enforcePassthrough,omitempty"` // Setting to true will reject all sessions in non-passthrough mode.
2526
WatchServiceAddr string `yaml:"watchServiceAddr,omitempty" json:"watchServiceAddr,omitempty"` // The address of the WatchService
2627
AllowUnencryptedTunnel bool `yaml:"allowUnencryptedTunnel,omitempty" json:"allowUnencryptedTunnel,omitempty"` // Allow unencrypted tunnels
28+
TokenFilePath string `yaml:"tokenFilePath,omitempty" json:"tokenFilePath,omitempty"` // Path to the token file
2729

2830
Service Service
2931
}

pkg/util/connectutil/config/setup_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func connectClient(c Config, connHandler ConnHandler) (process.Runnable, error)
4949

5050
return retryingRunnable(process.RunnableFunc(func(ctx context.Context) error {
5151
// Load auth token
52-
token, err := loadToken(tokenFilename)
52+
token, err := loadToken(c.TokenFilePath)
5353
if err != nil {
5454
return err
5555
}

0 commit comments

Comments
 (0)