elastop

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README | LICENSE

commit 4bbf0c6bf13626561270c16cce423794592dc507
parent 23a7c216abf35b174bb3951b44d5ad8aa190f8e7
Author: acidvegas <acid.vegas@acid.vegas>
Date: Mon, 9 Dec 2024 15:30:18 -0500

Allow no auth connections

Diffstat:
M.gitignore | 1+
Delastop | 0
Melastop.go | 7+------

3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
@@ -4,6 +4,7 @@
 *.dll
 *.so
 *.dylib
+elastop
 
 # Test binary, built with `go test -c`
 *.test
diff --git a/elastop b/elastop
Binary files differ.
diff --git a/elastop.go b/elastop.go
@@ -551,11 +551,6 @@ func main() {
 		os.Exit(1)
 	}
 
-	if apiKey == "" && (*user == "" || *password == "") {
-		fmt.Fprintf(os.Stderr, "Error: Must provide either API key or both username and password\n")
-		os.Exit(1)
-	}
-
 	// Strip any trailing slash from the host
 	*host = strings.TrimRight(*host, "/")
 
@@ -619,7 +614,7 @@ func main() {
 			// Set authentication
 			if apiKey != "" {
 				req.Header.Set("Authorization", fmt.Sprintf("ApiKey %s", apiKey))
-			} else {
+			} else if *user != "" && *password != "" {
 				req.SetBasicAuth(*user, *password)
 			}