Add support for more key types

This commit is contained in:
cheddar 2025-02-20 22:53:18 -05:00
parent b1e4a0cf72
commit 001a4b4ac5
No known key found for this signature in database
14 changed files with 98 additions and 48 deletions

View file

@ -3,6 +3,7 @@ package client
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
@ -37,7 +38,11 @@ func RegisterKey(baseUrl *url.URL, key string, userId string) (string, error) {
return "", err
}
keyId := string(out[:])
bodyContent := string(out[:])
return keyId, nil
if resp.StatusCode >= 300 {
return "", fmt.Errorf("bad status: %d - %s", resp.StatusCode, bodyContent)
}
return bodyContent, nil
}