feat(auth): add appliance-first local owner login

Analysed against 2a529bd610 files changedby 1012839419a-alt
Open PR on GitHub

Change-risk score

9.6out of 10Elevated
Repository health
4.8to5.4base against this head

This change sits in the top third of this repository's own risk distribution, the band worth reviewing closely. It is riskier than 89% of this repository's own commits.

The largest health movement is in fleet_auth.py, down 2.1. Nothing outside this PR depends on a contract it changed.

Files changed
10
in this diff
Contracts changed
0
removed or signature
Outside callers
0
not in this diff
Findings added
14
2 resolved

Blast radius on the repo map

Every file in the repository, grouped into its own directories and sized by lines. The ones this PR changes are lit, and everything that imports them is marked.

backendchromecompatdocsfrontendiiiopenspecscriptstestsapibrowser_act_packsschemasservicesskillsworkflowdify_gra…appcomponentslibchangesintegrationunitecommercelead-generati…social-listeningintellig…(app)flowprovidersrecordsuiflowworkflowapichannelscontrolpipeline
changed, health fellchanged, health rosechanged, health heldimports a changed fileuntouchedchanged by this PR

Drawing 1,502 of 1,656 files at a readable size, grouped by directory and sized by lines of code. 10 changed here reach 33 more by import. 154 are too small to see at this width, which is what the frame below is for.

Inside backend

agent_runtimesapibrowser_act_packschannelscontrolimage_st…llmmigratio…plan_irpluginsschemassecurityservicesskillsworkflowv1ecommercelead-generat…social-listeningversionsintelligencebrows…cr…opencli_…skil…agen…in…jo…__i…im…inte…cu…pi…exe…val…capa…cont…op…workf…url…image_s…op…plugin…prov…reco…cor…loo…tr…tasks…capabili…compiler…data_ope…dataflow…demand_a…dify_im…ex…fl…hda_tem…htt…int…joy…kat…las…nat…native_intell…nati…no…open…opencli_hd…patcher.pyresea…research_o…runti…runtime_regis…situa…swarm…tool_…trigg…tur…turb…tur…work…brow…cha…co…dashbo…image_st…nodes.…oper…ope…pr…pro…studi…st…ta…work…od…co…report…simula…SK…SK…SK…

630 files, 5 changed by this PR and 18 that import one. This PR changes 8 files in total, spread across more than one top-level directory. Click any directory above to frame it instead.

Changed

What this PR added, and what it took away

Introduced findings are the ones inside the lines this PR added, not the file's existing ones. The resolved column is the only place in the product that lists them.

Introduced (14)
  • mediumnested complexity
    backend/security/fleet_auth.py:171

    __call__ nests 4 levels deep

  • mediumcomplex method
    frontend/lib/api/client.ts:51

    normalizeApiError has cyclomatic complexity 10

  • mediumcomplex method
    backend/security/local_auth.py:226

    authenticate_local_owner has cyclomatic complexity 9

  • mediumcomplex method
    backend/security/local_auth.py:146

    claim_local_owner has cyclomatic complexity 13

  • mediumlarge method
    backend/security/fleet_auth.py:171

    __call__ is 94 lines long

  • mediumdry violation
    frontend/e2e/login.spec.mjs:29

    79% of file duplicated; worst clone shares 24 lines with frontend/e2e/login.spec.mjs

  • lowcomplex conditional
    backend/security/fleet_auth.py:214

    if condition combines 3 boolean operators

  • lowlarge method
    backend/security/local_auth.py:146

    claim_local_owner is 61 lines long

  • lowprimitive obsession
    backend/api/v1/identity.py:167

    _set_session_cookie takes 5 parameters

  • lowdry violation
    backend/api/v1/identity.py:58

    14% of file duplicated; worst clone shares 13 lines with backend/api/v1/identity.py

  • lowerror handling
    backend/security/fleet_auth.py:246

    broad `except Exception` catches unrelated errors and can hide bugs

  • lowerror handling
    frontend/components/auth/auth-provider.tsx:248

    caught exception is swallowed without any handling

  • lowbumpy road
    frontend/lib/api/server-auth.ts:6

    requireAuthenticatedMutation has 3 nested blocks at the same level (bumpy road)

  • lowprimitive obsession
    backend/security/local_auth.py:146

    claim_local_owner takes 6 parameters

Resolved (2)
  • function hotspot
    frontend/components/auth/auth-provider.tsx
  • dry violation
    frontend/components/auth/auth-provider.tsx

Who else knows this code

The primary author of each changed file by share of its recent commits, mined from git history. Advisory: it says who has context, not who must review.

  • backend/security/identity.py2233admin 92% of 4 commits
  • frontend/lib/api/endpoints.tslunnt 49% of 19 commits
  • frontend/lib/api/client.tslunnt 76% of 3 commits
  • frontend/app/(app)/studio/new/page.tsx2233admin 100% of 7 commits
  • frontend/components/flow/run-trace-panel.tsx2233admin 61% of 14 commits

Tests that cover this change

Test files that import a file this PR changes. Not a coverage measurement: it is the import graph, so it says which tests are worth running, not which lines they reach.

  • tests/integration/test_auth_api.py
  • tests/integration/test_auth_ws.py
  • tests/integration/test_control_api.py
  • tests/integration/test_image_studio_api.py
  • tests/unit/test_identity_models.py
  • tests/integration/test_chat_api.py
  • tests/unit/api/test_automations.py
  • tests/unit/api/test_consumer_grants.py
  • tests/unit/security/test_fleet_auth.py

6 changed files have no test importing them.

Get this on your own pull requests

This page came from an index of 2233admin/opencli-Razormind. No model calls, no configuration, and it refreshes on every push. Install the bot and every pull request gets one of these.