aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/tool.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r--modules/base/tool.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index b6ed8cbf9a..ed94575e74 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -8,16 +8,12 @@ import (
"crypto/sha1"
"crypto/sha256"
"crypto/subtle"
- "encoding/base64"
"encoding/hex"
- "errors"
"fmt"
"hash"
"strconv"
- "strings"
"time"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
@@ -37,19 +33,6 @@ func ShortSha(sha1 string) string {
return util.TruncateRunes(sha1, 10)
}
-// BasicAuthDecode decode basic auth string
-func BasicAuthDecode(encoded string) (string, string, error) {
- s, err := base64.StdEncoding.DecodeString(encoded)
- if err != nil {
- return "", "", err
- }
-
- if username, password, ok := strings.Cut(string(s), ":"); ok {
- return username, password, nil
- }
- return "", "", errors.New("invalid basic authentication")
-}
-
// VerifyTimeLimitCode verify time limit code
func VerifyTimeLimitCode(now time.Time, data string, minutes int, code string) bool {
if len(code) <= 18 {
@@ -139,24 +122,3 @@ func Int64sToStrings(ints []int64) []string {
}
return strs
}
-
-// EntryIcon returns the octicon name for displaying files/directories
-func EntryIcon(entry *git.TreeEntry) string {
- switch {
- case entry.IsLink():
- te, err := entry.FollowLink()
- if err != nil {
- return "file-symlink-file"
- }
- if te.IsDir() {
- return "file-directory-symlink"
- }
- return "file-symlink-file"
- case entry.IsDir():
- return "file-directory-fill"
- case entry.IsSubModule():
- return "file-submodule"
- }
-
- return "file"
-}