File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/auth/src/team/selectors Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ export * from './hasRole.js'
55export * from './hasServer.js'
66export * from './invitation.js'
77export * from './keyMap.js'
8+ export * from './keyring.js'
89export * from './keys.js'
910export * from './lockboxesInScope.js'
1011export * from './member.js'
Original file line number Diff line number Diff line change 1+ import { type KeysetWithSecrets , createKeyring , type KeyScope } from '@localfirst/crdx'
2+ import { type TeamState } from 'team/types.js'
3+ import { keyMap } from './keyMap.js'
4+
5+ /**
6+ * Returns a keyring containing all generations of keys for the given scope.
7+ */
8+
9+ export const keyring = ( state : TeamState , scope : KeyScope , keys : KeysetWithSecrets ) => {
10+ const foo = keyMap ( state , keys )
11+ const allKeys = foo [ scope . type ] ?. [ scope . name ]
12+ return createKeyring ( allKeys )
13+ }
You can’t perform that action at this time.
0 commit comments