From 655b6b211ae6df0186abd740f248939f7ddeaec1 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 31 Mar 2025 16:59:18 +0800 Subject: Add descriptive comments to most Go functions --- fedauth.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fedauth.go') diff --git a/fedauth.go b/fedauth.go index ef1b5ec..808fba5 100644 --- a/fedauth.go +++ b/fedauth.go @@ -15,6 +15,8 @@ import ( "github.com/jackc/pgx/v5" ) +// fedauth checks whether a user's SSH public key matches the remote username +// they claim to have on the service. If so, the association is recorded. func fedauth(ctx context.Context, userID int, service, remoteUsername, pubkey string) (bool, error) { var err error @@ -23,6 +25,8 @@ func fedauth(ctx context.Context, userID int, service, remoteUsername, pubkey st var req *http.Request switch service { + // TODO: Services should be configurable by the instance administrator + // and should not be hardcoded in the source code. case "sr.ht": req, err = http.NewRequestWithContext(ctx, http.MethodGet, "https://meta.sr.ht/~"+usernameEscaped+".keys", nil) case "github": -- cgit v1.2.3