Skip to content

Commit

Permalink
chore: updating to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
el-mike committed Oct 27, 2024
1 parent f374447 commit 5a3e4a3
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion access_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package restrict

import (
"fmt"
"github.com/el-mike/restrict/internal/utils"
"github.com/el-mike/restrict/v2/internal/utils"
)

// AccessManager - an entity responsible for checking the authorization. It uses underlying
Expand Down
2 changes: 1 addition & 1 deletion adapters/file_adapter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package adapters

import (
"github.com/el-mike/restrict"
"github.com/el-mike/restrict/v2"
)

// AllowedFileType - alias type for describing allowed file types.
Expand Down
2 changes: 1 addition & 1 deletion adapters/file_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
Expand Down
2 changes: 1 addition & 1 deletion adapters/in_memory_adapter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package adapters

import "github.com/el-mike/restrict"
import "github.com/el-mike/restrict/v2"

// InMemoryAdapter - StorageAdapter implementation, providing in-memory persistence.
type InMemoryAdapter struct {
Expand Down
2 changes: 1 addition & 1 deletion adapters/mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package adapters
import (
"fmt"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion authorization_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package restrict

import (
"fmt"
"github.com/el-mike/restrict/internal/utils"
"github.com/el-mike/restrict/v2/internal/utils"
"strings"
)

Expand Down
8 changes: 1 addition & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
module github.com/el-mike/restrict
module github.com/el-mike/restrict/v2

go 1.15

require (
github.com/stretchr/testify v1.9.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
)
4 changes: 2 additions & 2 deletions internal/examples/basic_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/adapters"
"github.com/el-mike/restrict/v2"
"github.com/el-mike/restrict/v2/adapters"
)

var basicUsagePolicy = &restrict.PolicyDefinition{
Expand Down
4 changes: 2 additions & 2 deletions internal/examples/error_handling_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/adapters"
"github.com/el-mike/restrict/v2"
"github.com/el-mike/restrict/v2/adapters"
)

var errorHandlingExamplePolicy = &restrict.PolicyDefinition{
Expand Down
2 changes: 1 addition & 1 deletion internal/examples/policy_example.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package examples

import "github.com/el-mike/restrict"
import "github.com/el-mike/restrict/v2"

var ExamplePolicy = &restrict.PolicyDefinition{
// A map of reusable Permissions. Key corresponds to a preset's name, which can
Expand Down
2 changes: 1 addition & 1 deletion internal/tests/custom_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tests
import (
"fmt"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/v2"
)

const hasUserConditionType = "BELONGS_TO"
Expand Down
4 changes: 2 additions & 2 deletions internal/tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"testing"

"github.com/el-mike/restrict"
"github.com/el-mike/restrict/adapters"
"github.com/el-mike/restrict/v2"
"github.com/el-mike/restrict/v2/adapters"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/tests/policies_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tests

import "github.com/el-mike/restrict"
import "github.com/el-mike/restrict/v2"

var PolicyOne = &restrict.PolicyDefinition{
PermissionPresets: restrict.PermissionPresets{
Expand Down
2 changes: 1 addition & 1 deletion value_descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package restrict
import (
"fmt"

"github.com/el-mike/restrict/internal/utils"
"github.com/el-mike/restrict/v2/internal/utils"
)

// ValueDescriptor - describes a value that will be tested in its parent Condition.
Expand Down

0 comments on commit 5a3e4a3

Please sign in to comment.