-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add user to task #124584
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
base: main
Are you sure you want to change the base?
Add user to task #124584
Conversation
Add the user to the tasks output.
I'm pretty sure we don't want this in the |
String user = threadContext.getTransient(Task.USER_KEY); | ||
if (user != null) { | ||
headers.put(Task.USER_KEY, user); | ||
} | ||
Task task = request.createTask(taskIdGenerator.incrementAndGet(), type, action, request.getParentTask(), headers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because there are so many implementations of this we might should make an object CreateTaskParams
and stuff everything in there.
My concern here (and we've run into this every time we've wanted to put user information into useful places) is that "username" isn't as meaningful or as simple as people expect. Some challenges:
As you can see in how we do this for the slowlog, representing that information well requires more than a single field.
It questionable as to whether we need all of that information for the tasks API, but I think it we add a username we'll immediately get asked to do it "right" and provide the user's name and/or the API key id (and name) as well. And probably realm. |
A few years (!?!) ago we experimented with putting a user concept into core elasticsearch and even tried to plumb it into One of the big problems was deciding how complicated to make it. |
Oh fun! I think it's pretty important that we start getting this stuff in - for, well, some definition of this stuff. I'm not surprised that user is a complex concept. It really would be nice if I, personally, didn't have to understand it and could just "add the user stuff". |
Add the user to the tasks output.
Closes #124252