Repository navigation
Move janitor's account routes onto HttpApi - #131
Merged
Merged
Conversation
Tests only: Teammates and AccountLinking now expect AccountAlreadyConnected, ConnectedAccountNotFound, AuthorizationExpired and AuthorizationRejected by tag instead of TeammateError reasons, and an unconfigured platform to die. They fail until the account group lands.
The account group (get, startLink, completeLink, unlink) joins JanitorApi and the cluster serves it through HttpApiBuilder behind the API middleware. Teammates and AccountLinking fail with domain errors instead of TeammateError: AuthorizationExpired and AuthorizationRejected in the new GitHub/Authorization module, and ConnectedAccountNotFound and AccountAlreadyConnected in Team/Account. An unknown teammate, an unconfigured platform, GitHub failing to look up the user and database failures die. The web account page calls api.account.* and owns the copy for each tag.
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.
Closes EFF-2517
Moves the account routes onto
JanitorApias the second group.Domain
Api/Account.tshasget,startLink,completeLinkandunlink.completeLinkdeclaresAuthorizationExpired,AuthorizationRejectedandAccountAlreadyConnected;unlinkdeclaresConnectedAccountNotFound.GitHub/Authorization.tsholdsAuthorizationExpired(410) andAuthorizationRejected(422), both without fields. The connections group reusesAuthorizationExpiredlater.Team/Account.tsgainsConnectedAccountNotFound(404,linkId) andAccountAlreadyConnected(409).Cluster
Ingress/Account.tsis now oneHttpApiBuilder.group(JanitorApi, "account", …)layer, merged with the sync group inRoutes.ts. It no longer sits in the raw route list.TeammateErroris gone.Teammatesfails with the domain errors directly:linkboth becomeAccountAlreadyConnected.AuthorizationExpired.ConnectedAccountNotFound.AccountLinkingmapsLinkProofFailedtoAuthorizationRejected.admitcan no longer fail, so theorDieinMembershipMiddlewareis gone.Teammates.disconnecttakes aLinkId, which theunlinkpath param decodes.Web
api.account.*.completeLinkandunlinkmap their tags to page copy withcatchTags/catchTag, andorElseSucceedcovers everything else. The page no longer useslib/api.ts, which other pages still use.Validation
The test changes are in
e78d369, ahead of the implementation. At3b88a20:nix develop -c pnpm exec vp check: 0 errors (322 existing warnings).nix develop -c pnpm exec vp test: 812 of 812 pass.No
test/Ingress/Account.test.tswas added. The handlers only forward to the services, andTeammates.test.tsandAccountLinking.test.tsalready assert the new tags (EFF-2305 decision 8).