Skip to content

Decision: which diary comes second, how a family signs in to it, and whether ТОР may be used at all #135

Open
3 of 3 issues completed

Description

@lumenpearson

Three decisions rather than an action. They come out of the survey in docs/diaries.md (#130, PR #134), and they have to be made before a second diary provider is written. Each is recorded in HANDOVER.md section 7.

1. Which platform comes second. The survey's own order is:

  • «Сетевой город», because one route set covers the largest group of regions and it still takes a password outside the regions that allow Госуслуги only;
  • then the МЭШ family: Москва, the regional «Моя школа» nodes and ЭПОС.Школа.

A platform that serves one region, such as КИАСУО or the Кузбасс system, is a small provider with a small audience. The platform table in docs/diaries.md has the counts.

2. How a family signs in. /diary/signin is built around Петербург's email and password, and that is now the exception. In most regions Госуслуги is the only door, and there are two ways through it:

  • Accept a token a person brought from a browser: a cookie, a JWT or a refresh token. This is what almost every client that has lasted does. It needs a page that explains how to get the token, and a stored credential that is sealed like the Петербург one.
  • Drive ЕСИА from the server. A few clients do: netschoolpy, OctoDiary-py and pskovedu-sdk. They replay Госуслуги's private login API, with its SMS and TOTP second factors, its captcha and its «контрольный вопрос». That API changes without notice.

The first way is the durable one, and it changes what /diary/signin is. CLAUDE.md forbids growing that page into a second admin surface. A token-paste form is a sign-in rather than administration, but it is the page's second job, and that should be decided rather than drifted into.

3. Whether ТОР «Моя школа» may be used at all. Twenty regions moved to it on 1 September 2026. They share one API, read from the official app «Госуслуги Моя школа» 5.0.0.454. Its sign-in is Госуслуги's own, and its client_secret is signed on Госуслуги's side. The only way in anybody outside has found is a person signing in inside a WebView and the session cookies being kept. Госуслуги's terms were not reviewed. Until somebody reads them, the manual half of this product is the only half for those regions, as #127 already says of every region that is not Петербург.

What has to happen first, whichever platform is chosen: one real session against it. Not one route in docs/diaries/ has been seen answering, because no diary host answers a cloud session. #121 is the same step for Петербург and is still open.

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. lumenpearson commented on Sep 24, 2026

    @lumenpearson
    OwnerAuthor

    Decided on 24 September 2026, for points 1 and 2.

    1. The second platform is «Сетевой город».

    2. How a family signs in: with a password on the existing web form, for «Сетевой город» as for Петербург. The password is used once and never stored. The region and the school come from the class, which an admin binds in the bot.

      A NetSchool session idles out in 15–60 minutes, so the server keeps it alive from the cron tick (GET /webapi/context, as every open client does). When the ticks stop for longer than that, the family signs in again. This leans on the external cron (Point the external cron at the tick, and check DADATA_TOKEN really works #120); GitHub's fallback clock is too sparse to keep a session alive.

    Work is tracked in the new feature issue, server first.

    Point 3 (whether ТОР «Моя школа» may be used at all) is still open.


    Generated by Claude Code

  2. lumenpearson commented on Sep 25, 2026

    @lumenpearson
    OwnerAuthor

    Decided by the owner on 25 September 2026, while the phone-side batch (region → school → diary sign-in in onboarding) was being planned:

    • Question 3 — ТОР «Моя школа» is used. It is built now as a third provider, beside Петербург and «Сетевой город», so the regions that moved to it are not left with the class code alone. Nobody in a session has read Госуслуги's terms, and nothing here claims they were; the owner has made the call to use it anyway.
    • Question 2 — the family signs in themselves, and our server is never the intermediary for a password. For ТОР that is the WebView route from the issue body: the student signs in on the Госуслуги page inside the app, and the resulting ТОР session — not the Госуслуги password — is what the app keeps and hands to the server, sealed like the other diary credentials, so the cron tick can keep it alive and the bot can read it. The same rule now applies to the two existing providers on the phone: the app signs in to the provider directly and registers the resulting session, rather than posting the password to /api/v1/diary/login. Driving ЕСИА from the server stays rejected.

    Still open, as before: one real session against each platform (#121 for Петербург). Whether a session established on the phone is accepted when replayed from the server's address is part of that, and is unverified for all three.


    Generated by Claude Code

  3. lumenpearson commented on Sep 25, 2026

    @lumenpearson
    OwnerAuthor

    Correction to the comment above: the Госуслуги route for ТОР «Моя школа» is not being built.

    What a Госуслуги sign-in leaves behind is a session to the person's whole Госуслуги account, not a diary token. Holding that outside the official app — and in particular sealing it on our server and keeping it alive from the cron tick — is the data-theft risk the owner's own privacy rule is meant to rule out, and it would be held for minors' accounts. An app that shows Госуслуги's sign-in inside itself and keeps the session is also indistinguishable from a phishing app, and every fork builds its own APK from this code. So question 3 stays open, and question 2's Госуслуги half is answered "no".

    What the phone-side batch does instead:

    • ТОР regions: the provider screen names ТОР «Моя школа» as the region's system, recommends it where it is the primary, explains why, and offers a button that opens gosuslugi.ru/school in the browser (and from there the official app). The class code stays the way to get the timetable and the bot.
    • Петербург and «Сетевой город» (password regions only): the student signs in inside the app with a login and password that go straight to the provider, never to our server; the resulting session is then registered with our server, sealed as before. No WebView anywhere.
    • The three Госуслуги-only «Сетевой город» regions (Алтайский край, Приморье, Тула) stay unsupported for the same reason.

    The legitimate way to read ТОР data is ЕСИА's own OAuth for a registered information system, which needs a legal entity as the operator. That is the owner's call and stays out of scope here.


    Generated by Claude Code

  4. moved this from Now to Ready in lessonson Oct 3, 2026
  5. self-assigned this
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Ready

Relationships

None yet

Development

No branches or pull requests

Issue actions