hashicorp / hashicorp/packer-plugin-sdk
Support OTP for SSH communicator
- Dominant language
- Go
- Stars
- 42
- Forks
- 62
- Avg merge
- 29m
- Merged PRs (30d)
- 2
Description
#### Description
Probably it will be useful to be able to pass a function to communicator that will trigger requesting of a new credentials and then form a required sshconfig or just credentials side of it, so while communicator establishes connection it would call this function and receive the new credentials.
Or maybe there is another way - but I found no good interfaces to implement such strategy.
#### Use Case(s)
Our compute resource management system requires user to create new access request every time it's connecting via SSH to the allocated instance. While preparing builder plugin for it I found there is no easy way to regenerate sshconfig for new connection.
#### Potential configuration
```
&communicator.StepConnectSSH{
Config: &b.config.Communicator,
Host: commFunc(host),
SSHConfigOtp: sshConfigFunc,
}
```
#### Potential References
As far I dug in - here is the place where sshconfig is used statically: https://github.com/hashicorp/packer-plugin-sdk/blob/main/sdk-internals/communicator/ssh/communicator.go#L346
Contributor guide
Assessment
This issue has not been assessed yet.