baks-dev/auth-yandex
Yandex ID authorization module for BaksDev. Install with composer require baks-dev/auth-yandex, create a Yandex ID app with redirect to /auth/yandex, set YANDEX_CLIENT_ID and YANDEX_CLIENT_SECRET in .env, then install assets and run migrations.
Architecture fit. baks-dev/auth-yandex is a Symfony bundle, not a Laravel package. It ships bin/console commands (baks:assets:install), Doctrine migrations (doctrine:migrations:diff|migrate), and depends on baks-dev/core:^7.4 plus PHP 8.4+. There is no ServiceProvider, no config/auth.php guard/driver, no Artisan command, no Blade views. In a Laravel codebase, composer require succeeding is not evidence that anything executes. Architecturally the package is one thing: a Yandex ID OAuth 2.0 flow (~150 lines of real logic) plus a Doctrine identity table, wrapped in Symfony conventions.
Integration feasibility. Two honest paths:
| Path | When it applies | Effort | Verdict |
|---|---|---|---|
| Adopt as a dependency | You already run Symfony + baks-dev/core |
Low (config + migrations + Yandex app) | Genuine drop-in |
| Use as reference implementation | Laravel / non-Symfony stack | 2–4 eng-days | Recommended default |
| Side-by-side Symfony kernel | You already run Symfony components and refuse to reimplement | High, two runtimes, two session models | Avoid unless forced |
For a typical Laravel shop, the package's value is as a specification: it pins the endpoints (oauth.yandex.ru/authorize, /token, login.yandex.ru/info), the scope set, the format=json parameter, and the identity schema. That is a real, if modest, saving — it de-risks protocol details that are otherwise guessed from Yandex docs.
Technical risk.
v7.4.5 — v7.4.5. No community, no CVE history, no third-party usage to learn from. Treat it as vendor-adjacent code you will own.composer why baks-dev/auth-yandex before planning. Do not discover this in staging.string → 255, datetime vs timestamp, differing unique-index naming. A missed unique index on the Yandex identifier produces duplicate-user bugs that only surface under concurrent registration.baks:assets:install on a Laravel app will either error or quietly do nothing, because there is no asset pipeline to publish into. Commands that fail loudly are fine; commands that succeed and do nothing are how teams ship broken auth.Key questions to resolve before committing.
YANDEX_CLIENT_ID / YANDEX_CLIENT_SECRET from $_ENV directly, or from a Symfony param bag requiring config/packages/*.yaml? Grep vendor/ — the README does not say./callback suffix)? Yandex is byte-strict; mismatches surface as an undetailed invalid_request.login:email, login:info)? Are they minimal for our use case?baks-dev/core:^7.4 impose — does it expect its own user entity, base tables, or an existing Baks schema? This determines whether the migrations are additive or parasitic.7.4.x line?/ru/auth/yandex)? Redirect URI drift is the top production failure.Stack fit. In Laravel, keep Laravel as front controller and treat the package as protocol documentation. One thin controller owns redirect + callback; the package's flow is re-expressed in Laravel idioms (Http::asForm(), Auth::login()). In Symfony on baks-dev/core, install it properly: composer require, Yandex app registration, .env keys, baks:assets:install, doctrine:migrations:diff → review the SQL → migrate.
Migration path (Laravel).
composer require baks-dev/auth-yandex in a throwaway branch purely to read vendor/ — src/Controller, src/Security, OAuth client, Migrations/. Uninstall afterwards if PHP 8.4 blocks it; clone the repo instead.https://<DOMAIN>/auth/yandex. Do this early — app review is a lead-time item outside engineering's control.yandex_identities pivot (user_id FK, yandex_id unique, nullable email, email_verified, timestamps). Do not add columns to users.state stored in session, validated via hash_equals on a session()->pull() value.yandex_id first; on email collision with an existing local account, require explicit confirmation rather than silent linking.Http::fake() — happy path, bad state, error=access_denied, email-already-taken, second login for a known yandex_id (no duplicate row).Compatibility. Gate on PHP 8.4 first; it is the single most likely blocker and it is binary. If you reimplement, you need neither Doctrine nor baks-dev/core — only the HTTP contract. If you adopt, confirm your Symfony version and baks-dev/core constraint align before sequencing anything else.
Sequencing. (1) Vendor read spike, 1 day. (2) Decision: adopt vs reimplement — make it explicitly, in writing. (3) Yandex app registration, parallel track, longest lead time. (4) Schema. (5) Redirect/callback behind a feature flag. (6) Linking policy + security review. (7) Token storage. (8) Tests. (9) Staged rollout. Do not start with roles, account unlinking, or refresh-token rotation.
Maintenance. Assume you own the code regardless of path. Zero dependents and zero stars mean no downstream pressure to fix breakage; upstream churn is unpredictable and undocumentable. Pin an exact version, vendor the source if adopting, and budget a quarterly review of the Yandex OAuth contract (scopes, endpoint hostnames) — providers do deprecate.
Support. Effectively none. Documentation is a Russian-language README covering install and env only; the only real spec is the --group=auth-yandex test suite. There is no SLA, no maintainer responsiveness signal, and no community to search. Any incident is an internal incident. Plan for a named owner on the team, not "whoever touched auth last."
Scaling. The OAuth flow itself is not a scaling concern — it is a low-volume, per-login handshake. Watch three things: (a) server-side token storage growth and expiry cleanup; (b) session-backed state under multi-instance deployments (shared session store required, or sticky/stateless handling); (c) Yandex API rate limits and latency on /token and /info during login spikes — the callback is now on the critical path of your login funnel and a Yandex slowdown is your outage. Add a timeout and a graceful "try another sign-in method" fallback.
Failure modes to instrument.
| Failure | Symptom | Detection |
|---|---|---|
| Redirect URI mismatch | Generic invalid_request from Yandex |
Alert on callback error-rate spike; verify URI in console |
| Missing/rotated env secret | 500 on callback | Startup config assertion |
| Translated migration drops unique index | Duplicate users under concurrency | Schema test + unique constraint assertion |
| Email-based auto-link | Account takeover | Security review gate; never ship silent linking |
state not validated |
CSRF on login endpoint | Contract test |
| User denies consent | error=access_denied |
Handle as a normal redirect, not a 500 |
| Yandex outage | Login funnel drop | Timeout + fallback path + metric |
baks:assets:install no-op |
Nothing, apparently successfully | Don't run it outside Symfony |
Ramp-up. Roughly 1 day to read and understand the vendor tree, 2–4 days to build and test a Laravel bridge, plus Yandex app approval lead time (outside your control — start it on day one). Required skills: OAuth 2.0 fundamentals, Laravel HTTP client and testing, and one security review pass focused on state validation and account linking. Total TPM-level estimate: one engineer, one sprint, most of it spent on the linking policy and tests rather than the protocol.
Bottom line. The package is a small, single-purpose Symfony bundle with no ecosystem validation and a future-dated release. In a Symfony-on-baks-dev/core stack it is a reasonable low-effort add. Everywhere else it is a reference implementation worth one day of reading and not a dependency worth owning — the Yandex OAuth flow is small enough that reimplementing it in your own framework yields better long-term supportability, clearer security semantics around account linking, and no PHP 8.4 upgrade coupling.
How can I help you explore Laravel packages today?