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: replace Zauth transaciton signature endpoint with correct response #1123

Merged
merged 1 commit into from
Nov 4, 2024
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
4 changes: 2 additions & 2 deletions internal/api/util/client/zauth_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func (c *ZauthClient) UpdateRestrictions(t *test.SystemTest, clientID string, re
return resp, err
}

func (c *ZauthClient) SignTransaction(t *test.SystemTest, signTransactionRequest *transaction.Transaction, headers map[string]string) (*transaction.Transaction, *resty.Response, error) {
func (c *ZauthClient) SignTransaction(t *test.SystemTest, signTransactionRequest *transaction.Transaction, headers map[string]string) (string, *resty.Response, error) {
t.Logf("signing transaction for peer public key [%v] and for jwt token [%v] using zauth...", headers["X-Peer-Public-Key"], headers["X-Jwt-Token"])
var signTransactionResponse *transaction.Transaction
var signTransactionResponse string

urlBuilder := NewURLBuilder()
err := urlBuilder.MustShiftParse(c.zauthEntrypoint)
Expand Down
5 changes: 2 additions & 3 deletions tests/api_tests/zauth_operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,11 @@ func TestZauthOperations(testSetup *testing.T) {
TransactionData: string(data),
}

transaction, response, err := zauthClient.SignTransaction(t, signTransactionPayload, headers)
signature, response, err := zauthClient.SignTransaction(t, signTransactionPayload, headers)
require.NoError(t, err)
require.Equal(t, 200, response.StatusCode(), "Response status code does not match expected. Output: [%v]", response.String())
require.Equal(t, transaction.ClientID, CLIENT_ID_A)

ok, err := crypto.Verify(t, PUBLIC_KEY_I, transaction.Signature, HASH)
ok, err := crypto.Verify(t, PUBLIC_KEY_I, signature, HASH)
require.NoError(t, err)
require.True(t, ok)

Expand Down
Loading