Open artmakh opened 1 month ago
Hey @artmakh !
Clarification on this behaviour from our knowledge base:
When you create an OAuth client with the scope devices, you must select one or more tags, which can be any tag or set of tags in your tailnet. Auth keys created with this client must have those exact tags, or tags owned by the client's tags. Additionally, these tags need to be specified in the API call.
This means that if you have something like the following in the policy file:
"tagOwners": {
"tag:test-tag": ["autogroup:admin", "autogroup:owner"],
"tag:test-tag-2": ["autogroup:admin", "autogroup:owner"],
}
and both test-tag
and test-tag-2
were added to the OAuth client when it was created, then the tags section on tailscale_tailnet_key
must include both test-tag
and test-tag-2
.
What you might want to be doing here instead if you want to be able to specify either test-tag
or test-tag-2
in the tags for tailscale_tailnet_key
is have something like the following in the policy file:
"tagOwners": {
"tag:main": ["autogroup:admin", "autogroup:owner"],
"tag:test-tag": ["autogroup:admin", "autogroup:owner", "tag:main"],
"tag:test-tag-2": ["autogroup:admin", "autogroup:owner", "tag:main"],
}
and then add tag:main
to the OAuth client you are using. This scenario is allowed as both test-tag
and test-tag-2
are owned by tag:main
.
With all that being said: the error message here is definitely confusing. Will take a look into this on our end.
Describe the bug
When you're trying to create resource
tailscale_tailnet_key
using scoped OAuth Client, with more than 1 allowed tag, but you createtailscale_tailnet_key
only for 1 tag, you receive errorrequested tags are invalid or not permitted
When you use API access tokens or OAuth Client with only 1 allowed tagtag:test_tag
, you get no errors.To Reproduce Steps to reproduce the behaviour:
Devices
read\write
permissions with allowed two tagstag:test_tag, tag:test_tag_2
TAILSCALE_OAUTH_CLIENT_ID
andTAILSCALE_OAUTH_CLIENT_SECRET
to envtailscale_tailnet_key
resourcerequested tags [tag:test_tag] are invalid or not permitted
Expected behaviour
tailscale_tailnet_key
createdDesktop (please complete the following information):
1.3.4
0.16.2
and0.17.1