Skip to content

fix(translate): move Smartling auth to da-etc and auto-connect, matching Trados/Lionbridge - #719

Draft
markdaugherty wants to merge 4 commits into
mainfrom
smartling-da-etc-auth
Draft

fix(translate): move Smartling auth to da-etc and auto-connect, matching Trados/Lionbridge#719
markdaugherty wants to merge 4 commits into
mainfrom
smartling-da-etc-auth

Conversation

@markdaugherty

@markdaugherty markdaugherty commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Add smartling/auth.js: gets short-lived tokens from da-etc instead of sending raw userIdentifier/userSecret from the browser to Smartling
  • smartling/index.js keeps only Smartling API business logic; connect()/isConnected() and per-request auth delegate to auth.js
  • Extend loc/utils/auth.js (already shared by Trados/Lionbridge) with connector-agnostic login/getCachedToken/setCachedToken helpers, reused by Smartling's auth flow
  • isConnected/connect now share one implementation that authenticates via da-etc on a cache miss, so Smartling connects automatically like Trados/Lionbridge instead of requiring a manual "Connect" click before starting a project
  • Update Smartling connector tests for the new auth flow, including coverage for the auto-connect path

Full test suite (105 files) passes locally.

Mark Daugherty and others added 3 commits September 2, 2026 19:57
- Add smartling/auth.js: gets short-lived tokens from da-etc instead of
  sending raw userIdentifier/userSecret from the browser to Smartling
- smartling/index.js keeps only Smartling API business logic; connect()/
  isConnected() delegate to auth.js
- Extract shared da-etc login + token-cache helpers into loc/utils/auth.js,
  used by both trados/auth.js and smartling/auth.js
- Scope cached tokens by org/site/env (loc/utils/auth.js tokenKey) so
  different sites no longer collide on the same cache entry
- Update smartling connector tests for the new auth flow

Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts:
#	nx/blocks/loc/connectors/smartling/index.js
#	nx/blocks/loc/connectors/trados/auth.js
#	nx/blocks/loc/utils/auth.js
#	test/loc/connectors/smartling/index.test.js
- smartling/index.js delegates isConnected/connect and per-request auth to
  auth.js instead of its own duplicated raw-credential flow (reintroduced
  by a merge)
- auth.js now reads the current token from the shared cache (getToken)
  instead of a module-level variable
- utils/auth.js: rename loginViaDaEtc -> login

Co-Authored-By: Claude <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Sep 3, 2026

Copy link
Copy Markdown

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

  • Re-sync branch
Commits

…click

- isConnected/connect now share one ensureConnected() implementation that
  authenticates via da-etc on a cache miss, matching Trados/Lionbridge's
  authReady - no more separate manual "Connect" step to start a project
- Fixes a latent bug where a valid cached token was reported as
  disconnected if the refresh schedule was already armed
- Add test coverage for the auto-connect path

Co-Authored-By: Claude <noreply@anthropic.com>
@markdaugherty markdaugherty changed the title fix(translate): move Smartling auth to da-etc, matching Trados/Lionbridge fix(translate): move Smartling auth to da-etc and auto-connect, matching Trados/Lionbridge Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant