Skip to content

Commit

Permalink
Shortened KMD's PNA config name
Browse files Browse the repository at this point in the history
  • Loading branch information
nullun committed Sep 3, 2024
1 parent 0aba646 commit b0321e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions daemon/kmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const (

// KMDConfig contains global configuration information for kmd
type KMDConfig struct {
DataDir string `json:"-"`
DriverConfig DriverConfig `json:"drivers"`
SessionLifetimeSecs uint64 `json:"session_lifetime_secs"`
Address string `json:"address"`
AllowedOrigins []string `json:"allowed_origins"`
EnablePrivateNetworkAccessHeader bool `json:"enable_private_network_access_header"`
DataDir string `json:"-"`
DriverConfig DriverConfig `json:"drivers"`
SessionLifetimeSecs uint64 `json:"session_lifetime_secs"`
Address string `json:"address"`
AllowedOrigins []string `json:"allowed_origins"`
AllowHeaderPNA bool `json:"allow_header_pna"`
}

// DriverConfig contains config info specific to each wallet driver
Expand Down
16 changes: 8 additions & 8 deletions daemon/kmd/kmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func Start(startConfig StartConfig) (died chan error, sock string, err error) {

// Configure the wallet API server
serverCfg := server.WalletServerConfig{
APIToken: apiToken,
DataDir: startConfig.DataDir,
Address: kmdCfg.Address,
AllowedOrigins: kmdCfg.AllowedOrigins,
EnablePrivateNetworkAccessHeader: kmdCfg.EnablePrivateNetworkAccessHeader,
SessionManager: session.MakeManager(kmdCfg),
Log: startConfig.Log,
Timeout: startConfig.Timeout,
APIToken: apiToken,
DataDir: startConfig.DataDir,
Address: kmdCfg.Address,
AllowedOrigins: kmdCfg.AllowedOrigins,
AllowHeaderPNA: kmdCfg.AllowHeaderPNA,
SessionManager: session.MakeManager(kmdCfg),
Log: startConfig.Log,
Timeout: startConfig.Timeout,
}

// Instantiate the wallet API server
Expand Down
18 changes: 9 additions & 9 deletions daemon/kmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ const (

// WalletServerConfig is the configuration passed to MakeWalletServer
type WalletServerConfig struct {
APIToken string
DataDir string
Address string
AllowedOrigins []string
EnablePrivateNetworkAccessHeader bool
SessionManager *session.Manager
Log logging.Logger
Timeout *time.Duration
APIToken string
DataDir string
Address string
AllowedOrigins []string
AllowHeaderPNA bool
SessionManager *session.Manager
Log logging.Logger
Timeout *time.Duration
}

// WalletServer deals with serving API requests
Expand Down Expand Up @@ -212,7 +212,7 @@ func (ws *WalletServer) start(kill chan os.Signal) (died chan error, sock string
// Initialize HTTP server
watchdogCB := ws.makeWatchdogCallback(kill)
srv := http.Server{
Handler: api.Handler(ws.SessionManager, ws.Log, ws.AllowedOrigins, ws.APIToken, ws.EnablePrivateNetworkAccessHeader, watchdogCB),
Handler: api.Handler(ws.SessionManager, ws.Log, ws.AllowedOrigins, ws.APIToken, ws.AllowHeaderPNA, watchdogCB),
}

// Read the kill channel and shut down the server gracefully
Expand Down

0 comments on commit b0321e8

Please sign in to comment.