fix(server): Improve SSH fields

Signed-off-by: Myzel394 <github.7a2op@simplelogin.co>
This commit is contained in:
Myzel394 2025-05-04 20:58:32 +02:00
parent 9b306f339e
commit b520ada4ed
No known key found for this signature in database
GPG Key ID: 3B955307C2FC2F11
2 changed files with 19 additions and 5 deletions

View File

@ -146,16 +146,26 @@ See PATTERNS in ssh_config(5) for more information on patterns. This keyword may
Documentation: `Specifies a file that lists principal names that are accepted for certificate authentication. When using certificates signed by a key listed in TrustedUserCAKeys, this file lists names, one of which must appear in the certificate for it to be accepted for authentication. Names are listed one per line preceded by key options (as described in AUTHORIZED_KEYS FILE FORMAT in sshd(8)). Empty lines and comments starting with # are ignored. Documentation: `Specifies a file that lists principal names that are accepted for certificate authentication. When using certificates signed by a key listed in TrustedUserCAKeys, this file lists names, one of which must appear in the certificate for it to be accepted for authentication. Names are listed one per line preceded by key options (as described in AUTHORIZED_KEYS FILE FORMAT in sshd(8)). Empty lines and comments starting with # are ignored.
Arguments to AuthorizedPrincipalsFile accept the tokens described in the TOKENS section. After expansion, AuthorizedPrincipalsFile is taken to be an absolute path or one relative to the user's home directory. The default is none, i.e. not to use a principals file in this case, the username of the user must appear in a certificate's principals list for it to be accepted. Arguments to AuthorizedPrincipalsFile accept the tokens described in the TOKENS section. After expansion, AuthorizedPrincipalsFile is taken to be an absolute path or one relative to the user's home directory. The default is none, i.e. not to use a principals file in this case, the username of the user must appear in a certificate's principals list for it to be accepted.
Note that AuthorizedPrincipalsFile is only used when authentication proceeds using a CA listed in TrustedUserCAKeys and is not consulted for certification authorities trusted via ~/.ssh/authorized_keys, though the principals= key option offers a similar facility (see sshd(8) for details).`, Note that AuthorizedPrincipalsFile is only used when authentication proceeds using a CA listed in TrustedUserCAKeys and is not consulted for certification authorities trusted via ~/.ssh/authorized_keys, though the principals= key option offers a similar facility (see sshd(8) for details).`,
Value: docvalues.PathValue{ Value: docvalues.OrValue{
Values: []docvalues.DeprecatedValue{
docvalues.SingleEnumValue("none"),
docvalues.PathValue{
RequiredType: docvalues.PathTypeFile, RequiredType: docvalues.PathTypeFile,
}, },
}, },
},
},
"banner": { "banner": {
Documentation: `The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is none then no banner is displayed. By default, no banner is displayed.`, Documentation: `The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is none then no banner is displayed. By default, no banner is displayed.`,
Value: docvalues.PathValue{ Value: docvalues.OrValue{
Values: []docvalues.DeprecatedValue{
docvalues.SingleEnumValue("none"),
docvalues.PathValue{
RequiredType: docvalues.PathTypeFile, RequiredType: docvalues.PathTypeFile,
}, },
}, },
},
},
"casignaturealgorithms": { "casignaturealgorithms": {
Documentation: `Specifies which algorithms are allowed for signing of certificates by certificate authorities (CAs). The default is: Documentation: `Specifies which algorithms are allowed for signing of certificates by certificate authorities (CAs). The default is:
ssh-ed25519,ecdsa-sha2-nistp256, ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com, rsa-sha2-512,rsa-sha2-256 ssh-ed25519,ecdsa-sha2-nistp256, ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com, rsa-sha2-512,rsa-sha2-256

View File

@ -18,6 +18,10 @@ func GetRootCompletions(
parentMatchBlock *ast.SSHDMatchBlock, parentMatchBlock *ast.SSHDMatchBlock,
suggestValue bool, suggestValue bool,
) ([]protocol.CompletionItem, error) { ) ([]protocol.CompletionItem, error) {
if d.Indexes == nil {
return nil, nil
}
kind := protocol.CompletionItemKindField kind := protocol.CompletionItemKindField
availableOptions := make(map[fields.NormalizedOptionName]docvalues.DocumentationValue, 0) availableOptions := make(map[fields.NormalizedOptionName]docvalues.DocumentationValue, 0)