mirror of
https://github.com/docker/compose.git
synced 2025-07-23 21:54:40 +02:00
Renamed Login method specific to tests, to make things more explicit
This commit is contained in:
parent
82ff8dcd7d
commit
2268f0c598
@ -94,8 +94,9 @@ func newAzureLoginServiceFromPath(tokenStorePath string, helper apiHelper) (Azur
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoginFromServicePrincipal login with clientId / clientSecret from a previously created service principal
|
// TestLoginFromServicePrincipal login with clientId / clientSecret from a previously created service principal.
|
||||||
func (login AzureLoginService) LoginFromServicePrincipal(clientID string, clientSecret string, tenantID string) error {
|
// The resulting token does not include a refresh token, used for tests only
|
||||||
|
func (login AzureLoginService) TestLoginFromServicePrincipal(clientID string, clientSecret string, tenantID string) error {
|
||||||
// Tried with auth2.NewUsernamePasswordConfig() but could not make this work with username / password, setting this for CI with clientID / clientSecret
|
// Tried with auth2.NewUsernamePasswordConfig() but could not make this work with username / password, setting this for CI with clientID / clientSecret
|
||||||
creds := auth2.NewClientCredentialsConfig(clientID, clientSecret, tenantID)
|
creds := auth2.NewClientCredentialsConfig(clientID, clientSecret, tenantID)
|
||||||
|
|
||||||
|
@ -71,7 +71,6 @@ func (s *E2eACISuite) TestContextDefault() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *E2eACISuite) TestACIBackend() {
|
func (s *E2eACISuite) TestACIBackend() {
|
||||||
|
|
||||||
It("Logs in azure using service principal credentials", func() {
|
It("Logs in azure using service principal credentials", func() {
|
||||||
login, err := login.NewAzureLoginService()
|
login, err := login.NewAzureLoginService()
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
@ -79,7 +78,7 @@ func (s *E2eACISuite) TestACIBackend() {
|
|||||||
clientID := os.Getenv("AZURE_CLIENT_ID")
|
clientID := os.Getenv("AZURE_CLIENT_ID")
|
||||||
clientSecret := os.Getenv("AZURE_CLIENT_SECRET")
|
clientSecret := os.Getenv("AZURE_CLIENT_SECRET")
|
||||||
tenantID := os.Getenv("AZURE_TENANT_ID")
|
tenantID := os.Getenv("AZURE_TENANT_ID")
|
||||||
err = login.LoginFromServicePrincipal(clientID, clientSecret, tenantID)
|
err = login.TestLoginFromServicePrincipal(clientID, clientSecret, tenantID)
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user