这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Jan 2, 2024

This PR adds ability to define what kind of keys are stored prod/staging:

  • The prod/staging is detected by existing the staging string in the restUrl config option: https://api-pub.bitfinex.com/https://api.staging.bitfinex.com
  • and isStagingBfxApi flag is set or updated on signUp/signIn to the user table
  • than, getUsers endpoint will return the isStagingBfxApi flag to be shown in the UI for each user on the login stage

Basic changes:

  • Adds isStagingBfxApi endpoint
  • Adds ability to returns isStagingBfxApi flag for signIn endpoint
  • Adds ability to return isStagingBfxApi flag for getUsers endpoint
  • Adds ability to set isStagingBfxApi flag on sign-up/sign-in
  • Adds v39 DB migration
  • Adds corresponding test coverage for isStagingBfxApi

isStagingBfxApi request example:

{
  "method": "isStagingBfxApi"
}

isStagingBfxApi response example:

{
    "jsonrpc": "2.0",
    "result": false,
    "id": null
}

signIn request example:

{
  "auth": {
    "email": "user@email.com",
    "isSubAccount": false
  },
  "method": "signIn"
}

signIn response example:

{
    "jsonrpc": "2.0",
    "result": {
        "email": "user@email.com",
        "isSubAccount": false,
        "token": "559cb736-ffdd-4f7d-9a53-362d913bdc16",
        "shouldNotSyncOnStartupAfterUpdate": false,
        "authTokenTTLSec": null,
        "localUsername": null,
        "lastSyncMts": 1704177514708,
        "isStagingBfxApi": false // The flag
    },
    "id": null
}

getUsers request example:

{
  "method": "getUsers"
}

getUsers response example:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "email": "user@email.com",
            "localUsername": null,
            "isSubAccount": false,
            "isNotProtected": true,
            "subUsers": [],
            "isRestrictedToBeAddedToSubAccount": true,
            "isApiKeysAuth": false,
            "isStagingBfxApi": false // The flag
        },
        {
            "email": "user+1@email.com",
            "localUsername": null,
            "isSubAccount": false,
            "isNotProtected": true,
            "subUsers": [],
            "isRestrictedToBeAddedToSubAccount": false,
            "isApiKeysAuth": true,
            "isStagingBfxApi": true // The flag
        }
    ],
    "id": null
}

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants