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: allow configuring user data source using login_name or dis… #427

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

oxtoacart
Copy link
Contributor

…play_name

This is useful because clients typically have no knowledge of user IDs.

Updates tailscale/corp#21867

Type: schema.TypeString,
Description: "The emailish login name of the user.",
Optional: true,
AtLeastOneOf: []string{"display_name", "login_name"},
Copy link
Member

@mpminardi mpminardi Sep 6, 2024

Choose a reason for hiding this comment

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

Should this be ExactlyOneOf instead of AtLeastOneOf, or are their cases where you would want to be specifying both and only specifying one wouldn't be enough to identify a single user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per discussion, I'm only allowing use of login_name now.

Description: "The emailish login name of the user.",
Optional: true,
},
"display_name": {
Copy link
Member

Choose a reason for hiding this comment

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

Think we'll want to remove this now that it is back in the commonUserSchema

"login_name": {
Type: schema.TypeString,
Description: "The emailish login name of the user.",
Optional: true,
Copy link
Member

Choose a reason for hiding this comment

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

Now that this is the only way to query a user:

Suggested change
Optional: true,
Required: true,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It occurred to me that I'm still allowing use of ID, so I've updated the schema to make this clear.

This is useful because clients typically have no knowledge of user IDs.

Updates tailscale/corp#21867

Signed-off-by: Percy Wegmann <[email protected]>
@oxtoacart oxtoacart merged commit 289a1c0 into main Sep 9, 2024
4 checks passed
@oxtoacart oxtoacart deleted the percy/users-by-name branch September 9, 2024 15:25
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.

2 participants