コード例 #1
0
ファイル: credentials_test.go プロジェクト: kat-co/juju
func (s *credentialsSuite) TestServicePrincipalSecretCredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "service-principal-secret", map[string]string{
		"application-id":       "application",
		"application-password": "******",
		"subscription-id":      "subscription",
	})
}
コード例 #2
0
func (s *credentialsSuite) TestUserPassCredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "userpass", map[string]string{
		"username":    "******",
		"password":    "******",
		"tenant-name": "gary",
	})
}
コード例 #3
0
func (s *credentialsSuite) TestAccessKeyCredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "access-key", map[string]string{
		"access-key":  "key",
		"secret-key":  "secret",
		"tenant-name": "gary",
	})
}
コード例 #4
0
func (s *credentialsSuite) TestOAuth2CredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "oauth2", map[string]string{
		"client-id":    "123",
		"client-email": "*****@*****.**",
		"project-id":   "fourfivesix",
		"private-key":  "sewen",
	})
}
コード例 #5
0
ファイル: credentials_test.go プロジェクト: kat-co/juju
func (s *credentialsSuite) TestUserPassCredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "userpass", map[string]string{
		"application-id":       "application",
		"application-password": "******",
		"subscription-id":      "subscription",
		"tenant-id":            "tenant",
	})
}
コード例 #6
0
func (s *credentialsSuite) TestUserPassCredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "userpass", map[string]string{
		"sdc-user":    "******",
		"sdc-key-id":  "sdc-key-id",
		"private-key": "private-key",
		"algorithm":   "rsa-sha256",
	})
}
コード例 #7
0
func (s *credentialsSuite) TestJSONFileCredentialsValid(c *gc.C) {
	dir := c.MkDir()
	filename := filepath.Join(dir, "somefile")
	err := ioutil.WriteFile(filename, []byte{}, 0600)
	c.Assert(err, jc.ErrorIsNil)
	envtesting.AssertProviderCredentialsValid(c, s.provider, "jsonfile", map[string]string{
		// For now at least, the contents of the file are not validated
		// by the credentials schema. That is left to the provider.
		// The file does need to be an absolute path though and exist.
		"file": filename,
	})
}
コード例 #8
0
ファイル: credentials_test.go プロジェクト: bac/juju
func (s *credentialsSuite) TestOAuth1CredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "oauth1", map[string]string{
		"maas-oauth": "123:456:789",
	})
}