-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly escape nested module names for globals (#755)
- Loading branch information
1 parent
cde60b6
commit 53ddc0e
Showing
5 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { Client } from "edgedb"; | ||
import e, { type $infer } from "./dbschema/edgeql-js"; | ||
import { setupTests, tc, teardownTests } from "./setupTeardown"; | ||
|
||
describe("auth", () => { | ||
let client: Client; | ||
beforeAll(async () => { | ||
const setup = await setupTests(); | ||
({ client } = setup); | ||
}); | ||
|
||
afterAll(async () => { | ||
await teardownTests(client); | ||
}, 10_000); | ||
|
||
test("check generated globals", () => { | ||
const clientTokenIdentity = e.select( | ||
e.ext.auth.global.ClientTokenIdentity, | ||
(i) => ({ | ||
...i["*"], | ||
}) | ||
); | ||
tc.assert< | ||
tc.IsExact< | ||
$infer<typeof clientTokenIdentity>, | ||
{ | ||
id: string; | ||
created_at: Date; | ||
modified_at: Date; | ||
issuer: string; | ||
subject: string; | ||
}[] | ||
> | ||
>(true); | ||
}); | ||
|
||
const clientToken = e.select(e.ext.auth.global.client_token); | ||
tc.assert<tc.IsExact<$infer<typeof clientToken>, string | null>>(true); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
using extension auth; | ||
|
||
module default { | ||
type WithMultiRange { | ||
required ranges: multirange<std::int32>; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE MIGRATION m1sxd3hbdfjetkgd5okfnkylxf32szrksxs4wctldele4gbaaleoha | ||
ONTO m1rlwpc5ikrkb7cvylhbcntglvnanm524yb6si5xlcjk6gd2lczugq | ||
{ | ||
CREATE EXTENSION pgcrypto VERSION '1.3'; | ||
CREATE EXTENSION auth VERSION '1.0'; | ||
}; |
This file contains 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