~romuloalves/certificate-from-s3

49806e5f6f560b3e87188a1e4938d4486f51ba4b — RĂ´mulo Alves 3 years ago 606a078
Fixing the signer creating after the S3 response and convertion
1 files changed, 2 insertions(+), 6 deletions(-)

M main.go
M main.go => main.go +2 -6
@@ 7,18 7,14 @@ import (
// GetCertificate will return a certificate signer from a private key in a S3 Bucket
func GetCertificate(credentials Credentials, file File) (ssh.Signer, error) {
	s3Service := connectToS3Service(credentials)
	body, err := getContentFromS3(s3Service, file)
	if err != nil {
		return nil, err
	}

	content, err := getContentBytes(body)
	body, err := getContentFromS3(s3Service, file)
	if err != nil {
		return nil, err
	}

	// Create the Signer for this private key
	signer, err := ssh.ParsePrivateKey(content)
	signer, err := ssh.ParsePrivateKey(body)
	if err != nil {
		return nil, err
	}