-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace membership with authorization (#65)
* Replace membership with authorization * Reorder fields --------- Co-authored-by: Henrique Santos <[email protected]>
- Loading branch information
Showing
25 changed files
with
106 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ import ( | |
|
||
"github.com/google/go-cmp/cmp" | ||
"github.com/google/go-cmp/cmp/cmpopts" | ||
"github.com/stackitcloud/stackit-sdk-go/services/membership" | ||
"github.com/stackitcloud/stackit-sdk-go/services/authorization" | ||
) | ||
|
||
type testCtxKey struct{} | ||
|
||
var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
var testClient = &membership.APIClient{} | ||
var testClient = &authorization.APIClient{} | ||
var testOrganizationID = "some-organization-id" | ||
var testSubject = "[email protected]" | ||
var testRole = "reader" | ||
|
@@ -54,10 +54,10 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | |
return model | ||
} | ||
|
||
func fixtureRequest(mods ...func(request *membership.ApiAddMembersRequest)) membership.ApiAddMembersRequest { | ||
func fixtureRequest(mods ...func(request *authorization.ApiAddMembersRequest)) authorization.ApiAddMembersRequest { | ||
request := testClient.AddMembers(testCtx, testOrganizationID) | ||
request = request.AddMembersPayload(membership.AddMembersPayload{ | ||
Members: utils.Ptr([]membership.Member{ | ||
request = request.AddMembersPayload(authorization.AddMembersPayload{ | ||
Members: utils.Ptr([]authorization.Member{ | ||
{ | ||
Subject: &testSubject, | ||
Role: &testRole, | ||
|
@@ -178,7 +178,7 @@ func TestBuildRequest(t *testing.T) { | |
tests := []struct { | ||
description string | ||
model *inputModel | ||
expectedRequest membership.ApiAddMembersRequest | ||
expectedRequest authorization.ApiAddMembersRequest | ||
}{ | ||
{ | ||
description: "base", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ import ( | |
|
||
"github.com/google/go-cmp/cmp" | ||
"github.com/google/go-cmp/cmp/cmpopts" | ||
"github.com/stackitcloud/stackit-sdk-go/services/membership" | ||
"github.com/stackitcloud/stackit-sdk-go/services/authorization" | ||
) | ||
|
||
type testCtxKey struct{} | ||
|
||
var testCtx = context.WithValue(context.Background(), testCtxKey{}, "foo") | ||
var testClient = &membership.APIClient{} | ||
var testClient = &authorization.APIClient{} | ||
var testOrganizationID = "some-organization-id" | ||
var testSubject = "[email protected]" | ||
var testRole = "reader" | ||
|
@@ -54,10 +54,10 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel { | |
return model | ||
} | ||
|
||
func fixtureRequest(mods ...func(request *membership.ApiRemoveMembersRequest)) membership.ApiRemoveMembersRequest { | ||
func fixtureRequest(mods ...func(request *authorization.ApiRemoveMembersRequest)) authorization.ApiRemoveMembersRequest { | ||
request := testClient.RemoveMembers(testCtx, testOrganizationID) | ||
request = request.RemoveMembersPayload(membership.RemoveMembersPayload{ | ||
Members: utils.Ptr([]membership.Member{ | ||
request = request.RemoveMembersPayload(authorization.RemoveMembersPayload{ | ||
Members: utils.Ptr([]authorization.Member{ | ||
{ | ||
Subject: &testSubject, | ||
Role: &testRole, | ||
|
@@ -191,7 +191,7 @@ func TestBuildRequest(t *testing.T) { | |
tests := []struct { | ||
description string | ||
model *inputModel | ||
expectedRequest membership.ApiRemoveMembersRequest | ||
expectedRequest authorization.ApiRemoveMembersRequest | ||
}{ | ||
{ | ||
description: "base", | ||
|
@@ -204,8 +204,8 @@ func TestBuildRequest(t *testing.T) { | |
model.Force = true | ||
}), | ||
expectedRequest: testClient.RemoveMembers(testCtx, testOrganizationID). | ||
RemoveMembersPayload(membership.RemoveMembersPayload{ | ||
Members: utils.Ptr([]membership.Member{ | ||
RemoveMembersPayload(authorization.RemoveMembersPayload{ | ||
Members: utils.Ptr([]authorization.Member{ | ||
{ | ||
Subject: &testSubject, | ||
Role: &testRole, | ||
|
Oops, something went wrong.