Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Fix guid validation (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsacavdm authored and jackfrancis committed Mar 2, 2018
1 parent 94afb44 commit 8a0aff3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ func (authArgs *authArgs) getClient() (*armhelpers.AzureClient, error) {
authArgs.SubscriptionID, _ = uuid.FromString(authArgs.rawSubscriptionID)

if authArgs.AuthMethod == "client_secret" {
if authArgs.ClientID.String() == "" || authArgs.ClientSecret == "" {
if authArgs.ClientID.String() == "00000000-0000-0000-0000-000000000000" || authArgs.ClientSecret == "" {
log.Fatal(`--client-id and --client-secret must be specified when --auth-method="client_secret"`)
}
// try parse the UUID
} else if authArgs.AuthMethod == "client_certificate" {
if authArgs.ClientID.String() == "" || authArgs.CertificatePath == "" || authArgs.PrivateKeyPath == "" {
if authArgs.ClientID.String() == "00000000-0000-0000-0000-000000000000" || authArgs.CertificatePath == "" || authArgs.PrivateKeyPath == "" {
log.Fatal(`--client-id and --certificate-path, and --private-key-path must be specified when --auth-method="client_certificate"`)
}
}

if authArgs.SubscriptionID.String() == "" {
if authArgs.SubscriptionID.String() == "00000000-0000-0000-0000-000000000000" {
log.Fatal("--subscription-id is required (and must be a valid UUID)")
}

Expand Down

0 comments on commit 8a0aff3

Please sign in to comment.