Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk: Improve naming for ory policies #100

Merged
merged 1 commit into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/engines_acp_ory_allowed.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var enginesAcpOryAllowedCmd = &cobra.Command{
res, err := c.Engines.DoOryAccessControlPoliciesAllow(
engines.NewDoOryAccessControlPoliciesAllowParams().
WithFlavor(args[0]).
WithBody(&models.Input{
WithBody(&models.OryAccessControlPolicyAllowedInput{
Subject: args[1],
Resource: args[2],
Action: args[3],
Expand Down
567 changes: 395 additions & 172 deletions docs/api.swagger.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions engine/ladon/handler_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ var (
}},
}
requests = map[string][]struct {
req models.Input
req models.OryAccessControlPolicyAllowedInput
allowed bool
}{
"regex": {
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "other-thing",
Action: "create",
Expand All @@ -42,7 +42,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "matrix",
Action: "delete",
Expand All @@ -51,7 +51,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "matrix",
Action: "create",
Expand All @@ -60,7 +60,7 @@ var (
allowed: true,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "ken",
Resource: "forbidden_matrix",
Action: "create",
Expand All @@ -69,7 +69,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "ken",
Resource: "allowed_matrix",
Action: "create",
Expand All @@ -80,7 +80,7 @@ var (
},
"exact": {
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "other-thing",
Action: "create",
Expand All @@ -89,7 +89,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "matrix",
Action: "delete",
Expand All @@ -98,7 +98,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "alice",
Resource: "matrix",
Action: "create",
Expand All @@ -107,7 +107,7 @@ var (
allowed: true,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "ken",
Resource: "forbidden_matrix",
Action: "create",
Expand All @@ -116,7 +116,7 @@ var (
allowed: false,
},
{
req: models.Input{
req: models.OryAccessControlPolicyAllowedInput{
Subject: "ken",
Resource: "allowed_matrix",
Action: "create",
Expand Down
2 changes: 1 addition & 1 deletion engine/ladon/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const (

// Input for checking if a request is allowed or not.
//
// swagger:model oryAccessControlPolicyAllowedInput
// swagger:ignore
type Input struct {
// Resource is the resource that access is requested to.
Resource string `json:"resource"`
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ github.com/ory/herodot v0.6.0 h1:Dcs4yH1Qw1GIgGCvvvdafhT8xjwElTE//8xLmHtPEYA=
github.com/ory/herodot v0.6.0/go.mod h1:3BOneqcyBsVybCPAJoi92KN2BpJHcmDqAMcAAaJiJow=
github.com/ory/sqlcon v0.0.7 h1:PQl4ihs11Xzw9wyFk0YQmQEnPL0icdJjiStQNaoRTmM=
github.com/ory/sqlcon v0.0.7/go.mod h1:oOyCmOJWAs8F0bnGmmIvGA9/4K1JqVL0D9JgvAaVc3U=
github.com/ory/x v0.0.41 h1:wcvrT82ktnAkioDvEsnJEroTvjzJ8yHDgt8gfLEGqZM=
github.com/ory/x v0.0.41/go.mod h1:wY34Yfy/lRklrrVbChZHqOQxhbSHH2a6bSJ6o3YFKY8=
github.com/ory/x v0.0.42 h1:5buEAEuI7TAq6WsZM8K4LIBllFhwpwMDlSBaPd2RiN0=
github.com/ory/x v0.0.42/go.mod h1:wY34Yfy/lRklrrVbChZHqOQxhbSHH2a6bSJ6o3YFKY8=
github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE=
Expand Down Expand Up @@ -662,6 +660,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/toqueteos/webbrowser v1.1.0 h1:Prj1okiysRgHPoe3B1bOIVxcv+UuSt525BDQmR5W0x0=
github.com/toqueteos/webbrowser v1.1.0/go.mod h1:Hqqqmzj8AHn+VlZyVjaRWY20i25hoOZGAABCcg2el4A=
github.com/uber-go/atomic v1.3.2 h1:Azu9lPBWRNKzYXSIwRfgRuDuS0YKsK4NFhiQv98gkxo=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk=
github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
Expand All @@ -686,6 +685,7 @@ go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.opencensus.io v0.20.0 h1:L/ARO58pdktB6dLmYI0zAyW1XnavEmGziFd0MKfxnck=
go.opencensus.io v0.20.0/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/go/keto/models/authorization_result.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/go/keto/models/context.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/go/keto/models/delete_ory_access_control_policy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/go/keto/models/do_ory_access_control_policies_allow.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading