Skip to content

Commit

Permalink
v4.0.0: Add policy support for creating / deleting warrants (#37)
Browse files Browse the repository at this point in the history
This release also includes cursor pagination support for list methods
  • Loading branch information
stanleyphu authored Jul 13, 2023
1 parent 931e0ed commit 60133f4
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 40 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Use [Warrant](https://warrant.dev/) in server-side Go projects.
## Installation

```shell
go get github.com/warrant-dev/warrant-go/v3
go get github.com/warrant-dev/warrant-go/v4
```

## Usage
Expand All @@ -17,7 +17,7 @@ You can use the Warrant SDK with or without a client. Instantiating a client all
### Without a Client

```go
import "github.com/warrant-dev/warrant-go/v3"
import "github.com/warrant-dev/warrant-go/v4"

// Setup
warrant.ApiKey = "api_test_f5dsKVeYnVSLHGje44zAygqgqXiLJBICbFzCiAg1E="
Expand All @@ -33,8 +33,8 @@ tenant, err := tenant.Create(&tenant.TenantParams{})

Instantiate the Warrant client with your API key to get started:
```go
import "github.com/warrant-dev/warrant-go/v3"
import "github.com/warrant-dev/warrant-go/v3/config"
import "github.com/warrant-dev/warrant-go/v4"
import "github.com/warrant-dev/warrant-go/v4/config"

client := warrant.NewClient(config.ClientConfig{
ApiKey: "api_test_f5dsKVeYnVSLHGje44zAygqgqXiLJBICbFzCiAg1E=",
Expand All @@ -48,8 +48,8 @@ client := warrant.NewClient(config.ClientConfig{
The API, Authorize, and Self-Service endpoints the SDK makes requests to are configurable via the `warrant.ApiEndpoint`, `warrant.AuthorizeEndpoint`, `warrant.SelfServiceDashEndpoint` attributes:

```go
import "github.com/warrant-dev/warrant-go/v3"
import "github.com/warrant-dev/warrant-go/v3/config"
import "github.com/warrant-dev/warrant-go/v4"
import "github.com/warrant-dev/warrant-go/v4/config"

// Without client initialization
// Set api and authorize endpoints to http://localhost:8000
Expand Down
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net/url"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"net/http"

"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4/config"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions examples/live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/feature"
"github.com/warrant-dev/warrant-go/v3/permission"
"github.com/warrant-dev/warrant-go/v3/pricingtier"
"github.com/warrant-dev/warrant-go/v3/role"
"github.com/warrant-dev/warrant-go/v3/session"
"github.com/warrant-dev/warrant-go/v3/tenant"
"github.com/warrant-dev/warrant-go/v3/user"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/feature"
"github.com/warrant-dev/warrant-go/v4/permission"
"github.com/warrant-dev/warrant-go/v4/pricingtier"
"github.com/warrant-dev/warrant-go/v4/role"
"github.com/warrant-dev/warrant-go/v4/session"
"github.com/warrant-dev/warrant-go/v4/tenant"
"github.com/warrant-dev/warrant-go/v4/user"
)

func setup() {
Expand Down
6 changes: 3 additions & 3 deletions feature/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/warrant-dev/warrant-go/v3
module github.com/warrant-dev/warrant-go/v4

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"net/http"

"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4/config"
)

type GetObjectIdFunc func(r *http.Request) string
Expand Down
6 changes: 3 additions & 3 deletions permission/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
6 changes: 3 additions & 3 deletions pricingtier/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
6 changes: 3 additions & 3 deletions role/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
6 changes: 3 additions & 3 deletions session/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"io"
"net/http"

"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
6 changes: 3 additions & 3 deletions tenant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down
6 changes: 3 additions & 3 deletions user/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net/http"

"github.com/google/go-querystring/query"
"github.com/warrant-dev/warrant-go/v3"
"github.com/warrant-dev/warrant-go/v3/client"
"github.com/warrant-dev/warrant-go/v3/config"
"github.com/warrant-dev/warrant-go/v4"
"github.com/warrant-dev/warrant-go/v4/client"
"github.com/warrant-dev/warrant-go/v4/config"
)

type Client struct {
Expand Down

0 comments on commit 60133f4

Please sign in to comment.