Skip to content

Commit

Permalink
build(deps): bump github.com/openfga/go-sdk from 0.3.7 to 0.4.0 (#3469)
Browse files Browse the repository at this point in the history
* build(deps): bump github.com/openfga/go-sdk from 0.3.7 to 0.4.0

Bumps [github.com/openfga/go-sdk](https://github.com/openfga/go-sdk) from 0.3.7 to 0.4.0.
- [Release notes](https://github.com/openfga/go-sdk/releases)
- [Changelog](https://github.com/openfga/go-sdk/blob/main/CHANGELOG.md)
- [Commits](openfga/go-sdk@v0.3.7...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/openfga/go-sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Handle the error from SetStoreId()

* Update authz.go

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Don Browne <dmjb@users.noreply.github.com>
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
3 people authored May 31, 2024
1 parent 2934f33 commit d8d7aa5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/open-feature/go-sdk v1.12.0
github.com/open-feature/go-sdk-contrib/providers/go-feature-flag v0.1.37
github.com/open-policy-agent/opa v0.64.1
github.com/openfga/go-sdk v0.3.7
github.com/openfga/go-sdk v0.4.0
github.com/openfga/openfga v1.5.3
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/prometheus/client_golang v1.19.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,8 @@ github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf
github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8=
github.com/openfga/api/proto v0.0.0-20240318145204-66b9e5cb403c h1:2UmuAlvXoZGQRuZ4gzl0CQGLB+rSke2uo+OXlw9/1t8=
github.com/openfga/api/proto v0.0.0-20240318145204-66b9e5cb403c/go.mod h1:5LtWOArDX4FlbcfDvBoJAzDEYJKLz/OEUoi+0S2tyM8=
github.com/openfga/go-sdk v0.3.7 h1:n3nKU4HXZVWiiSdbE1XDvsvdvly7bN5gy5E3+lt+55s=
github.com/openfga/go-sdk v0.3.7/go.mod h1:AoMnFlPw65sU/7O4xOPpCb2vXA8ZD9K9xp2hZjcvt4g=
github.com/openfga/go-sdk v0.4.0 h1:C7h/x7Yq3NjxThHE4YGz+rwfawmyo8d9SVScer8fB9w=
github.com/openfga/go-sdk v0.4.0/go.mod h1:AoMnFlPw65sU/7O4xOPpCb2vXA8ZD9K9xp2hZjcvt4g=
github.com/openfga/language/pkg/go v0.0.0-20240409225820-a53ea2892d6d h1:n44DfITs+CLCYJIgsryJkG2ElwOZJ3huekPZKydPi7U=
github.com/openfga/language/pkg/go v0.0.0-20240409225820-a53ea2892d6d/go.mod h1:wkI4GcY3yNNuFMU2ncHPWqBaF7XylQTkJYfBi2pIpK8=
github.com/openfga/openfga v1.5.3 h1:Uynmlsx3iz/eiP7wW9n2dbwxDh/kiS/27W6C24Y7oyY=
Expand Down
15 changes: 12 additions & 3 deletions internal/authz/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func (a *ClientWrapper) PrepareForRun(ctx context.Context) error {
return fmt.Errorf("unable to find authz store: %w", err)
}

a.cli.SetStoreId(storeID)
err = a.cli.SetStoreId(storeID)
if err != nil {
return fmt.Errorf("unable to store authz ID: %w", err)
}

modelID, err := a.findLatestModel(ctx)
if err != nil {
Expand Down Expand Up @@ -169,14 +172,20 @@ func (a *ClientWrapper) ensureAuthzStore(ctx context.Context) error {
return err
}
a.l.Printf("Created authz store %s/%s\n", id, storeName)
a.cli.SetStoreId(id)
err = a.cli.SetStoreId(id)
if err != nil {
return fmt.Errorf("unable to store authz ID: %w", err)
}
return nil
}

a.l.Printf("Not creating store. Found store with name '%s' and ID '%s'.\n",
storeName, storeID)

a.cli.SetStoreId(storeID)
err = a.cli.SetStoreId(storeID)
if err != nil {
return fmt.Errorf("unable to store authz ID: %w", err)
}
return nil
}

Expand Down

0 comments on commit d8d7aa5

Please sign in to comment.