-
Notifications
You must be signed in to change notification settings - Fork 21
chore: cleanup #109
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
base: main
Are you sure you want to change the base?
chore: cleanup #109
Changes from all commits
dc79079
557136c
45eab3e
1ef5374
1048ee0
e0eafef
b643245
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d | |
|
||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). | ||
|
||
#### [2.13.0](https://github.com/kinde-oss/kinde-typescript-sdk/compare/4.6.2...2.13.0) | ||
#### [2.13.1](https://github.com/kinde-oss/kinde-typescript-sdk/compare/4.6.2...2.13.1) | ||
|
||
- chore(deps): update dependency @typescript-eslint/eslint-plugin to v8 [`#99`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/99) | ||
- chore(deps): update dependency prettier to v3.6.2 [`#94`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/94) | ||
|
@@ -44,14 +44,43 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). | |
- feat: validate client secrets [`#49`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/49) | ||
- fix: generateRandomString returning double length [`#50`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/50) | ||
- fix: no openid scope crash [`#48`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/48) | ||
- chore: release v2.13.0 [`557836b`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/557836bfa077bed72569babc052f5e73e6356263) | ||
- Merge pull request #80 from kinde-oss/feat/session-persistence [`057e5c0`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/057e5c0857f104f4f4f9c5f0a5f48deea0af0dce) | ||
- feat: set sessionManager persistent property depending on accessToken flag [`7fe1a6c`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/7fe1a6c61053d804ec1e688602880ec29ce730cb) | ||
- Merge pull request #105 from kinde-oss/renovate/pnpm-10.x [`3c02c6b`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/3c02c6ba6fd500cfe16474ba6635b4cbd75b73a1) | ||
- feat: createPortalUrl [`e358d4c`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/e358d4c893b5867dc142c7a3b6c722939e455e9a) | ||
|
||
### [4.6.2](https://github.com/kinde-oss/kinde-typescript-sdk/compare/v2.12.0...4.6.2) | ||
### [4.6.2](https://github.com/kinde-oss/kinde-typescript-sdk/compare/v2.13.0...4.6.2) | ||
|
||
> 24 January 2024 | ||
|
||
#### [v2.13.0](https://github.com/kinde-oss/kinde-typescript-sdk/compare/v2.12.0...v2.13.0) | ||
|
||
> 31 August 2025 | ||
|
||
- chore(deps): update dependency @typescript-eslint/eslint-plugin to v8 [`#99`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/99) | ||
- chore(deps): update dependency prettier to v3.6.2 [`#94`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/94) | ||
- chore(deps): update dependency lint-staged to v16 [`#102`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/102) | ||
- chore(deps): update dependency husky to v9 [`#100`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/100) | ||
- chore(deps): update dependency @tsconfig/node18 to v18 [`#97`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/97) | ||
- chore(deps): update actions/setup-node action to v4 [`#96`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/96) | ||
- chore(deps): update actions/checkout action to v5 [`#95`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/95) | ||
- chore(deps): update dependency @types/node to v22 [`#98`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/98) | ||
- chore(deps): update dependency jose to v6.1.0 [`#93`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/93) | ||
- chore(deps): update dependency eslint-plugin-prettier to v5.5.4 [`#92`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/92) | ||
- chore(deps): update dependency eslint-plugin-n to v17.21.3 [`#91`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/91) | ||
- chore(deps): update dependency eslint-plugin-import to v2.32.0 [`#90`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/90) | ||
- chore(deps): update dependency eslint to v9.34.0 [`#89`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/89) | ||
- chore(deps): update dependency @types/node to v20.19.11 [`#88`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/88) | ||
- fix(deps): update dependency @kinde/js-utils to v0.23.0 [`#86`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/86) | ||
- fix(deps): update dependency @typescript-eslint/parser to v8.41.0 [`#87`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/87) | ||
- chore(deps): update dependency typescript to v5.9.2 [`#85`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/85) | ||
- chore(deps): update dependency @openapitools/openapi-generator-cli to v2.23.1 [`#83`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/83) | ||
- chore(deps): update dependency eslint-config-prettier to v10.1.8 [`#82`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/82) | ||
- [Snyk] Upgrade @kinde/js-utils from 0.19.0 to 0.20.1 [`#78`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/78) | ||
- chore: Configure Renovate [`#81`](https://github.com/kinde-oss/kinde-typescript-sdk/pull/81) | ||
- chore: release v2.13.0 [`557836b`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/557836bfa077bed72569babc052f5e73e6356263) | ||
- Merge pull request #80 from kinde-oss/feat/session-persistence [`057e5c0`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/057e5c0857f104f4f4f9c5f0a5f48deea0af0dce) | ||
- feat: set sessionManager persistent property depending on accessToken flag [`7fe1a6c`](https://github.com/kinde-oss/kinde-typescript-sdk/commit/7fe1a6c61053d804ec1e688602880ec29ce730cb) | ||
|
||
Comment on lines
+51
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainMisordered/duplicated sections: v2.13.0 nested under 4.6.2 The "4.6.2" section precedes and embeds "v2.13.0" dated 31 August 2025, which is chronologically inconsistent and confusing. Proposed cleanup (outline):
If using auto-changelog, regenerate: 🏁 Script executed: #!/bin/bash
npx auto-changelog -p -u --tag-prefix v Length of output: 510 🏁 Script executed: #!/bin/bash
echo "Searching for package.json..."
fd -t f package.json || echo "package.json not found"
echo "Searching for CHANGELOG.md..."
fd -t f CHANGELOG.md || echo "CHANGELOG.md not found" Length of output: 196 🏁 Script executed: sed -n '40,100p' CHANGELOG.md Length of output: 5715 Reorder and dedupe CHANGELOG.md sections
🤖 Prompt for AI Agents
|
||
#### [v2.12.0](https://github.com/kinde-oss/kinde-typescript-sdk/compare/v2.11.1...v2.12.0) | ||
|
||
> 3 July 2025 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,11 @@ | ||
import tseslint from '@typescript-eslint/eslint-plugin'; | ||
import typescript from '@typescript-eslint/parser'; | ||
import n from 'eslint-plugin-n'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import promise from 'eslint-plugin-promise'; | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainCI failing: missing 'globals' dependency; add it or avoid the import Build pipeline error: "Cannot find package 'globals'". Add it to devDependencies (preferred) or drop the dependency and inline minimal globals. Option A (add dependency): --- a/package.json
+++ b/package.json
@@
"devDependencies": {
+ "globals": "^15.0.0"
}
} Option B (avoid dependency; inline minimal globals): -import globals from 'globals';
+const browserGlobals = { window: 'readonly', document: 'readonly', navigator: 'readonly' };
@@
-export default defineConfig([
- { languageOptions: { globals: globals.browser } },
+export default defineConfig([
+ { languageOptions: { globals: browserGlobals } }, Additionally, to fix Node globals for scripts (and remove no-undef comments), scope Node globals: + { files: ['sdk-version.js', 'scripts/**'], languageOptions: { globals: { process: 'readonly', __dirname: 'readonly', module: 'readonly', require: 'readonly' } } }, After applying, re-run ESLint locally/CI. Also applies to: 7-11 🏁 Script executed: #!/bin/bash
node -v
npm ls globals || echo "globals not installed"
npx eslint . -v Length of output: 232 Add missing ‘globals’ package (or inline minimal globals) to fix ESLint CI --- a/package.json
+++ b/package.json
@@ -...devDependencies
"devDependencies": {
+ "globals": "^15.0.0"
} Option B: inline minimal browser globals in eslint.config.mjs -import globals from 'globals';
+const browserGlobals = { window: 'readonly', document: 'readonly', navigator: 'readonly' };
@@
-export default defineConfig([
- { languageOptions: { globals: globals.browser } },
+export default defineConfig([
+ { languageOptions: { globals: browserGlobals } }, Also scope Node globals for scripts: + { files: ['sdk-version.js', 'scripts/**'], languageOptions: { globals: { process: 'readonly', __dirname: 'readonly', module: 'readonly', require: 'readonly' } } }, Re-run ESLint locally/CI to confirm.
🧰 Tools🪛 GitHub Actions: Build and test TypeScript SDK CI[error] 1-1: ESLint failed: Cannot find package 'globals' imported from eslint.config.mjs. Did you mean to import [email protected]/node_modules/globals/index.js? 🤖 Prompt for AI Agents
|
||
import { defineConfig, globalIgnores } from 'eslint/config'; | ||
|
||
export default defineConfig([ | ||
// Global ignores | ||
globalIgnores(['**/dist', '**/dist-cjs']), | ||
|
||
// Base configuration for all files | ||
{ | ||
linterOptions: { | ||
reportUnusedDisableDirectives: true, | ||
}, | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
quotes: ['error', 'single'], | ||
}, | ||
}, | ||
|
||
// TypeScript files | ||
{ | ||
files: ['**/*.ts'], | ||
plugins: { | ||
'@typescript-eslint': tseslint, | ||
}, | ||
languageOptions: { | ||
parser: typescript, | ||
parserOptions: { | ||
project: ['./tsconfig.json', './tsconfig.config.json'], | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/strict-boolean-expressions': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/no-dynamic-delete': 'off', | ||
}, | ||
}, | ||
|
||
// JavaScript files | ||
{ | ||
files: ['**/*.js', '**/*.mjs', '**/*.cjs'], | ||
ignores: ['**/*.ts', '**/*.tsx'], | ||
}, | ||
|
||
// Other plugins | ||
{ | ||
plugins: { | ||
n, | ||
promise, | ||
}, | ||
rules: { | ||
'n/no-missing-import': 'off', | ||
}, | ||
}, | ||
|
||
// Prettier at the end to override formatting rules | ||
eslintPluginPrettierRecommended, | ||
{ languageOptions: { globals: globals.browser } }, | ||
globalIgnores(['dist', 'node_modules', 'coverage/**', 'dist-cjs']), | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
]); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ export interface BrowserPKCEClientOptions extends AuthorizationCodeOptions { | |
export { PortalPage } from '@kinde/js-utils'; | ||
export type { GeneratePortalUrlParams } from '@kinde/js-utils'; | ||
|
||
export interface PKCEClientOptions extends AuthorizationCodeOptions {} | ||
export interface CCClientOptions extends ClientCredentialsOptions {} | ||
export type PKCEClientOptions = AuthorizationCodeOptions; | ||
export type CCClientOptions = ClientCredentialsOptions; | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainChanging interface to type alias may break declaration merging External consumers can augment interfaces via declaration merging; type aliases cannot be merged. This can be a subtle semver break. If any consumer augments PKCEClientOptions/CCClientOptions, keep them as interfaces. Otherwise, add a note to the changelog under "Potentially breaking (types only)". To verify in-repo usage: If you want the newer style without risk, keep interfaces but export companion aliases: export interface PKCEClientOptions extends AuthorizationCodeOptions {}
export type PKCEClientOptionsT = AuthorizationCodeOptions;
export interface CCClientOptions extends ClientCredentialsOptions {}
export type CCClientOptionsT = ClientCredentialsOptions; 🏁 Script executed: #!/bin/bash
rg -nP '\b(interface|type)\s+PKCEClientOptions\b|extends\s+PKCEClientOptions\b|declare\s+module[^\n]*\{[^\}]*interface\s+PKCEClientOptions' -C2
rg -nP '\b(interface|type)\s+CCClientOptions\b|extends\s+CCClientOptions\b|declare\s+module[^\n]*\{[^\}]*interface\s+CCClientOptions' -C2 Length of output: 1612 Add changelog entry for potential type-breaking change 🤖 Prompt for AI Agents
|
||
export interface ACClientOptions extends AuthorizationCodeOptions { | ||
clientSecret?: string; | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -40,10 +40,10 @@ export const commitTokenToSession = async ( | |||||||||||||||||||||||
if (isExpired) { | ||||||||||||||||||||||||
throw new Error('Token is expired'); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} catch (e) { | ||||||||||||||||||||||||
} catch (error) { | ||||||||||||||||||||||||
throw new KindeSDKError( | ||||||||||||||||||||||||
KindeSDKErrorCode.INVALID_TOKEN_MEMORY_COMMIT, | ||||||||||||||||||||||||
`Attempting to commit invalid ${type} token "${token}" to memory` | ||||||||||||||||||||||||
`Attempting to commit invalid ${type} token "${token}" to memory: ${(error as Error).message}` | ||||||||||||||||||||||||
); | ||||||||||||||||||||||||
Comment on lines
+43
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainSecret leakage: error message includes the raw token Embedding the full access/id token in the thrown error is a high-severity issue. These errors are now logged by callers, which would leak tokens to logs. Apply this to remove the token from the message (or replace with a minimal fingerprint if you need correlation): - `Attempting to commit invalid ${type} token "${token}" to memory: ${(error as Error).message}`
+ `Attempting to commit invalid ${type} token to memory: ${(error as Error).message}` Please scan for any other error/log strings that include secrets (tokens, client secrets). 🏁 Script executed: #!/bin/bash
set -e
# Search for any string interpolation including “token” (potential secret leakage)
rg -n --color=never '\$\{[^}]*token' -C2 .
# Search for console.log/error/warn usages including “token”
rg -n --color=never 'console\.(log|error|warn).*token' -C2 .
# Search for thrown errors that reference “token”
rg -n --color=never 'throw new .*token' -C2 .
# Search for any literal “secret” in error/log messages
rg -n --color=never 'secret' -C2 . Length of output: 12689 Sanitize secret values in error messages
Scan the codebase for any other error/log strings that interpolate tokens or client secrets and mask or omit them. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
@@ -183,7 +183,8 @@ export const isTokenExpired = async ( | |||||||||||||||||||||||
const payload = jwtDecoder(token); | ||||||||||||||||||||||||
if (!payload || payload.exp === undefined) return true; | ||||||||||||||||||||||||
return currentUnixTime >= payload.exp; | ||||||||||||||||||||||||
} catch (e) { | ||||||||||||||||||||||||
} catch (error) { | ||||||||||||||||||||||||
console.error(`Error checking if token is expired: ${(error as Error).message}`); | ||||||||||||||||||||||||
return true; | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect compare link in 2.13.1 header
"compare/4.6.2...2.13.1" appears wrong; likely should compare v2.13.0...v2.13.1.
📝 Committable suggestion
🤖 Prompt for AI Agents