Skip to content

Commit

Permalink
Resolves SDK and test issues (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored Apr 20, 2018
1 parent a592e51 commit 2d4cd98
Show file tree
Hide file tree
Showing 37 changed files with 125 additions and 1,239 deletions.
30 changes: 27 additions & 3 deletions Gopkg.lock

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

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

[[constraint]]
name = "github.com/ory/hydra"
version = "0.11.12"
branch = "1.0.x"

[[constraint]]
name = "github.com/ory/ladon"
Expand Down
4 changes: 2 additions & 2 deletions cmd/client/handler_warden.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (h *WardenHandler) IsOAuth2AccessTokenAuthorized(cmd *cobra.Command, args [
resource, _ := cmd.Flags().GetString("resources")

m := h.newWardenManager(cmd)
_, response, err := m.IsOAuth2AccessTokenAuthorized(keto.WardenOAuth2AccessRequest{
_, response, err := m.IsOAuth2AccessTokenAuthorized(keto.WardenOAuth2AuthorizationRequest{
Token: token,
Scopes: scopes,
Action: action,
Expand All @@ -70,7 +70,7 @@ func (h *WardenHandler) IsSubjectAuthorized(cmd *cobra.Command, args []string) {
resource, _ := cmd.Flags().GetString("resources")

m := h.newWardenManager(cmd)
_, response, err := m.IsSubjectAuthorized(keto.WardenSubjectAccessRequest{
_, response, err := m.IsSubjectAuthorized(keto.WardenSubjectAuthorizationRequest{
Action: action,
Subject: subject,
Resource: resource,
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var createCmd = &cobra.Command{
Example:
hydra groups create my-group
`,
Run: cmdHandler.Groups.CreateGroup,
Run: cmdHandler.Roles.CreateRole,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var deleteCmd = &cobra.Command{
Example:
hydra groups delete my-group
`,
Run: cmdHandler.Groups.DeleteGroup,
Run: cmdHandler.Roles.DeleteRole,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_find.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var findCmd = &cobra.Command{
Example:
hydra groups find peter
`,
Run: cmdHandler.Groups.FindGroups,
Run: cmdHandler.Roles.FindRoles,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var listCmd = &cobra.Command{
Example:
hydra groups list
`,
Run: cmdHandler.Groups.ListGroups,
Run: cmdHandler.Roles.ListRoles,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_members_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var addCmd = &cobra.Command{
Example:
hydra groups members add my-group peter julia
`,
Run: cmdHandler.Groups.AddMembers,
Run: cmdHandler.Roles.RoleAddMembers,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/groups_members_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var removeCmd = &cobra.Command{
Example:
hydra groups members remove my-group peter julia
`,
Run: cmdHandler.Groups.RemoveMembers,
Run: cmdHandler.Roles.RoleRemoveMembers,
}

func init() {
Expand Down
36 changes: 0 additions & 36 deletions cmd/policies_view.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/server/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func RunServe(
"/warden/oauth2/authorize",
"/warden/subjects/authorize",
},
nil,
logger,
)
go m.RegisterSegment(buildVersion, buildHash, buildTime)
go m.CommitMemoryStatistics()
Expand Down
10 changes: 8 additions & 2 deletions docs/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,10 @@
],
"responses": {
"200": {
"$ref": "#/responses/wardenOAuth2Authorization"
"description": "wardenOAuth2AuthorizationResponse",
"schema": {
"$ref": "#/definitions/wardenOAuth2AuthorizationResponse"
}
},
"401": {
"$ref": "#/responses/genericError"
Expand Down Expand Up @@ -635,7 +638,10 @@
],
"responses": {
"200": {
"$ref": "#/responses/wardenSubjectAuthorization"
"description": "wardenSubjectAuthorizationResponse",
"schema": {
"$ref": "#/definitions/wardenSubjectAuthorizationResponse"
}
},
"401": {
"$ref": "#/responses/genericError"
Expand Down
4 changes: 2 additions & 2 deletions role/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ func TestGroupSDK(t *testing.T) {
assert.Equal(t, http.StatusOK, response.StatusCode)
assert.Len(t, results, 1)

client.AddMembersToRole("1", keto.GroupMembers{Members: []string{"baz"}})
client.AddMembersToRole("1", keto.RoleMembers{Members: []string{"baz"}})

results, response, err = client.ListRoles("baz", 100, 0)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, response.StatusCode)
assert.Len(t, results, 1)

response, err = client.RemoveMembersFromRole("1", keto.GroupMembers{Members: []string{"baz"}})
response, err = client.RemoveMembersFromRole("1", keto.RoleMembers{Members: []string{"baz"}})
require.NoError(t, err)
assert.Equal(t, http.StatusNoContent, response.StatusCode)

Expand Down
71 changes: 0 additions & 71 deletions roles/doc.go

This file was deleted.

Loading

0 comments on commit 2d4cd98

Please sign in to comment.