Skip to content

cmd/tailscale: use advertise tags from prefs for OAuth and id federation#18616

Merged
mpminardi merged 1 commit intomainfrom
mpminardi/tailscale-up-tags-fix
Feb 5, 2026
Merged

cmd/tailscale: use advertise tags from prefs for OAuth and id federation#18616
mpminardi merged 1 commit intomainfrom
mpminardi/tailscale-up-tags-fix

Conversation

@mpminardi
Copy link
Copy Markdown
Member

@mpminardi mpminardi commented Feb 5, 2026

Use the parsed and validated advertise tags value from prefs instead of doing a strings.Split on the raw tags value as an input to the OAuth and identity federation auth key generation methods.

The previous strings.Split method would return an array with a single empty string element which would pass downstream length checks on the tags argument before eventually failing with a confusing message when hitting the API.

Fixes #18617

@mpminardi mpminardi self-assigned this Feb 5, 2026
Use the parsed and validated advertise tags value from prefs instead of
doing a strings.Split on the raw tags value as an input to the OAuth and
identity federation auth key generation methods.

The previous strings.Split method would return an array with a single
empty string element which would pass downstream length checks on the
tags argument before eventually failing with a confusing message when
hitting the API.

Fixes #18617

Signed-off-by: Mario Minardi <mario@tailscale.com>
@mpminardi mpminardi force-pushed the mpminardi/tailscale-up-tags-fix branch from a5903cb to afdfbb9 Compare February 5, 2026 17:55
@mpminardi mpminardi marked this pull request as ready for review February 5, 2026 18:00
Copy link
Copy Markdown
Contributor

@mcoulombe mcoulombe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at up_test.go I suspect it'll me more complex than it looks, but if it's not a too big endeavour this type of edge case is the perfect candidate for a regression test.

@mpminardi
Copy link
Copy Markdown
Member Author

Looking at up_test.go I suspect it'll me more complex than it looks, but if it's not a too big endeavour this type of edge case is the perfect candidate for a regression test.

Yeah I'm going to see if we can get more coverage across the board there as a follow up to this.

@mpminardi mpminardi merged commit 6587caf into main Feb 5, 2026
58 checks passed
@mpminardi mpminardi deleted the mpminardi/tailscale-up-tags-fix branch February 5, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WIF/OAuth auth fails with confusing error when --advertise-tags is empty

2 participants