We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fe4e9e commit 6223d43Copy full SHA for 6223d43
modules/ssh/ssh.go
@@ -201,6 +201,10 @@ func sessionHandler(session ssh.Session) {
201
}
202
203
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"
208
setPermExt := func(keyID int64) {
209
ctx.Permissions().Permissions.Extensions = map[string]string{
210
giteaPermissionExtensionKeyID: fmt.Sprint(keyID),
0 commit comments