working commit

This commit is contained in:
2026-03-05 21:02:34 +02:00
parent 7ce2673bc3
commit b9f1f384fb
7 changed files with 250 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
package repocli
import (
"encoding/base64"
)
type xxxAuthenticator interface {
MakeHeader(user, pass string) (key, value string, err error)
}
type BasicAuthenticator struct{}
func xxxNewBasicAuthenticator() *BasicAuthenticator {
return &BasicAuthenticator{}
}
func (auth *BasicAuthenticator) MakeHeader(user, pass string) (string, string, error) {
pair := base64.StdEncoding.EncodeToString([]byte(user + ":" + pass))
return "Authorization", "Basic " + pair, nil
}