Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/v1-promise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
WriteSchemaRequest,
} from "./v1.js";
import { describe, it, expect, beforeEach } from "vitest";
import { PreconnectServices } from "./util.js";

describe("a check with an unknown namespace", () => {
it("should raise a failed precondition", async () => {
Expand Down Expand Up @@ -623,4 +624,30 @@ describe("Experimental Service", () => {

client.close();
});
describe("load balancing configuration", () => {
it("can use round-robin load balancing", async () => {
const { promises: client } = NewClient(
generateTestToken("v1-promise-namespace"),

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "v1-promise-namespace" is used as [authorization header](1).
"localhost:50051",
ClientSecurity.INSECURE_LOCALHOST_ALLOWED,
PreconnectServices.SCHEMA_SERVICE,
{
"grpc.service_config": JSON.stringify({
loadBalancingConfig: [{ round_robin: {} }],
}),
},
);

const schemaResponse = await client.writeSchema({
schema: `definition test/user {}

definition test/document {
relation viewer: test/user
permission view = viewer
}
`,
});
expect(schemaResponse).toBeTruthy();
});
});
});