Skip to content

"requested tags are invalid or not permitted" with scoped OAuth Clients and 2 or more tags approved for this client (needs better error message)Β #437

@artmakh

Description

@artmakh

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 create tailscale_tailnet_key only for 1 tag, you receive error requested tags are invalid or not permitted
When you use API access tokens or OAuth Client with only 1 allowed tag tag:test_tag, you get no errors.

To Reproduce
Steps to reproduce the behaviour:

  1. Create OAuth Client with Devices read\write permissions with allowed two tags tag:test_tag, tag:test_tag_2
  2. Export TAILSCALE_OAUTH_CLIENT_ID and TAILSCALE_OAUTH_CLIENT_SECRET to env
  3. Use this terraform code to create tailscale_tailnet_key resource
provider "tailscale" {
     tailnet = "yours-tailnet"
     scopes  = ["devices"]
}
    
    
resource "tailscale_tailnet_key" "this" {
     reusable      = true
     ephemeral     = true
     preauthorized = true
   
     recreate_if_invalid = "always"
   
     tags = [
       "tag:test_tag"
     ]
}
  1. Try to apply this code
  2. Get an err requested tags [tag:test_tag] are invalid or not permitted

Expected behaviour
tailscale_tailnet_key created

Desktop (please complete the following information):

  • OS: Linux
  • Terraform Version: 1.3.4
  • Provider Version: Tested and reproduced on both 0.16.2 and 0.17.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions