-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pr/michaelkamphausen/126
- Loading branch information
Showing
12 changed files
with
280 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type KeysetWithSecrets, createKeyring, type KeyScope } from '@localfirst/crdx' | ||
import { type TeamState } from 'team/types.js' | ||
import { keyMap } from './keyMap.js' | ||
|
||
/** | ||
* Returns a keyring containing all generations of keys for the given scope. | ||
*/ | ||
|
||
export const keyring = (state: TeamState, scope: KeyScope, keys: KeysetWithSecrets) => { | ||
const foo = keyMap(state, keys) | ||
const allKeys = foo[scope.type]?.[scope.name] | ||
return createKeyring(allKeys) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { type KeysetWithSecrets, createKeyring } from '@localfirst/crdx' | ||
import { type KeysetWithSecrets } from '@localfirst/crdx' | ||
import { type TeamState } from 'team/types.js' | ||
import { KeyType } from 'util/types.js' | ||
import { keyMap } from './keyMap.js' | ||
import { keyring } from './keyring.js' | ||
|
||
const { TEAM } = KeyType | ||
|
||
export const teamKeyring = (state: TeamState, keys: KeysetWithSecrets) => { | ||
const allTeamKeys = keyMap(state, keys)[TEAM][TEAM] | ||
return createKeyring(allTeamKeys) | ||
} | ||
export const teamKeyring = (state: TeamState, keys: KeysetWithSecrets) => | ||
keyring(state, { type: TEAM, name: TEAM }, keys) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.