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

[Feature Request] provide dedicated API to get all stored search templates (scripts) #11771

Open
rursprung opened this issue Jan 5, 2024 · 2 comments
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc

Comments

@rursprung
Copy link
Contributor

Is your feature request related to a problem? Please describe

as per the documentation the following is the only way to get a list of all stored search templates (scripts):

GET _cluster/state/metadata?pretty&filter_path=**.stored_scripts

Describe the solution you'd like

it'd be great if there'd be a more canonical path to get this. since you POST /_scripts/[script-id] to create a script it'd be nice if you could GET /_scripts to get a list of all of them and GET /_scripts/[script-id] to get a specific one.

Related component

Other

Describe alternatives you've considered

you can also just keep the current way of retrieving the stored scripts, but it's not an easy-to-remember path. but at least it's documented so you can always copy & paste it (after searching for it) when needed 🙂

Additional context

No response

@rursprung rursprung added enhancement Enhancement or improvement to existing feature or request untriaged labels Jan 5, 2024
@github-actions github-actions bot added the Other label Jan 5, 2024
@ticheng-aws ticheng-aws added the Search Search query, autocomplete ...etc label Jan 5, 2024
@ticheng-aws ticheng-aws removed the Other label Jan 5, 2024
@msfroh
Copy link
Collaborator

msfroh commented Jan 10, 2024

As @lukas-vlcek called out in Search Relevance Triage meeting, we do need to consider the security implications of such an API. (How does it differ from access control over cluster metadata as a whole? Can we limit access to some scripts but not others?)

@msfroh msfroh removed the untriaged label Jan 10, 2024
@cwperks
Copy link
Member

cwperks commented Apr 5, 2024

Can we limit access to some scripts but not others?

The security plugin doesn't have any existing mechanisms for that. This could be authorized similar to index templates where the security plugin treats it like a cluster permission. This would mean that a cluster admin can prevent someone from using the API, but if a user is authorized to use the API then they can see all stored scripts.

I like this feature proposal.

@getsaurabh02 getsaurabh02 moved this from 🆕 New to Later (6 months plus) in Search Project Board Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc
Projects
Status: Later (6 months plus)
Development

No branches or pull requests

4 participants