2024-09-26 20:25:01 +02:00

91 lines
3.4 KiB
Go

package fields
import (
docvalues "config-lsp/doc-values"
matchparser "config-lsp/handlers/sshd_config/match-parser"
)
var MatchAllowedOptions = map[string]struct{}{
"AcceptEnv": {},
"AllowAgentForwarding": {},
"AllowGroups": {},
"AllowStreamLocalForwarding": {},
"AllowTcpForwarding": {},
"AllowUsers": {},
"AuthenticationMethods": {},
"AuthorizedKeysCommand": {},
"AuthorizedKeysCommandUser": {},
"AuthorizedKeysFile": {},
"AuthorizedPrincipalsCommand": {},
"AuthorizedPrincipalsCommandUser": {},
"AuthorizedPrincipalsFile": {},
"Banner": {},
"CASignatureAlgorithms": {},
"ChannelTimeout": {},
"ChrootDirectory": {},
"ClientAliveCountMax": {},
"ClientAliveInterval": {},
"DenyGroups": {},
"DenyUsers": {},
"DisableForwarding": {},
"ExposeAuthInfo": {},
"ForceCommand": {},
"GatewayPorts": {},
"GSSAPIAuthentication": {},
"HostbasedAcceptedAlgorithms": {},
"HostbasedAuthentication": {},
"HostbasedUsesNameFromPacketOnly": {},
"IgnoreRhosts": {},
"Include": {},
"IPQoS": {},
"KbdInteractiveAuthentication": {},
"KerberosAuthentication": {},
"LogLevel": {},
"MaxAuthTries": {},
"MaxSessions": {},
"PasswordAuthentication": {},
"PermitEmptyPasswords": {},
"PermitListen": {},
"PermitOpen": {},
"PermitRootLogin": {},
"PermitTTY": {},
"PermitTunnel": {},
"PermitUserRC": {},
"PubkeyAcceptedAlgorithms": {},
"PubkeyAuthentication": {},
"PubkeyAuthOptions": {},
"RekeyLimit": {},
"RevokedKeys": {},
"RDomain": {},
"SetEnv": {},
"StreamLocalBindMask": {},
"StreamLocalBindUnlink": {},
"TrustedUserCAKeys": {},
"UnusedConnectionTimeout": {},
"X11DisplayOffset": {},
"X11Forwarding": {},
"X11UseLocalhos": {},
}
var MatchUserField = docvalues.UserValue("", false)
var MatchGroupField = docvalues.GroupValue("", false)
var MatchHostField = docvalues.DomainValue()
var MatchLocalAddressField = docvalues.StringValue{}
var MatchLocalPortField = docvalues.StringValue{}
var MatchRDomainField = docvalues.StringValue{}
var MatchAddressField = docvalues.IPAddressValue{
AllowIPv4: true,
AllowIPv6: true,
AllowRange: true,
}
var MatchValueFieldMap = map[matchparser.MatchCriteriaType]docvalues.Value{
matchparser.MatchCriteriaTypeUser: MatchUserField,
matchparser.MatchCriteriaTypeGroup: MatchGroupField,
matchparser.MatchCriteriaTypeHost: MatchHostField,
matchparser.MatchCriteriaTypeLocalAddress: MatchLocalAddressField,
matchparser.MatchCriteriaTypeLocalPort: MatchLocalPortField,
matchparser.MatchCriteriaTypeRDomain: MatchRDomainField,
matchparser.MatchCriteriaTypeAddress: MatchAddressField,
}