@ccmsg/protocol 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/common/auth.ts +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccmsg/protocol",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Wire contract (schema + types + op attribute table) shared by the ccmsg daemon and web UI",
5
5
  "license": "MIT",
6
6
  "author": "kawaz",
@@ -306,7 +306,21 @@ export const AuthResolveResponse = response("auth_resolve", AuthResolveResult);
306
306
  * parallel would merge by last write and lose a generation, which reads exactly
307
307
  * like a stolen token being replayed — so the rotation is forwarded rather than
308
308
  * done where the request landed. */
309
- export const AuthRotateArgs = Type.Object({ refresh_token: Base64Url });
309
+ export const AuthRotateArgs = Type.Object({
310
+ refresh_token: Base64Url,
311
+ /** What the receiving instance observed of the caller, carried to the issuer
312
+ * for `last_refresh`. The person is at the other end of the receiver's
313
+ * connection, not the issuer's, so these are only knowable there; forwarded
314
+ * without them, a rotation would be remembered as a time and nothing else.
315
+ *
316
+ * Stated by the receiver and never checked by the issuer — the same standing
317
+ * as the values on a rotation that was not forwarded, which the client and
318
+ * its connection are equally the only source of. Nothing may be decided by
319
+ * them. */
320
+ reason: Type.Optional(AuthRefreshReason),
321
+ ip: Type.Optional(Type.String({ minLength: 1, maxLength: 45 })),
322
+ user_agent: Type.Optional(Type.String({ maxLength: 512 })),
323
+ });
310
324
  export type AuthRotateArgs = Static<typeof AuthRotateArgs>;
311
325
 
312
326
  /** Both halves, unlike the person-facing ops: the instance that asked for the