Skip to content

Commit 6223d43

Browse files
committed
fine tune comment
1 parent 3fe4e9e commit 6223d43

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/ssh/ssh.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ func sessionHandler(session ssh.Session) {
201201
}
202202

203203
func publicKeyHandler(ctx ssh.Context, key ssh.PublicKey) bool {
204+
// The publicKeyHandler (PublicKeyCallback) only provides the candidate keys to authenticate,
205+
// It does NOT really verify here, so we could only record the related information here.
206+
// After authentication (Verify), the "Permissions" will be assigned to the ssh conn,
207+
// then we can use it in the "session handler"
204208
setPermExt := func(keyID int64) {
205209
ctx.Permissions().Permissions.Extensions = map[string]string{
206210
giteaPermissionExtensionKeyID: fmt.Sprint(keyID),

0 commit comments

Comments
 (0)