Skip to content

Commit 9322e02

Browse files
authored
feat(api): add get extended agent socket path (#5)
Signed-off-by: Black-Hole1 <bh@bugs.cc>
1 parent 1220051 commit 9322e02

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/sshagent/agent.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ func NewProxyAgent(log types.Logger) *ProxyAgent {
2727
}
2828
}
2929

30+
// GetExtendedAgentSocketPath returns the extended agent path.
31+
func (a *ProxyAgent) GetExtendedAgentSocketPath() string {
32+
return a.upstreamSocketPath
33+
}
34+
3035
// SetExtendedAgent sets the extended agent path.
3136
func (a *ProxyAgent) SetExtendedAgent(socketPath string) {
3237
a.upstreamSocketPath = socketPath

pkg/sshagent/sshagent.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ func New(socketPath string, log types.Logger) (*SSHAgent, error) {
4141
return s, nil
4242
}
4343

44+
// GetExtendedAgentSocketPath returns the extended agent path.
45+
func (s *SSHAgent) GetExtendedAgentSocketPath() string {
46+
return s.poxyAgent.GetExtendedAgentSocketPath()
47+
}
48+
4449
// SetExtendedAgent sets the extended agent path.
4550
func (s *SSHAgent) SetExtendedAgent(p string) {
4651
s.poxyAgent.SetExtendedAgent(p)

0 commit comments

Comments
 (0)