mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-27 01:13:05 +00:00
45f5b15a9f
currently, the policy approach node to user matching with a quite naive approach looking at the username provided in the policy and matched it with the username on the nodes. This worked ok as long as usernames were unique and did not change. As usernames are no longer guarenteed to be unique in an OIDC environment we cant rely on this. This changes the mechanism that matches the user string (now user token) with nodes: - first find all potential users by looking up: - database ID - provider ID (OIDC) - username/email If more than one user is matching, then the query is rejected, and zero matching nodes are returned. When a single user is found, the node is matched against the User database ID, which are also present on the actual node. This means that from this commit, users can use the following to identify users in the policy: - provider identity (iss + sub) - username - email - database id There are more changes coming to this, so it is not recommended to start using any of these new abilities, with the exception of email, which will not change since it includes an @. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> |
||
---|---|---|
.. | ||
testdata | ||
api_key.go | ||
api_key_test.go | ||
db.go | ||
db_test.go | ||
ip.go | ||
ip_test.go | ||
node.go | ||
node_test.go | ||
policy.go | ||
preauth_keys.go | ||
preauth_keys_test.go | ||
routes.go | ||
routes_test.go | ||
suite_test.go | ||
text_serialiser.go | ||
users.go | ||
users_test.go |