To do it right, the auth type should be bounded by the Image capabilities (this 
way we'll be able to fail better if an image doesn't have, say, SSH), so I'd:

* Add a `supportedAuthMethods` to the Image object with a default value that 
keeps the current behavior.
* In the template options, allow to override them with an `overrideAuthMethods` 
but validating that the given ones are supported by the Image (this could be 
done in the `TemplateBuilder.build()` method, for example).
* Populate the resulting auth methods (could be only one) to the 
LoginCredentials so the SSH drivers can act accordingly.

And finally, I've seen there is already a LoginType enum with values: RDP and 
SSH. I don't know where it is used, but if it's not perhaps it is good 
deprecating it, or even better using it instead of creating a new AuthType enum.


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/486#issuecomment-52416057

Reply via email to