logux / client

Logux base components to build web client
https://logux.org/
MIT License
663 stars 47 forks source link

can pass in either a key or password string #105

Closed nichoth closed 9 months ago

nichoth commented 9 months ago

I'm not sure if this project is open to PRs. This adds the ability to pass either a CryptoKey or a password string into encryptActions, ie

import { encryptActions } from '@logux/client'

const myKey = await crypto.subtle.generateKey(
    {
        name: 'AES-GCM',
        length: 256,
    },
    true,
    ['encrypt', 'decrypt']
)

// ...

encryptActions(client, myKey, {
  ignore: ['server/public']  // action.type to not be encrypted
})

I wasn't sure how to add a test for this.

ai commented 9 months ago

I rebased the branch to next (where we accumulate all new changes). Please, resolve conflicts.

ai commented 9 months ago

This is how I fixed the PR bfb2592