diff options
| author | ishaan <contact@ishaan.cc> | 2026-07-19 13:09:56 +0530 |
|---|---|---|
| committer | ishaan <contact@ishaan.cc> | 2026-07-19 13:09:56 +0530 |
| commit | 8a5de371fccb89635bc1a624d8b1aca52aa18da4 (patch) | |
| tree | 89f3b2bec4e2425823534d4db46e3aecc2a15d91 /internal/utils/utils.go | |
| parent | 80b1c6deec723095f08de6aee289d4fb32ca9337 (diff) | |
better config (package)
Diffstat (limited to 'internal/utils/utils.go')
| -rw-r--r-- | internal/utils/utils.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/internal/utils/utils.go b/internal/utils/utils.go index a43b268..cea00a3 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -3,8 +3,6 @@ package utils import ( "crypto/rand" "fmt" - "io" - "net/http" "os" "os/signal" "strconv" @@ -102,35 +100,3 @@ func CheckFileAuthMode(notePath string) (crypt.AuthMode, error) { return headers.Auth, nil } - -func GetPubKeyFromService(username, service string) ([]byte, error) { - // TODO: Read custom services from config - - var url string - - switch service { - case "github": - url = "https://github.com/" + username + ".keys" - case "gitlab": - url = "https://gitlab.com/" + username + ".keys" - default: - return nil, fmt.Errorf("unknown service: %s", service) - } - - resp, err := http.Get(url) - if err != nil { - return nil, fmt.Errorf("failed to fetch key from %s: %w", service, err) - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("%s returned status %d", service, resp.StatusCode) - } - - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("failed to read response from %s: %w", service, err) - } - - return body, nil -} |