github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/provider/joyent/credentials.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package joyent
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  
     9  	"github.com/juju/juju/cloud"
    10  )
    11  
    12  type environProviderCredentials struct{}
    13  
    14  // CredentialSchemas is part of the environs.ProviderCredentials interface.
    15  func (environProviderCredentials) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema {
    16  	return map[cloud.AuthType]cloud.CredentialSchema{
    17  		// TODO(axw) we need a more appropriate name for this authentication
    18  		//           type. ssh?
    19  		cloud.UserPassAuthType: {
    20  			{
    21  				sdcUser, cloud.CredentialAttr{Description: "SmartDataCenter user ID"},
    22  			}, {
    23  				sdcKeyId, cloud.CredentialAttr{Description: "SmartDataCenter key ID"},
    24  			}, {
    25  				privateKey, cloud.CredentialAttr{
    26  					Description: "Private key used to sign requests",
    27  					Hidden:      true,
    28  					FileAttr:    privateKeyPath,
    29  				},
    30  			}, {
    31  				algorithm, cloud.CredentialAttr{
    32  					Description: "Algorithm used to generate the private key (default rsa-sha256)",
    33  					Optional:    true,
    34  					Options:     []interface{}{"rsa-sha256", "rsa-sha1", "rsa-sha224", "rsa-sha384", "rsa-sha512"},
    35  				},
    36  			},
    37  		},
    38  	}
    39  }
    40  
    41  // DetectCredentials is part of the environs.ProviderCredentials interface.
    42  func (environProviderCredentials) DetectCredentials() (*cloud.CloudCredential, error) {
    43  	return nil, errors.NotFoundf("credentials")
    44  }