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

Migrate from WG API to Proxy #193

Open
NikoGrano opened this issue Apr 27, 2020 · 0 comments · Fixed by #196
Open

Migrate from WG API to Proxy #193

NikoGrano opened this issue Apr 27, 2020 · 0 comments · Fixed by #196
Assignees
Labels
enhancement New feature or request

Comments

@NikoGrano
Copy link
Member

Wargaming API Proxy

Due fact we cannot publish application_id paramter in release application, we have to use our proxy. Also we perform caching on this proxy service to not exceed rate-limiting. Clients are also rate-limited in case they start just spamming us.

All calls which you are now doing to the Wargaming API directly must be rewritten to use this proxy. Instead of using the application_id query parameter you will use Authorization: JwtTokenHere style header authentication. Please also provide required other headers like X-Game and X-Region.

Please see full logic graph bellow.

CORS

Proxy applies CORS rules. CORS is limited currently only to production site usage.

Header Tokens

You can select game and region with HTTP headers.
Region is always mandatory, but if API call includes
game as first path query parameter, will that be used.

For example: api.xxx.eu/wot/account/list will return wot as it is first path argument.

Available tokens are following:

Header Possible Values Description
X-Region eu,na,ru,asia Which region API server we should use.
X-Game wot,wows,wowp Which game API server we should use.

Other

URL to the proxy is not public. Please ask discord #developers to get link to it from @NikoGrano.

Logic

Proxy implementation logic is following

image

@NikoGrano NikoGrano added the enhancement New feature or request label Apr 27, 2020
bryansamuel1 added a commit that referenced this issue May 1, 2020
…uthentication + Implement premature code for Socket.io (#196)

* WIP

* #193 - Migrate from WG API to Proxy + update Room state

* Remove console logs for authentication
NikoGrano pushed a commit that referenced this issue May 3, 2020
…uthentication + Implement premature code for Socket.io (#196)

* WIP

* #193 - Migrate from WG API to Proxy + update Room state

* Remove console logs for authentication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants