Public shape of a connection: everything except the secret.
(connection)
| 232 | |
| 233 | /** Public shape of a connection: everything except the secret. */ |
| 234 | function toMetadata(connection) { |
| 235 | if (!connection) return null; |
| 236 | return { |
| 237 | id: connection.id, |
| 238 | kind: connection.kind, |
| 239 | label: connection.label, |
| 240 | teamName: connection.teamName ?? null, |
| 241 | email: connection.email ?? null, |
| 242 | expiresAt: connection.expiresAt ?? null, |
| 243 | // No readable token (a locked keychain, a lost key) means sign in again. |
| 244 | isExpired: isExpired(connection) || decrypt(connection) === null, |
| 245 | isSaved: connection.isSaved !== false, |
| 246 | }; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Where tokens are kept, for the UI. Mirrors the SecretStore when there is |