Commit c7df15d
committed
policy,state: authorize reauth tags against the authenticating user
Re-authenticating an already-tagged node with --advertise-tags was always
rejected: tag authorization asked whether the NODE may hold the tag, but a
tag-owned node has no user and its IP is in no owner set, so every tag was
refused and --force-reauth left the node logged out.
Authorize each requested tag against the authenticating user as well, via
a new PolicyManager.UserCanHaveTag. Both reauth check sites are fixed -
the pre-check in applyAuthNodeUpdate and the apply-time re-check in
processReauthTags whose rejection was discarded - so a permitted tag is
actually applied, not silently dropped. Tags the user does not own are
still rejected.
Also clear the auth-key reference when a reauth untags a node: a node
created by a tagged ephemeral key would otherwise stay ephemeral after
converting to user-owned and be garbage-collected on disconnect. The
cleared reference is persisted (writing NULL is FK-safe).
Fixes #33741 parent e10844d commit c7df15d
5 files changed
Lines changed: 546 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
975 | 1006 | | |
976 | 1007 | | |
977 | 1008 | | |
| |||
0 commit comments