Challenges Building and Integrating Test and Live API keys

10 views
Skip to first unread message

Miracle

unread,
Jun 15, 2021, 10:08:59 PM6/15/21
to django...@googlegroups.com

I want to create a system that works similar to stripe. There'll be live API keys, as well as test API keys. I have been thinking of how to implement this architecture, and I am not sure the best way to go about it. I found a similar question on this but it didn't help much.

Architecturing testmode/livemode using OAuth 2 token

My current progress is basically:

  • I have decided to use https://github.com/James1345/django-rest-knox instead of DRF's default authtoken because knox supports multiple token creation and I thougt I needed that feature.
  • I intend to create tokens as pub_key_<token> and test_key_<token> and remove or strip the prefix before authentication
  • I intend to create a LiveAccount Model and a TestAcoount model.

However, after authenticating the request from a test api token, it's unclear how to route or perform requests to TestAcoount instead of LiveAccount.

Please any ideas or a better implementation strategy is highly welcomed

stackoverflow link: https://stackoverflow.com/questions/67995479/create-accounts-and-api-tokens-for-live-mode-and-test-mode

Reply all
Reply to author
Forward
0 new messages