Skip to content

MWPW-192707 Decryption Utility - #58

Open
KetakiD-Deshwandikar wants to merge 51 commits into
stagefrom
decrypt-url
Open

MWPW-192707 Decryption Utility#58
KetakiD-Deshwandikar wants to merge 51 commits into
stagefrom
decrypt-url

Conversation

@KetakiD-Deshwandikar

@KetakiD-Deshwandikar KetakiD-Deshwandikar commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Resolves: MWPW-192707

Summary

  • Adds a decrypt experience for the Trust Center URL utility (standalone decrypt.html + shared utils.js) and extends the protect (encrypt) flow.

  • Decrypt is IMS-gated and limited to signed-in users with a corporate Adobe ID (@adobe.com); the server still enforces access (401/403).

What is built

  • Protect (encrypt): User enters a plain www.adobe.com URL → client calls /trustcenter/api/encrypturl → shows protected/encrypted output; copy control; progress UI; validates host in prod (with ?nonprod=1 the host check is relaxed for QA).

  • Decrypt: User pastes protected text → client obtains IMS access token → POST /trustcenter/api/decrypturl with Authorization: Bearer and URL-safe base64 payload → shows decrypted URL; copy + error styling.

  • IMS: Milo loadIms, client adobedotcom-cc, email from profile or JWT if profile is missing.

  • Decrypt page UX: Field hint, “Sign in” overlay when auth is required, “Sign out” for corporate users, “Signed in as …” when profile shows @adobe.com.

API & environment routing
Stage APIs: https://www.stage.adobe.com/trustcenter/api/{encrypturl|decrypturl}
Prod APIs: https://www.adobe.com/trustcenter/api/{encrypturl|decrypturl}
Host allowlists map window.location.host (Franklin *.aem.page / *.aem.live, stage.adobe.com, www.stage.adobe.com, etc.) to the right endpoint; ?nonprod=1 on .aem.live hosts targets stage APIs for testing.
Edge case: If the page host is not in the allowlists, fetch may get an undefined URL — only matters for unknown preview hosts.

Security & access (client)
Decrypt: Requires signed in + access token; 403 → not an Adobe employee; 401 → sign in again.
Non–@adobe.com (when we can read email): Access denied copy, form disabled ~3s, then sign out + IMS sign-in with reAuthenticate + prompt: 'login' to reduce silent wrong-account reuse.
Server remains source of truth; client rules are UX + avoiding useless calls.

Session, tabs, and idle (client-only)
localStorage tracks last activity and session start; 30 min idle or 8 h max session (and JWT exp with 1 min skew) can end the utility session for @adobe.com decrypt users.
On expiry / teardown: sign out path, clear session keys, broadcast to other tabs → reload / sync IMS; decrypt uses full sign-in options after certain flows (e.g. peer tab sign-out) so IMS shows a real login.
Activity throttled on pointer / key / scroll to refresh “last activity.”

Manual sign-out
“Sign out”as as small blue inline linknext to“Signed in as …”(not a large primary button).
Triggers full IMS sign-out for the tool,broadcasts to other tabs, clears client session tracking, then prompts IMS sign-inagain — same core behavior assession expiry for decrypt.

Session & tab behavior (client-side UX; APIs unchanged)

Idle timeout:30 minuteswithout meaningful activity (shared across tabs on the same site vialocalStorage).
Maximum session:8 hours from when the tracked session started.
Access token expiry:When the IMS JWT is expired (with a small clock-skew buffer), user is signed out and prompted to sign in again.
Corporate-only:Idle / max session checks apply when the user is recognized as@adobe.comso the non‑employee denied flow is unchanged.
Cross-tab sync:Signing out in one tab notifies other open tabs on thes ame origin so they reload/sign out and stay aligned.

Error / edge messaging
Empty decrypt input → “Please enter the protected link.” (not generic decrypt failure).
Sign-in required → dedicated copy + Sign in UI.
Not @adobe.com → access denied path above.
Other failures → generic “could not decrypt / check input.”
Protect invalid/empty input → www.adobe.com validation messages (unchanged pattern).

Out of scope / dependencies for reviewers
Edge / proxy: www.stage.adobe.com / www.adobe.com must expose /trustcenter/api/decrypturl (same class of setup as encrypt). 404 there is infra, not fixable in this PR alone.

screen-recording-2026-05-07-at-91332-pm_9fraBel9.mp4

@aem-code-sync

aem-code-sync Bot commented May 8, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

Comment thread tools/ms-apps/daUtils.js Outdated
Comment thread tools/ms-apps/daUtils.js
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
@nkthakur48

Copy link
Copy Markdown
Collaborator

@KetakiD-Deshwandikar Once this is ready, please let us know and we could start the review!
CC: @adeshmukh-1585

Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
@KetakiD-Deshwandikar

KetakiD-Deshwandikar commented May 28, 2026

Copy link
Copy Markdown
Collaborator Author

@KetakiD-Deshwandikar Once this is ready, please let us know and we could start the review! CC: @adeshmukh-1585

Hi @nkthakur48 fixed linting issues would u plz review the PR.
cc:@adeshmukh-1585

@codecov-commenter

codecov-commenter commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.82%. Comparing base (a36ffd9) to head (4cf1a4e).
⚠️ Report is 53 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage      #58      +/-   ##
==========================================
- Coverage   88.79%   87.82%   -0.97%     
==========================================
  Files          42       43       +1     
  Lines        9512     9601      +89     
==========================================
- Hits         8446     8432      -14     
- Misses       1066     1169     +103     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aem-code-sync
aem-code-sync Bot temporarily deployed to decrypt-url June 1, 2026 06:03 Inactive
hkhatana26
hkhatana26 previously approved these changes Jun 4, 2026
@hkuraware
hkuraware requested a review from nkthakur48 June 4, 2026 05:36
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
hkuraware
hkuraware previously approved these changes Jun 4, 2026
hkhatana26
hkhatana26 previously approved these changes Jun 4, 2026
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Comment thread tools/trustcenter/js/utils.js Outdated
Ketaki Deshwandikar added 23 commits July 13, 2026 10:05
…S signIn with

  reAuthenticate/prompt login (no extra “switch account” UI).
- @adobe.com: show “Signed in as …” under the field; reset when sign-in required again.
- Session UX (client-side; APIs unchanged): shared localStorage activity + max session
  windows, JWT exp check, periodic/visibility checks; idle/max enforced only for corporate
  decrypt users so personal-ID denied flow is unchanged.
- Cross-tab: broadcast on sign-out so other tabs reload/sync IMS state.
- Add “Sign out” next to signed-in hint; same teardown path as session expiry
  (broadcast, signOut, clear keys, IMS signIn).
@adobecom-git-stale-pr-bot

Copy link
Copy Markdown

No activity in 7 days. Will be labeled stale at 14 days. Auto-close is disabled this run. Add stale-ignore to exempt.

No activity in 14 days, labeled stale (removed automatically on new activity). Auto-close is disabled this run. Add stale-ignore to exempt.

No activity in 21 days, labeled autoclose-pending (removed automatically on new activity). Would normally close in 7 days, but auto-close is disabled this run. Add autoclose-ignore to exempt.

No activity in 28 days. Would normally close now, but auto-close is disabled this run. Add autoclose-ignore to exempt.


Rundeck job Git Stale PR Check (git-stale-pr-bot), execution 2739336, project global, run by casalino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose-pending Will be auto-closed soon stale No recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants