mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
Compare commits
2 commits
6d5e6b8cc9
...
401c36950a
Author | SHA1 | Date | |
---|---|---|---|
|
401c36950a | ||
|
50165ce9e1 |
1 changed files with 18 additions and 3 deletions
|
@ -180,7 +180,12 @@ func (pol *ACLPolicy) CompileFilterRules(
|
|||
for srcIndex, src := range acl.Sources {
|
||||
srcs, err := pol.expandSource(src, users, nodes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parsing policy, acl index: %d->%d: %w", index, srcIndex, err)
|
||||
return nil, fmt.Errorf(
|
||||
"parsing policy, acl index: %d->%d: %w",
|
||||
index,
|
||||
srcIndex,
|
||||
err,
|
||||
)
|
||||
}
|
||||
srcIPs = append(srcIPs, srcs...)
|
||||
}
|
||||
|
@ -339,12 +344,21 @@ func (pol *ACLPolicy) CompileSSHPolicy(
|
|||
case "check":
|
||||
checkAction, err := sshCheckAction(sshACL.CheckPeriod)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("parsing SSH policy, parsing check duration, index: %d: %w", index, err)
|
||||
return nil, fmt.Errorf(
|
||||
"parsing SSH policy, parsing check duration, index: %d: %w",
|
||||
index,
|
||||
err,
|
||||
)
|
||||
} else {
|
||||
action = *checkAction
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("parsing SSH policy, unknown action %q, index: %d: %w", sshACL.Action, index, err)
|
||||
return nil, fmt.Errorf(
|
||||
"parsing SSH policy, unknown action %q, index: %d: %w",
|
||||
sshACL.Action,
|
||||
index,
|
||||
err,
|
||||
)
|
||||
}
|
||||
|
||||
principals := make([]*tailcfg.SSHPrincipal, 0, len(sshACL.Sources))
|
||||
|
@ -978,6 +992,7 @@ func filterNodesByUser(nodes types.Nodes, users []types.User, userToken string)
|
|||
for _, user := range users {
|
||||
if user.ProviderIdentifier == userToken {
|
||||
potentialUsers = append(potentialUsers, user)
|
||||
|
||||
break
|
||||
}
|
||||
if user.Email == userToken {
|
||||
|
|
Loading…
Reference in a new issue