github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/provider/maas/credentials.go (about)

     1  // Copyright 2016 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package maas
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  	"github.com/juju/juju/cloud"
     9  )
    10  
    11  type environProviderCredentials struct{}
    12  
    13  // CredentialSchemas is part of the environs.ProviderCredentials interface.
    14  func (environProviderCredentials) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema {
    15  	return map[cloud.AuthType]cloud.CredentialSchema{
    16  		cloud.OAuth1AuthType: {
    17  			{
    18  				"maas-oauth", cloud.CredentialAttr{
    19  					Description: "OAuth/API-key credentials for MAAS",
    20  					Hidden:      true,
    21  				},
    22  			},
    23  		},
    24  	}
    25  }
    26  
    27  // DetectCredentials is part of the environs.ProviderCredentials interface.
    28  func (environProviderCredentials) DetectCredentials() (*cloud.CloudCredential, error) {
    29  	// TODO(axw) find out where the MAAS CLI stores credentials.
    30  	return nil, errors.NotFoundf("credentials")
    31  }