Resolve user to stable unique ID in policy (#2205)
This commit is contained in:
parent
3a2589f1a9
commit
fffd23602b
9 changed files with 506 additions and 144 deletions
|
@ -648,8 +648,13 @@ func EnableAutoApprovedRoutes(
|
|||
if approvedAlias == node.User.Username() {
|
||||
approvedRoutes = append(approvedRoutes, advertisedRoute)
|
||||
} else {
|
||||
users, err := ListUsers(tx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("looking up users to expand route alias: %w", err)
|
||||
}
|
||||
|
||||
// TODO(kradalby): figure out how to get this to depend on less stuff
|
||||
approvedIps, err := aclPolicy.ExpandAlias(types.Nodes{node}, approvedAlias)
|
||||
approvedIps, err := aclPolicy.ExpandAlias(types.Nodes{node}, users, approvedAlias)
|
||||
if err != nil {
|
||||
return fmt.Errorf("expanding alias %q for autoApprovers: %w", approvedAlias, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue