Skip to content

Read «Сетевой город» as a second diary provider, starting with the server #139

Closed
7 of 7 issues completed

Description

@lumenpearson

The owner chose «Сетевой город. Образование» (ИРТех NetSchool) as the diary that comes after Петербург's (#135). It is the main diary of twenty regions, and one route set serves all of them (docs/diaries/netschool.md).

Decided by the owner on 24 September 2026:

  • Sessions are kept alive from the cron tick; the password is still never stored. A NetSchool session idles out after 15–60 minutes (the timeOut the login answers with). The server keeps only the sealed session, and GET /api/v1/cron/tick pings every live one with GET /webapi/context, which is what every open client uses to keep a session. When ticks stop for longer than the region's timeout, the family signs in again. That is the same SessionExpired path Петербург has.
  • Server first. The phone keeps working exactly as today, Петербург only, and changes in a second batch: region and school at sign-in, the time zone from the server, and neutral strings.
  • A new milestone, which the owner creates.

What batch 1 does (server):

  • A provider-neutral seam under app/providers/diary/: models, errors, a contract and a registry. Петербург goes behind it unchanged, with every public name re-exported.
  • app/providers/netschool/:
    • a region allow-list (the only origins ever contacted; nothing from a client or a row becomes a URL);
    • the password sign-in every open client performs (windows-1251 salted MD5);
    • the weekly diary mapped onto the existing models, with homework as assignment type 3;
    • keep-alive;
    • school search for binding a class.
  • Revision 0015, additive and applied before the merge:
    • diary_sessions.provider;
    • diary_sessions.kept_alive_at;
    • classes.diary_region, classes.diary_school_id and classes.diary_school_name.
  • The bot: an admin binds a class to «Сетевой город» by picking a region and searching for the school. Families then sign in on the same two-field web form.
  • POST /api/v1/diary/login accepts optional provider, region and school_id, for the phone's batch.
  • The cron tick keeps sessions alive within a batch cap and a time budget, and never touches last_used_at, so the 30-day purge still ends unused sessions.

Deliberately not in it: Госуслуги sign-in, where a region has switched passwords off (it answers with a clear refusal); the refresh-token grant (unverified live); SignalR reports (final marks, attendance letters); anything on the phone.

Nothing here has met a live server with an account. Every upstream shape is taken from open-source clients and tested on hand-written payloads. The first real session will correct what the clients got wrong. #121 says the same of Петербург.

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions