Пример #1
0
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
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
func (s *credentialsSuite) TestOAuth1CredentialsValid(c *gc.C) {
	envtesting.AssertProviderCredentialsValid(c, s.provider, "oauth1", map[string]string{
		"maas-oauth": "123:456:789",
	})
}