Secure PubNub applications with Access Manager, encryption, and TLS
Does it follow best practices?
Evaluation — 95%
↑ 1.13xAgent success when using this tile
Validation for skill structure
A legal services firm needs to share confidential case documents between attorneys and clients through their real-time platform built on PubNub. Documents include contracts, court filings, and privileged communications that must never be readable by any intermediary, including PubNub's own infrastructure. Additionally, when an attorney-client relationship ends or a case is closed, all sharing access for that case must be immediately revoked.
The firm's IT team needs two components: a server-side module that manages file sharing tokens and revocation, and a client-side module that handles the actual encrypted file upload and download. The security team has also asked for a script that demonstrates the full lifecycle -- granting access, sharing a file, and then revoking access -- with logging at each step so they can audit the flow. They specifically want the audit log to note any caveats or timing considerations around the revocation taking effect.
Create the following files:
file-sharing-server.js -- Server-side module with:
file-sharing-client.js -- Client-side module with:
lifecycle-demo.js -- A script that walks through the complete token lifecycle: