aboutsummaryrefslogtreecommitdiff
path: root/ssh_utils.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-19 20:14:20 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-19 20:14:20 +0800
commitde1b961fbf54601f25c54c1618f11978f6618858 (patch)
treec79cbc96edf80075d57591a409b27ee29c60d7a5 /ssh_utils.go
parentcss: .commit-id { work-break: break-word; } (diff)
downloadforge-de1b961fbf54601f25c54c1618f11978f6618858.tar.gz
forge-de1b961fbf54601f25c54c1618f11978f6618858.tar.zst
forge-de1b961fbf54601f25c54c1618f11978f6618858.zip
ssh/recv, schema: Add repos.contrib_requirements
Diffstat (limited to 'ssh_utils.go')
-rw-r--r--ssh_utils.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/ssh_utils.go b/ssh_utils.go
index 757fbc5..bf8bf5e 100644
--- a/ssh_utils.go
+++ b/ssh_utils.go
@@ -9,19 +9,19 @@ import (
var err_ssh_illegal_endpoint = errors.New("illegal endpoint during SSH access")
-func get_repo_path_perms_from_ssh_path_pubkey(ctx context.Context, ssh_path string, ssh_pubkey string) (repo_path string, direct_access bool, err error) {
+func get_repo_path_perms_from_ssh_path_pubkey(ctx context.Context, ssh_path string, ssh_pubkey string) (repo_path string, direct_access bool, contrib_requirements string, is_registered_user bool, err error) {
segments := strings.Split(strings.TrimPrefix(ssh_path, "/"), "/")
for i, segment := range segments {
var err error
segments[i], err = url.PathUnescape(segment)
if err != nil {
- return "", false, err
+ return "", false, "", false, err
}
}
if segments[0] == ":" {
- return "", false, err_ssh_illegal_endpoint
+ return "", false, "", false, err_ssh_illegal_endpoint
}
separator_index := -1
@@ -37,9 +37,9 @@ func get_repo_path_perms_from_ssh_path_pubkey(ctx context.Context, ssh_path stri
switch {
case separator_index == -1:
- return "", false, err_ssh_illegal_endpoint
+ return "", false, "", false, err_ssh_illegal_endpoint
case len(segments) <= separator_index+2:
- return "", false, err_ssh_illegal_endpoint
+ return "", false, "", false, err_ssh_illegal_endpoint
}
group_name := segments[0]
@@ -49,6 +49,6 @@ func get_repo_path_perms_from_ssh_path_pubkey(ctx context.Context, ssh_path stri
case "repos":
return get_path_perm_by_group_repo_key(ctx, group_name, module_name, ssh_pubkey)
default:
- return "", false, err_ssh_illegal_endpoint
+ return "", false, "", false, err_ssh_illegal_endpoint
}
}