NetworkUserTokenValidAfterPayload network.user.token_valid_after@1

Generated at from openvibe-contracts v0.44.0 and openvibe-sdk v0.9.1.

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/network.user.token_valid_after.v1.json

network.user.token_valid_after v1 (OpenVibe.Network server/auth/revocation.js). A person's tokens issued before valid_after are no longer good: every service that accepts Network user tokens refuses one whose iat (seconds) * 1000 is less than valid_after (milliseconds), exactly as Network does, drops what it cached for that person's older tokens and closes the sockets they opened. Emitted in the transaction that moves the cutoff: a password change or reset, sign out everywhere, a ban, an account deletion, or staff ending someone's sessions. Consumers keep the latest valid_after per subject and ignore an older one (events can arrive out of order). Envelope: subject { type: user, id }, visibility internal, actor the person (their own change) or the staff member / system:network.

Fields

FieldTypeRequiredDescriptionConstraints
subjectobjectyesThe person (identity.subject-ref@1, a user).
  • no other fields
subject.typeconstyes
  • = "user"
subject.idstringyes
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
valid_afterstringyesTokens issued before this instant are refused (compare iat * 1000 < Date.parse(valid_after)).
  • format date-time
reasonenumyesWhy the cutoff moved. Consumers treat every reason the same; it is for logs and support.
  • one of "password_changed", "password_reset", "signed_out_everywhere", "banned", "account_deleted", "staff_revoked"

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: password-changed
{
  "subject": {
    "type": "user",
    "id": "usr_01J8Z3Q4R5S6T7V8W9X0Y1Z2A3"
  },
  "valid_after": "2026-09-24T20:15:07Z",
  "reason": "password_changed"
}
Valid: signed-out-everywhere
{
  "subject": {
    "type": "user",
    "id": "usr_01J8Z3Q4R5S6T7V8W9X0Y1Z2A3"
  },
  "valid_after": "2026-09-24T20:15:00.000Z",
  "reason": "signed_out_everywhere"
}
Rejected: guest-subject
{
  "subject": {
    "type": "guest",
    "id": "gst_01J8Z3Q4R5S6T7V8W9X0Y1Z2A3"
  },
  "valid_after": "2026-09-24T20:15:00Z",
  "reason": "signed_out_everywhere"
}
Rejected: unknown-reason
{
  "subject": {
    "type": "user",
    "id": "usr_01J8Z3Q4R5S6T7V8W9X0Y1Z2A3"
  },
  "valid_after": "2026-09-24T20:15:00Z",
  "reason": "felt_like_it"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('network.user.token_valid_after@1', value);   // { valid, errors: [{ path, message }] }