Step 1 of the Gitea support epic. Library only: nothing a user of the app or the CLI sees changes yet.
Scope
ForgeKind (GitHub, Gitea).
ForgeAccessException with ForgeAccessKind (unauthorized, forbidden, rate limited, not found, unavailable): what a failed request to a forge means to a caller. GitHubAccessException derives from it and keeps its own Kind, so existing code that catches it keeps working.
GiteaServerUrl: turns what a user typed into the server's base address, or says why not (must be https, no user name or password in it, no query or fragment; a path is allowed for a server under a sub-path).
GiteaRepositoryLister and GiteaOrganizationLister (IRepositoryLister, IOrganizationLister), constructed with the server's address:
HttpClient, source-generated JSON, no new package;
the token goes into the Authorization header of each request to that server, redirects are not followed, certificate validation is the platform's;
paging until an empty page, with a stop when a page brings nothing new;
an organization's repositories; for a user account the token's own repositories or the other account's visible ones;
clone URLs are built from the configured server address and the repository's owner and name;
failures translated like the GitHub ones: the token (fix it), access (grant it, with the scope the server names), not found, rate limited, the server or the network (retry later), and "this does not answer like a Gitea server" for an address that is something else.
A contract test suite that both pairs of listers pass (ordering, duplicates, cancellation, empty results, the failure kinds).
ADR 0010 (forges beside GitHub), threat-model rows for a user-supplied server.
Not in this step
Accounts, the command line, the desktop app (steps 2 and 3 of the epic).
Part of #201.
Step 1 of the Gitea support epic. Library only: nothing a user of the app or the CLI sees changes yet.
## Scope
- `ForgeKind` (GitHub, Gitea).
- `ForgeAccessException` with `ForgeAccessKind` (unauthorized, forbidden, rate limited, not found, unavailable): what a failed request to a forge means to a caller. `GitHubAccessException` derives from it and keeps its own `Kind`, so existing code that catches it keeps working.
- `GiteaServerUrl`: turns what a user typed into the server's base address, or says why not (must be `https`, no user name or password in it, no query or fragment; a path is allowed for a server under a sub-path).
- `GiteaRepositoryLister` and `GiteaOrganizationLister` (`IRepositoryLister`, `IOrganizationLister`), constructed with the server's address:
- `HttpClient`, source-generated JSON, no new package;
- the token goes into the `Authorization` header of each request to that server, redirects are not followed, certificate validation is the platform's;
- paging until an empty page, with a stop when a page brings nothing new;
- an organization's repositories; for a user account the token's own repositories or the other account's visible ones;
- clone URLs are built from the configured server address and the repository's owner and name;
- failures translated like the GitHub ones: the token (fix it), access (grant it, with the scope the server names), not found, rate limited, the server or the network (retry later), and "this does not answer like a Gitea server" for an address that is something else.
- A contract test suite that both pairs of listers pass (ordering, duplicates, cancellation, empty results, the failure kinds).
- ADR 0010 (forges beside GitHub), threat-model rows for a user-supplied server.
## Not in this step
Accounts, the command line, the desktop app (steps 2 and 3 of the epic).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #201.
Step 1 of the Gitea support epic. Library only: nothing a user of the app or the CLI sees changes yet.
Scope
ForgeKind(GitHub, Gitea).ForgeAccessExceptionwithForgeAccessKind(unauthorized, forbidden, rate limited, not found, unavailable): what a failed request to a forge means to a caller.GitHubAccessExceptionderives from it and keeps its ownKind, so existing code that catches it keeps working.GiteaServerUrl: turns what a user typed into the server's base address, or says why not (must behttps, no user name or password in it, no query or fragment; a path is allowed for a server under a sub-path).GiteaRepositoryListerandGiteaOrganizationLister(IRepositoryLister,IOrganizationLister), constructed with the server's address:HttpClient, source-generated JSON, no new package;Authorizationheader of each request to that server, redirects are not followed, certificate validation is the platform's;Not in this step
Accounts, the command line, the desktop app (steps 2 and 3 of the epic).