Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update dependency on @logto/cloud #5628

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
2 changes: 1 addition & 1 deletion packages/connectors/connector-logto-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
"access": "public"
},
"devDependencies": {
"@logto/cloud": "0.2.5-6c090b2"
"@logto/cloud": "0.2.5-1807f9c"
}
}
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@fontsource/roboto-mono": "^5.0.0",
"@jest/types": "^29.5.0",
"@logto/app-insights": "workspace:^1.4.0",
"@logto/cloud": "0.2.5-6c090b2",
"@logto/cloud": "0.2.5-1807f9c",
"@logto/connector-kit": "workspace:^2.1.0",
"@logto/core-kit": "workspace:^2.3.0",
"@logto/language-kit": "workspace:^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@logto/cloud": "0.2.5-6c090b2",
"@logto/cloud": "0.2.5-1807f9c",
"@silverhand/eslint-config": "5.0.0",
"@silverhand/ts-config": "5.0.0",
"@types/debug": "^4.1.7",
Expand Down
8 changes: 3 additions & 5 deletions packages/core/src/oidc/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
type Json,
jwtCustomizer as jwtCustomizerLog,
LogResult,
LogtoJwtTokenPath,
LogtoJwtTokenKeyType,
} from '@logto/schemas';
import { generateStandardId } from '@logto/shared';
import { conditional, trySafe, tryThat } from '@silverhand/essentials';
Expand Down Expand Up @@ -57,7 +57,7 @@
// Temporarily removed 'EdDSA' since it's not supported by browser yet
const supportedSigningAlgs = Object.freeze(['RS256', 'PS256', 'ES256', 'ES384', 'ES512'] as const);

export default function initOidc(

Check warning on line 60 in packages/core/src/oidc/init.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/core/src/oidc/init.ts#L60

[max-params] Function 'initOidc' has too many parameters (5). Maximum allowed is 4.
envSet: EnvSet,
queries: Queries,
libraries: Libraries,
Expand Down Expand Up @@ -269,14 +269,12 @@
body: isTokenClientCredentials
? {
...commonPayload,
// TODO: update once cloud repo is ready.
tokenType: LogtoJwtTokenPath.ClientCredentials,
tokenType: LogtoJwtTokenKeyType.ClientCredentials,
}
: {
...commonPayload,
// TODO: update once cloud repo is ready.
tokenType: LogtoJwtTokenPath.AccessToken,
tokenType: LogtoJwtTokenKeyType.AccessToken,
// TODO (LOG-8555): the newly added `UserProfile` type includes undefined fields and can not be directly assigned to `Json` type. And the `undefined` fields should be removed by zod guard.

Check warning on line 277 in packages/core/src/oidc/init.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/core/src/oidc/init.ts#L277

[no-warning-comments] Unexpected 'todo' comment: 'TODO (LOG-8555): the newly added...'.
// eslint-disable-next-line no-restricted-syntax
context: { user: logtoUserInfo as Record<string, Json> },
},
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/routes/logto-config/jwt-customizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {
adminTenantId,
jwtCustomizerConfigsGuard,
jwtCustomizerTestRequestBodyGuard,
type CustomJwtFetcher,
type LogtoJwtTokenPath,
} from '@logto/schemas';
import { ResponseError } from '@withtyped/client';
import { ZodError, z } from 'zod';
Expand Down Expand Up @@ -191,9 +189,7 @@ export default function logtoConfigJwtCustomizerRoutes<T extends AuthedRouter>(

try {
ctx.body = await client.post(`/api/services/custom-jwt`, {
// TODO: remove type casting once the cloud repo is updated.
// eslint-disable-next-line no-restricted-syntax
body: body as CustomJwtFetcher & { tokenType: LogtoJwtTokenPath },
body,
});
} catch (error: unknown) {
/**
Expand Down
6 changes: 0 additions & 6 deletions packages/schemas/src/types/logto-config/jwt-customizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ export const clientCredentialsJwtCustomizerGuard = jwtCustomizerGuard

export type ClientCredentialsJwtCustomizer = z.infer<typeof clientCredentialsJwtCustomizerGuard>;

// TODO: Temporarily leave this and will remove it after the cloud repo is updated.
export enum LogtoJwtTokenPath {
AccessToken = 'access-token',
ClientCredentials = 'client-credentials',
}

export enum LogtoJwtTokenKeyType {
AccessToken = 'access-token',
ClientCredentials = 'client-credentials',
Expand Down
19 changes: 11 additions & 8 deletions pnpm-lock.yaml

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

Loading