Skip to content
Merged
Show file tree
Hide file tree
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
40 changes: 20 additions & 20 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions e2e/oauth-login-resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ let t: TestDb;

beforeAll(async () => {
t = await createTestDb();
await seedTenant(t.db, "t_a");
await seedPrincipal(t.db, "t_a", "p_a");
await seedProvider(t.db, "t_a", "prov_a");
await seedTenant(t.db, "ta");
await seedPrincipal(t.db, "ta", "p_a");
await seedProvider(t.db, "ta", "prov_a");
});

afterAll(() => t.close());
Expand All @@ -99,18 +99,18 @@ function app(fetchImpl: FetchLike) {
host.use(async (c, next) => {
const at = new Date(0);
c.set("tenant", {
id: "t_a",
name: "t_a",
slug: "t_a",
domain: "t_a.example",
id: "ta",
name: "ta",
slug: "ta",
domain: "ta.example",
parentId: null,
config: null,
createdAt: at,
updatedAt: at,
});
c.set("principal", {
id: "p_a",
tenantId: "t_a",
tenantId: "ta",
kind: "user",
refId: "p_a",
status: "active",
Expand Down
34 changes: 17 additions & 17 deletions e2e/oauth-login-target.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ let t: TestDb;

beforeAll(async () => {
t = await createTestDb();
await seedTenant(t.db, "t_parent");
await seedTenant(t.db, "t_a", "t_parent");
await seedTenant(t.db, "t_other");
await seedPrincipal(t.db, "t_a", "p_a");
await seedPrincipal(t.db, "t_a", "p_b");
await seedProvider(t.db, "t_parent", "prov_inherited");
await seedProvider(t.db, "t_other", "prov_foreign");
await seedTenant(t.db, "tparent");
await seedTenant(t.db, "ta", "tparent");
await seedTenant(t.db, "tother");
await seedPrincipal(t.db, "ta", "p_a");
await seedPrincipal(t.db, "ta", "p_b");
await seedProvider(t.db, "tparent", "prov_inherited");
await seedProvider(t.db, "tother", "prov_foreign");
await seedCredential(t.db, {
id: "cred_b",
tenantId: "t_a",
tenantId: "ta",
providerId: "prov_inherited",
principalId: "p_b",
name: "prod-key",
Expand All @@ -51,7 +51,7 @@ beforeAll(async () => {
});
await seedCredential(t.db, {
id: "cred_key",
tenantId: "t_a",
tenantId: "ta",
providerId: "prov_inherited",
principalId: "p_a",
name: "api-key",
Expand All @@ -67,18 +67,18 @@ function app(principalId: string) {
host.use(async (c, next) => {
const at = new Date(0);
c.set("tenant", {
id: "t_a",
name: "t_a",
slug: "t_a",
domain: "t_a.example",
parentId: "t_parent",
id: "ta",
name: "ta",
slug: "ta",
domain: "ta.example",
parentId: "tparent",
config: null,
createdAt: at,
updatedAt: at,
});
c.set("principal", {
id: principalId,
tenantId: "t_a",
tenantId: "ta",
kind: "user",
refId: principalId,
status: "active",
Expand Down Expand Up @@ -133,7 +133,7 @@ describe("the OAuth login target", () => {
const write = persistOAuthCredential({
db: t.db,
cipher: plainCipher,
tenantId: "t_a",
tenantId: "ta",
principalId: "p_a",
providerId: "prov_inherited",
provider: "acme",
Expand All @@ -155,7 +155,7 @@ describe("the OAuth login target", () => {
persistOAuthCredential({
db: t.db,
cipher: plainCipher,
tenantId: "t_a",
tenantId: "ta",
principalId: "p_a",
providerId: "prov_inherited",
provider: "acme",
Expand Down
8 changes: 4 additions & 4 deletions e2e/refresh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ let t: TestDb;

beforeAll(async () => {
t = await createTestDb();
await seedTenant(t.db, "t_a");
await seedPrincipal(t.db, "t_a", "p_a");
await seedProvider(t.db, "t_a", "prov");
await seedTenant(t.db, "ta");
await seedPrincipal(t.db, "ta", "p_a");
await seedProvider(t.db, "ta", "prov");
});

afterAll(() => t.close());

async function seedDue(id: string): Promise<void> {
await t.db.insert(credential).values({
id,
tenantId: "t_a",
tenantId: "ta",
providerId: "prov",
principalId: "p_a",
name: id,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@corbits/oauth-core",
"version": "0.3.0",
"version": "0.3.1",
"description": "Provider-agnostic OAuth 2.0 authorization-code + PKCE login for desktop/CLI hosts.",
"keywords": [
"corbits",
Expand Down Expand Up @@ -50,10 +50,10 @@
"check": "bun run typecheck && bun run lint && bun run format:check && bun run test"
},
"dependencies": {
"@intx/db": "^0.4.0",
"@intx/hub-api": "^0.4.0",
"@intx/hub-common": "^0.4.0",
"@intx/types": "^0.4.0",
"@intx/db": "^0.5.0",
"@intx/hub-api": "^0.5.0",
"@intx/hub-common": "^0.5.0",
"@intx/types": "^0.5.0",
"arktype": "^2.2.3",
"drizzle-orm": "^0.45.2",
"hono": "^4.11.9"
Expand Down
Loading