openfga / cli

A cross-platform CLI to interact with an OpenFGA server
https://openfga.dev
Apache License 2.0
50 stars 26 forks source link

`fga store import` returns null when a store_id is specified #334

Closed aaguiarz closed 5 months ago

aaguiarz commented 6 months ago

When the store-id is not specified, the ouput of fga store import is:

$ fga store import --file store.fga.yaml
{
  "store": {
    "created_at":"2024-05-27T13:37:23.682712Z",
    "id":"01HYX4A87121BGPPFB58J5853Q",
    "name":"store",
    "updated_at":"2024-05-27T13:37:23.682712Z"
  }
}

However, if we specify the ID of an existing store, that does not have a model/tuples, we get null:

$ fga store create --name "test"
{
  "store": {
    "created_at":"2024-05-27T13:38:19.675256Z",
    "id":"01HYX4BYWTVQEWRP6TGVBAJ9TH",
    "name":"test",
    "updated_at":"2024-05-27T13:38:19.675256Z"
  }
}
$ fga store import --store-id 01HYX4BYWTVQEWRP6TGVBAJ9TH --file store.fga.yaml
null

There are two issues:

$ fga store create --model model.fga
{
  "store": {
    "created_at":"2024-05-27T13:40:28.396087Z",
    "id":"01HYX4FWK9P2VFRQ0YABYNQ447",
    "name":"model",
    "updated_at":"2024-05-27T13:40:28.396087Z"
  },
  "model": {
    "authorization_model_id":"01HYX4FWKT84FE3R8C4EJGG7WM"
  }
}