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

fix: SDK generation at Makefile #1954

Merged
merged 4 commits into from
Jul 20, 2020
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ gen: mocks sqlbin sdk
# Generates the SDKs
.PHONY: sdk
sdk: .bin/cli
swagger generate spec -m -o ./.schema/api.swagger.json -x internal/httpclient,gopkg.in/square/go-jose.v2
swagger generate spec -m -o ./.schema/api.swagger.json -x internal/httpclient -x gopkg.in/square/go-jose.v2
cli dev swagger sanitize ./.schema/api.swagger.json
swagger flatten --with-flatten=remove-unused -o ./.schema/api.swagger.json ./.schema/api.swagger.json
swagger validate ./.schema/api.swagger.json
Expand Down
12 changes: 6 additions & 6 deletions consent/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestSDK(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, 1, len(csGot.Payload))
cs := csGot.Payload[0]
assert.Equal(t, "challenge3", cs.ConsentRequest.Challenge)
assert.Equal(t, "challenge3", *cs.ConsentRequest.Challenge)

csGot, err = sdk.Admin.ListSubjectConsentSessions(admin.NewListSubjectConsentSessionsParams().WithSubject("subject2"))
require.NoError(t, err)
Expand All @@ -142,7 +142,7 @@ func TestSDK(t *testing.T) {

luaGot, err := sdk.Admin.AcceptLogoutRequest(admin.NewAcceptLogoutRequestParams().WithLogoutChallenge("challengetestsdk-1"))
require.NoError(t, err)
assert.EqualValues(t, "https://www.ory.sh/oauth2/sessions/logout?logout_verifier=verifiertestsdk-1", luaGot.Payload.RedirectTo)
assert.EqualValues(t, "https://www.ory.sh/oauth2/sessions/logout?logout_verifier=verifiertestsdk-1", *luaGot.Payload.RedirectTo)

_, err = sdk.Admin.RejectLogoutRequest(admin.NewRejectLogoutRequestParams().WithLogoutChallenge("challengetestsdk-2"))
require.NoError(t, err)
Expand All @@ -152,14 +152,14 @@ func TestSDK(t *testing.T) {
}

func compareSDKLoginRequest(t *testing.T, expected *LoginRequest, got models.LoginRequest) {
assert.EqualValues(t, expected.Challenge, got.Challenge)
assert.EqualValues(t, expected.Subject, got.Subject)
assert.EqualValues(t, expected.Skip, got.Skip)
assert.EqualValues(t, expected.Challenge, *got.Challenge)
assert.EqualValues(t, expected.Subject, *got.Subject)
assert.EqualValues(t, expected.Skip, *got.Skip)
assert.EqualValues(t, expected.Client.GetID(), got.Client.ClientID)
}

func compareSDKConsentRequest(t *testing.T, expected *ConsentRequest, got models.ConsentRequest) {
assert.EqualValues(t, expected.Challenge, got.Challenge)
assert.EqualValues(t, expected.Challenge, *got.Challenge)
assert.EqualValues(t, expected.Subject, got.Subject)
assert.EqualValues(t, expected.Skip, got.Skip)
assert.EqualValues(t, expected.Client.GetID(), got.Client.ClientID)
Expand Down
Loading