Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
synapse-dev | aa80d34 | Commit Preview URL Branch Preview URL |
Feb 19 2026, 06:18 PM |
| * console.log(expirations) | ||
| */ | ||
| export async function getExpirations(client: Client<Transport, Chain>, options: getExpirations.OptionsType) { | ||
| const expirations: Record<SessionKeyPermissions, bigint> = EMPTY_EXPIRATIONS |
There was a problem hiding this comment.
| const expirations: Record<SessionKeyPermissions, bigint> = EMPTY_EXPIRATIONS | |
| const expirations: Record<SessionKeyPermissions, bigint> = { ...EMPTY_EXPIRATIONS } |
| readonly expirations: Record<SessionKeyPermissions, bigint> | ||
| hasPermission: (permission: SessionKeyPermissions) => boolean | ||
| syncExpirations: () => Promise<void> | ||
| connect: () => void |
There was a problem hiding this comment.
| connect: () => void | |
| async connect: () => void |
?
There was a problem hiding this comment.
| connect: () => void | |
| async connect: () => Promise<void> |
| const permission = getPermissionFromTypeHash(hash) | ||
| this.expirations[permission] = event.args.expiry | ||
| } | ||
| this.emit('expirationsUpdated', this.#expirations) |
There was a problem hiding this comment.
and if it fails and doesn't even get here?
| * @param logs - The transaction logs. | ||
| * @returns The AuthorizationsUpdated event. | ||
| */ | ||
| export function extractRevokeEvent(logs: Log[]) { |
There was a problem hiding this comment.
could just reuse the login one to do the same job?
| error: CustomEvent<Error> | ||
| } | ||
|
|
||
| export type SessionKeyType = 'Secp256k1' | 'P-256' |
|
This might be a good opportunity to deal with Perhaps:
Not a blocker, but the current session key code gives the impression this is all canonical and a closed set of permissions. But developers should be able to use the registry to do non-FWSS things and having an SDK that makes that easy would be nice. |
|
Will I be able to pass |
Yeah not sure yet, because session keys only works for those 4 mutations (maybe just 3 if delete dataset is gone), some of the other services do other mutations that need the root client. I think for now I'm just adding a new constructor option to pass a session keys and internally use if available and has permission. There's one subtle thing in this design, that I want your opinion. The connect/disconnect are actually optional, they are there if you want realtime tracking of the permissions, if you don't you can just pass whatever expirations you got from login and YOLO the mutations. I will be cleaning up with your comments and finish testing hopefully sps work today. |
Pass to where? I don't think we care in any of the places we use it, so this isn't an internal concern. I think the answer here is to just document how expirations work and for long-lived session key instances advise that the developer should be sure to refresh expiries occasionally to be sure to perform |
Example usage: