corbado-nodejs icon indicating copy to clipboard operation
corbado-nodejs copied to clipboard

Extend SDK to include FrontendAPI calls

Open incorbador opened this issue 1 year ago • 0 comments

Why

We have a Firebase extension that spins up a number of Firebase functions that run NodeJS. In them so far we directly make use of generated clients for frontendAPI and backendAPI. As we now have the new node-sdk we should use it inside this firebase extension. To make this possible we need to add the following calls:

  • passKeyRegisterStart
  • passKeyRegisterFinish
  • webAuthnRegisterStart
  • webAuthnRegisterFinish
  • passKeyMediationStart
  • passKeyLoginStart
  • passKeyLoginFinish
  • emailCodeLoginStart
  • emailCodeConfirm
  • userDelete
  • userGet
  • webAuthnCredentialList
  • webAuthnCredentialDelete
  • userUpdate

Firebase extension code: corbado_auth_firebase (the important file is corbado_service.ts)

Acceptance criteria

  • [ ] all the generated code inside the firebase extension can be replaced by the node-sdk

Implementation idea

  • add the required methods
  • write integration tests (I would skip the ones for webAuthnRegisterFinish, passKeyRegisterFinish and passKeyLoginFinish because testing them is hard as you need to mock the authenticator)
  • replace the generated code in the Firebase extension with the node-sdk

incorbador avatar Jan 19 '24 12:01 incorbador