Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth2: Minting an authkey with a tag it belongs to doesn't work - only child tags #25

Open
antifuchs opened this issue Apr 30, 2024 · 2 comments

Comments

@antifuchs
Copy link
Contributor

Here's a tricky bug: When you assign a tag "tag:hoopsnake" to your OAuth2 client, you can not mint authkeys for that tag, you must use a child tag. Everything else fails with requested tags [tag:hoopsnake] are invalid or not permitted.

As mentioned, you have to use a child tag.

Say you have this tag structure:

        "tagOwners": {
		// hoopsnake for initrd boots:
		"tag:hoopsnake":            ["[email protected]"],
		"tag:hoopsnake-selfhosted": ["tag:hoopsnake"],
		"tag:hoopsnake-remote":     ["tag:hoopsnake"],
        ...
        }

Then you can only request authkeys for tag:hoopsnake-selfhosted or tag:hoopsnake-remote (or both!), but no combination of the two with tag:hoopsnake in it.

@joshpearce
Copy link
Contributor

Adding a couple files to highlight the differences in the HTTP requests between a working cURL based script and hoopsnake. I'm using OAuth creds that have device write permissions on a parent tag,

	"tagOwners": {
		"tag:workloads":      ["joshpearce@github"],
		"tag:hoopsnake-init": ["tag:workloads"],
	},

ts-oauth-curl-good.txt
ts-oauth-golib-bad.txt

@joshpearce
Copy link
Contributor

Here's a capture from hoopsnake during boot, where it works.
ts-oauth-hoopsnake-boot-good.txt

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

No branches or pull requests

2 participants