Hey, we’re using scoped API keys with `synonyms:*`...
# community-help
m
Hey, we’re using scoped API keys with
synonyms:*
and
overrides:*
actions. After upgrading to v30.1, those keys no longer have access to the new synonym sets and curation sets endpoints. We tried adding
synonym_sets:*
and
curation_sets:*
but it still doesn’t work. What are the correct API key actions strings for the new sets?
k
m
Thanks @Kishore Nallan - with the
synonym_sets:*
in place we can fetch the set(s), but not set items:
Copy code
/synonym_sets/{name}/items
Is there another permission we need to allow access to items? Same question for curation set items.
k
Can you try explicit setting all actions like
synonym_sets:create
m
sure, checking now loading
No luck - can only fetch sets but not items (forbidden)
The key setup:
Copy code
{
  "actions": [
    "collections:*",
    "documents:*",
    "aliases:*",
    "synonym_sets:list",
    "synonym_sets:get",
    "synonym_sets:create",
    "synonym_sets:delete",
    "curation_sets:*",
    "metrics.json:list",
    "stats.json:list",
    "debug:list"
  ],
  "autodelete": false,
  "collections": [
    "{prefix}:.*"
  ],
  "description": "{prefix}",
  "expires_at": 64723363199,
  "id": 226,
  "value_prefix": "S4n7"
}
k
Ok I will check and get back to you. The whole API permissions is fully automated so just need to figure out the API path.
🙌 1
f
Hey @Max Priazhevskii, Synonym set / Curation set items are handled by their own sub-resource for API keys on
synonym_sets/items:*
. You should include both as
["synonym_sets:*","synonym_sets/items:*"]
in order to have access to both the top-level resource and the sub-level sub-resource for the items
m
It works, thanks Fanis! Another question - is it possible to scope the key to a specific list of sets, similar to how we can scope it to collections? For example:
Copy code
{
    "actions": [
        "collections:*",
        "synonym_sets:*",
        "synonym_sets/items:*",
    ],
    "collections": [
        "{prefix}:.*"
    ],
    "synonym_sets": [
        "{prefix}:.*"
    ],
cc @Kishore Nallan
f
Not possible right now. Keys only scope by collections plus actions, not by synonym set names or curation set names
👌 1
m
Thanks for confirming! Would it make sense to open a feature request for this?
a
Hey Max, Sorry for the wait. Feel free to open an FR so we can check interest on it and perhaps implement in the future: https://github.com/typesense/typesense/issues
👍 1
m