#community-help

Authorization Issues and Version Update Queries

TLDR gab was having authorization issues with multisearch but Jason advised using the collection name instead of the alias when creating the key. gab also queried about updating the cloud cluster to a later version.

Powered by Struct AI

1

1

Jul 30, 2021 (30 months ago)
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e
gab
05:25 PM
Hi,
I have the following case where I'm not authorized. Cannot find why:
Key that exist
{
      "actions": [
        "documents:search"
      ],
      "collections": [
        "products",
        "wharehouses"
      ],
      "value_prefix": "fKzc"
    }

Aliases that exists
{
  "aliases": [
    {
      "collection_name": "prod-wharehouses-21-07-30-14",
      "name": "wharehouses"
    },
    {
      "collection_name": "prod-products-21-07-30-16",
      "name": "products"
    }
  ]
}

Collections that exists
[
{ "name": "prod-wharehouses-21-07-30-14"},
{ "name": "prod-products-21-07-30-16"}
]

I'm trying using the first key to search (multisearch) but I'm not authorized.
The same happen if I try to export documents
GET /collections/products/documents/export
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:33 PM
gab you want to use the collection name, not the alias name when creating the key
05:35
Jason
05:35 PM
IIRC, you can even add regex collection names when creating the key… We spoke about, I need to look deeper to see if it made it into a release.
gab
Photo of md5-8be2a24edf7a95c9c74abce4b1130c3e
gab
05:38 PM
Ok after looking deeper it looks like I'm assigning wrong permission. I Should have assigned documents:export /documents:get . It seems to work with the alias. I'm curious for the regexp because I do not know the collection names.

I will check if for multi search I need something like documents:multisearch instead of documents:search
05:46
gab
05:46 PM
It doesn't works for searching permissions. Strange
it works fine with an alias with documents:search
05:50
gab
05:50 PM
I have the version
{
  "state": 1,
  "version": "0.21.0.rc24"
}

Is it possible to migrate my cloud cluster to 0.21 ?
Is there a way so I can update it myself for later version updates?

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
06:35 PM
Oh good to know it works with an alias! Wasn't anticipating that use case 🙂
06:38
Jason
06:38 PM
gab Confirming that we did release support for regex collection names: https://github.com/typesense/typesense/issues/139

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community