Skip to content

Commit

Permalink
fix: replaced zauth transaciton signature endpoint with correct response
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikRevich committed Nov 4, 2024
1 parent b9e3615 commit 7ca767c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit 7ca767c

Please sign in to comment.