Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

API not capable of multi-tenancy??? #99

Description

@h-e-n-r-y

I am developing an application for different users each having different api keys.

When I create different clients with different api keys I always get clients that deliver data according to the first created client:

package de.hw4.binance.marketmaker.impl;

import org.junit.Assert;
import org.junit.Test;

import com.binance.api.client.BinanceApiClientFactory;
import com.binance.api.client.BinanceApiRestClient;


public class MultiApiKeyTest {
	
	@Test
	public void test2DifferentClients() {
		
		BinanceApiClientFactory factory1 = 
				BinanceApiClientFactory.newInstance(
						"insert your api-key#1", 
						"insert your secret#1");
	BinanceApiRestClient client1 = factory1.newRestClient();

	BinanceApiClientFactory factory2 = 
			BinanceApiClientFactory.newInstance(
					"insert your api-key#2 or even an invalid key will work!", 
					"insert your secret#2");
	BinanceApiRestClient client2 = factory2.newRestClient();
	
	int size1 = client1.getAccount().getBalances().size();
	
	// should throw a
	// BinanceApiException: API-key format invalid.
	int size2 = client2.getAccount().getBalances().size();
	
	Assert.assertNotEquals("two balances should not be equal!", size1, size2);


	}

}

client2 reveals data belonging to the api-key#1.

I guess this is a major bug! Or what am I doing wrong...

Henry

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions