IF Commons GitHub

github

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-githost FR-001

GitHub behind the one interface (commons 0001-githost FR-001 to FR-004): REST API v3 over the runtime's Transport, public and private repositories, issues with their parent and sub-issues, pull requests, protected branches and whether a commit's signature is verified.

The token is given once to githubClient and lives only in the closure that builds the request headers: it is in no result, no failure and no property of the client, and it is sent only to the one host the client serves (github.com by default; a GitHub Enterprise Server host by host and apiBase). A private repository asked for with no token is answered not-found, as GitHub says (it answers 404 where a repository exists and the caller may not see it); with a token that may not read it, unauthorized. GitHub has no groups below an owner, so a path of more than two segments is unsupported (NestedGroups).

Source: commons/githost/src/github.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

githubClientfunction
function githubClient(options: GithubOptions): GitHostClient

A GitHub client over a transport: the common four capabilities and protected branches, issues and pull requests, with no nested groups.

Imported by 11 tests of the run (11 passed, 0 failed): the library's results

GithubOptionstypeno test imports it
type GithubOptions = { /** How requests are sent: the live transport, or a recorded one. */ readonly transport: Tran… (628 characters)
type GithubOptions = {
  /** How requests are sent: the live transport, or a recorded one. */
  readonly transport: Transport;
  /** A token, from the environment by the caller; never stored in a file and never in a result. Absent: only what is public. */
  readonly token?: string | undefined;
  /** The one host this client serves (`github.com` by default); a reference to another host is `not-found`, so the token is never sent elsewhere. */
  readonly host?: string;
  /** The API's base URL (`https://api.github.com` for `github.com`, `https://<host>/api/v3` for another host by default). */
  readonly apiBase?: string;
};

How a GitHub client is made.

Titles, headings, exports, tables, columns and requirements. Esc closes.