Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Create DataVaultProvider Web Client SDK #3

Closed
javiesses opened this issue Oct 9, 2020 · 0 comments · Fixed by #11
Closed

Create DataVaultProvider Web Client SDK #3

javiesses opened this issue Oct 9, 2020 · 0 comments · Fixed by #11
Labels
enhancement New feature or request
Milestone

Comments

@javiesses
Copy link
Contributor

javiesses commented Oct 9, 2020

  • Receives:
    • web3Provider/signer function and a did. Will be used to authenticate
    • Optional: storage get and set functions. Will be used to save the access token so it can be reused. Default: window.localStorage. This is an option for other clients, like mobile applications.
  • Implements @rsksmart/express-did-auth authentication protocol - RIFID-450
    • The login will be done in the first interaction with the DV API and the token will be saved in the provided storage so it can be reused
  • Speaks with DV Service API
  • Encrypts/decrypts content prior to put or after retrieving it from the DV Service
  • WebJS compatible
type Key = string
type ContentIdentifier = string
type Content = string // if it is a JSON, must be stringified

type PutFilePayload = { key: Key, content: Content }
type PutFileResponse = { id: ContentIdentifier }
type GetFilePayload = { key: Key }
type GetFileResponse = { id: ContentIdentifier, content: Content }
type DeleteFilePayload = { key: Key, id: Identifier }
type DeleteFileResponse = {}
type SwapFilePayload = { key: Key, id: ContentIdentifier, content: Content }
type SwapFileResponse = { id: ContentIdentifier }

interface DataVaultWebClient {
  put(payload: PutFilePayload): PutFileResponse
  put(payload: PutFilePayload[]): PutFileResponse[]
  get(payload: GetFilePayload): GetFileResponse[]
  get(payload: GetFilePayload[]): GetFileResponse[]
  delete(payload: DeleteFilePayload): DeleteFileResponse
  delete(payload: DeleteFilePayload[]): DeleteFileResponse[]
  swap(payload: SwapFilePayload): SwapFileResponse
  swap(payload: SwapFilePayload[]): SwapFileResponse[]
}
@javiesses javiesses added the enhancement New feature or request label Oct 9, 2020
@javiesses javiesses added this to the v0.1 milestone Oct 9, 2020
@javiesses javiesses mentioned this issue Nov 13, 2020
12 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant