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

tailscale: support Grants field to ACL #67

Closed
wants to merge 3 commits into from

Conversation

zchee
Copy link

@zchee zchee commented Jan 16, 2024

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
Src []string `json:"src,omitempty" hujson:"Src,omitempty"`
Dst []string `json:"dst,omitempty" hujson:"Dst,omitempty"`
IP []string `json:"ip,omitempty" hujson:"IP,omitempty"`
App map[string][]GrantApp `json:"app,omitempty" hujson:"App,omitempty"`

Choose a reason for hiding this comment

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

Optional: App is of type tailcfg.PeerCapMap (with tailcfg package from the main tailscale OSS repo)

App map[string][]GrantApp `json:"app,omitempty" hujson:"App,omitempty"`
}

GrantApp map[string][]string

Choose a reason for hiding this comment

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

If you do decide to keep defining the type here instead of using PeerCapMap: Be aware that GrantApp is any JSON-encodeable value, not just map[string][]string.

Copy link
Member

Choose a reason for hiding this comment

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

It isn't quite any value, I believe we rule out arrays.

zchee added 2 commits January 17, 2024 09:15
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
@zchee
Copy link
Author

zchee commented Jan 17, 2024

@twitchyliquid64 Use tailslace.com/tailcfg directly. PTAL.

@zchee
Copy link
Author

zchee commented Jan 24, 2024

@twitchyliquid64 @creachadair gentle ping

@zchee
Copy link
Author

zchee commented Feb 7, 2024

@twitchyliquid64 @creachadair sorry, gentle ping again

@knyar
Copy link
Contributor

knyar commented Feb 8, 2024

Hey, quick question: are you doing this to get grants support in Terraform, or do you have a different use case for this client?

Longer term we'd like to avoid having to maintain a copy of the policy schema here, especially for beta features (like grants) that we might still want to make some backwards incompatible changes to. The alternative we discussed is supporting passing policy as a hujson blob to the API without re-serializing it. If your end goal is to use this in Terraform, would that be a viable alternative?

@knyar
Copy link
Contributor

knyar commented Feb 15, 2024

We have removed usage of local schema in the Terraform provider in tailscale/terraform-provider-tailscale#332, and you should be able to use the Grants field starting with v0.14.0 of the provider. If you are using this library directly, you can now pass the ACL as a HuJSON string to the SetACL method.

@knyar knyar closed this Feb 15, 2024
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.

4 participants