diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index af4b108..c128962 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.5.4 with: fetch-depth: 0 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.5.4 with: fetch-depth: 0 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true @@ -59,7 +59,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true @@ -87,7 +87,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.5.4 with: fetch-depth: 0 - - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true @@ -105,13 +105,13 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true go-version: ${{ env.GO_VERSION }} - - uses: anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0 + - uses: anchore/sbom-action/download-syft@95b086ac308035dc0850b3853be5b7ab108236a8 # v0.16.1 - name: Run GoReleaser uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 @@ -144,7 +144,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: cache-dependency-path: './go.sum' check-latest: true @@ -157,7 +157,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 - - uses: anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0 + - uses: anchore/sbom-action/download-syft@95b086ac308035dc0850b3853be5b7ab108236a8 # v0.16.1 - name: Run GoReleaser id: goreleaser diff --git a/cmd/store/import.go b/cmd/store/import.go index 6cd9018..75a9bee 100644 --- a/cmd/store/import.go +++ b/cmd/store/import.go @@ -24,8 +24,9 @@ import ( "strings" "time" - "github.com/openfga/go-sdk/client" "github.com/schollz/progressbar/v3" + + "github.com/openfga/go-sdk/client" "github.com/spf13/cobra" "github.com/openfga/cli/cmd/model" @@ -75,19 +76,19 @@ func updateStore( storeID string, ) (*CreateStoreAndModelResponse, error) { store, err := fgaClient.GetStore(context.Background()).Execute() - if err != nil { - return nil, fmt.Errorf("failed to get store: %w", err) - } response := &CreateStoreAndModelResponse{ Store: client.ClientCreateStoreResponse{ - CreatedAt: store.GetCreatedAt(), - Id: store.GetId(), - Name: store.GetName(), - UpdatedAt: store.GetUpdatedAt(), + Id: storeID, }, } + if err != nil { + response.Store.CreatedAt = store.GetCreatedAt() + response.Store.Name = store.GetName() + response.Store.UpdatedAt = store.GetUpdatedAt() + } + authModel := authorizationmodel.AuthzModel{} clientConfig.StoreID = storeID diff --git a/go.mod b/go.mod index e7f58e4..567bbf0 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,6 @@ require ( golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect - google.golang.org/grpc v1.64.0 // indirect + google.golang.org/grpc v1.64.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 04ec0dd..78e7ac7 100644 --- a/go.sum +++ b/go.sum @@ -393,8 +393,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=