779d49bab5
* Properly compute auto-auth token * Use inmem sink to track auto-auth token * update debug statement * Only add inmem sink if using auto-auth token is allowed
25 lines
333 B
Go
25 lines
333 B
Go
package mock
|
|
|
|
import (
|
|
"github.com/hashicorp/vault/command/agent/sink"
|
|
)
|
|
|
|
type mockSink struct {
|
|
token string
|
|
}
|
|
|
|
func NewSink(token string) sink.Sink {
|
|
return &mockSink{
|
|
token: token,
|
|
}
|
|
}
|
|
|
|
func (m *mockSink) WriteToken(token string) error {
|
|
m.token = token
|
|
return nil
|
|
}
|
|
|
|
func (m *mockSink) Token() string {
|
|
return m.token
|
|
}
|