Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): pull requests load for credentials that cannot read /user #18780

MergedLannyBose(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/18780/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 177 additions and 18 deletions (loading 1).

x
0 of 4 viewed, 4 left
135 additions and 0 deletionspackages/source-control-github/src/server/GitHubPullRequestApi.test.tsModified
View file
@@ -75,6 +75,7 @@
type ApiCall =
| {
readonly kind: "graphql";
+ readonly authorization: string | undefined;
readonly partial?: boolean;
/** The generated operation's name, which the routes below match on. */
readonly operationName?: string;
@@ -124,6 +125,7 @@
: { query: "", operationName: "", variables: {} };
const call: ApiCall = {
kind: "graphql",
+ authorization: request.headers["authorization"],
host,
operation: "batch",
operationName: sent.operationName,
@@ -3726,6 +3728,139 @@
+ it.effect("verifies a REST-forbidden account through GraphQL with the pinned credential", () =>
+ Effect.gen(function* () {
+ const input = { cwd: "/w", host: "github.identity-fallback.test" };
+ const original = {
+ token: Redacted.make("original-token"),
+ fingerprint: `${input.host}:original`,
+ };
+ mockedCredential.mockReturnValue(Effect.succeed(original));