Repository navigation
Conversation
Adds `botProvisioning` with a pathless SERVER_ONLY `provisionTelegramUser` operation, an opt-in OIDC link ownership validator, documentation and integration tests. Disabled by default; existing setups are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What fresh chaos is this?
Adds opt-in, server-only user provisioning from Telegram updates already verified by the host's bot.
botProvisioning: trueregisters a pathlessSERVER_ONLYauth.api.provisionTelegramUseroperation that creates or resolves a user and returns{ userId }without a session. It adds no HTTP route, is off by default, and changes nothing for setups that don't enable it. Also exportsvalidateTelegramBotOwnershipfor OIDC link protection. Full guide: Bot provisioning.Nature of the beast
The bare minimum
npm test) -- yes, all of them (373 passed)npm run type-check) -- TypeScript is not optional herenpm run lint) -- Biome has no feelings to hurtautoCreateUser: false, idempotent provisioning, OIDC ownership conflict)CHANGELOG.mdupdated (under[Unreleased])Proof of life
Verified behavior: repeat provisioning returns the same user and creates no session; OIDC sign-in reuses that user; a signed-in user cannot link an OIDC identity owned by a provisioned user; malformed bodies and request-carrying calls are rejected with stable
BOT_PROVISIONING_*codes; the operation is absent whenbotProvisioningis off.Commands run:
npm run lint,npm run lint:fix,npm run type-check,npm test,npm run test:coverage,npm run build(publint + attw),npm run test:types,npm run test:package. All passed.Unproved boundaries: real database adapters, provisioning concurrency across several servers, and live Telegram updates. The host must verify updates and authenticate callers; the plugin does neither by design. No version bump is included: releases are tagged by the maintainer, and the user-facing change is recorded under
[Unreleased].Relevant wreckage
None linked.