@flink-app/oauth-plugin 0.13.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @flink-app/oauth-plugin
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Align minor version, from now all packages in monorepo will have same version
8
+
9
+ ### Patch Changes
10
+
11
+ - ee21c29: Normalize query parameters to predictable string types
12
+
13
+ Query parameters are now automatically normalized to `string | string[]` types before reaching handlers:
14
+
15
+ - Single values: converted to strings (e.g., `?page=1` → `{ page: "1" }`)
16
+ - Repeated parameters: converted to string arrays (e.g., `?tag=a&tag=b` → `{ tag: ["a", "b"] }`)
17
+ - All types (numbers, booleans, etc.) from Express parser are converted to strings
18
+
19
+ **Breaking Change (Minor):**
20
+
21
+ - `Query` type changed from `{ [x: string]: string | string[] | undefined }` to `Record<string, string | string[]>`
22
+ - `Params` type changed from `Request["params"]` to explicit `Record<string, string>`
23
+ - Removed `undefined` from query/param types since normalization ensures values are never undefined
24
+ - Updated OAuth and OIDC plugin query type definitions to satisfy new Query constraint
25
+
26
+ This ensures predictable query and path parameter handling regardless of Express parser configuration. Handlers can reliably parse string values as needed using `Number()`, `parseInt()`, boolean comparisons, etc.
27
+
28
+ ## 0.14.1
29
+
30
+ ### Patch Changes
31
+
32
+ - fix: restore compatibility between core framework and plugins after 0.14.0 release
33
+
3
34
  ## 0.13.1
4
35
 
5
36
  ### Patch Changes
@@ -1,15 +1,18 @@
1
1
  /**
2
2
  * Query parameters for OAuth callback request
3
+ *
4
+ * Note: All query parameters are normalized to strings or string arrays by Flink.
5
+ * Providers may send additional query parameters beyond those listed here.
3
6
  */
4
- export default interface CallbackRequest {
7
+ type CallbackRequest = Record<string, string | string[]> & {
5
8
  /**
6
9
  * Authorization code from OAuth provider
7
10
  */
8
- code: string;
11
+ code?: string;
9
12
  /**
10
13
  * CSRF protection state parameter
11
14
  */
12
- state: string;
15
+ state?: string;
13
16
  /**
14
17
  * Optional error from OAuth provider
15
18
  * Common values: access_denied, invalid_request, unauthorized_client, etc.
@@ -26,7 +29,7 @@ export default interface CallbackRequest {
26
29
  /**
27
30
  * Response type - 'json' returns JSON instead of redirect
28
31
  */
29
- response_type?: "json";
32
+ response_type?: "json" | string;
30
33
  /**
31
34
  * Granted scopes (provider-specific)
32
35
  * May be sent by GitHub, Google, and other providers
@@ -49,5 +52,5 @@ export default interface CallbackRequest {
49
52
  * Session state or other provider-specific parameters
50
53
  */
51
54
  session_state?: string;
52
- [key: string]: string | undefined;
53
- }
55
+ };
56
+ export default CallbackRequest;
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Query parameters for OAuth initiate request
3
+ *
4
+ * Note: All query parameters are normalized to strings or string arrays by Flink.
3
5
  */
4
- export default interface InitiateRequest {
6
+ type InitiateRequest = Record<string, string | string[]> & {
5
7
  /**
6
8
  * Optional redirect URI to return to after OAuth flow completes
7
9
  */
8
10
  redirectUri?: string;
9
- [key: string]: string | undefined;
10
- }
11
+ };
12
+ export default InitiateRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/oauth-plugin",
3
- "version": "0.13.1",
3
+ "version": "1.0.0",
4
4
  "description": "Flink plugin for OAuth 2.0 authentication with GitHub and Google providers",
5
5
  "author": "joel@frost.se",
6
6
  "license": "MIT",
@@ -19,9 +19,9 @@
19
19
  "jwt-simple": "^0.5.6",
20
20
  "ts-node": "^10.9.2",
21
21
  "tsc-watch": "^4.2.9",
22
- "@flink-app/flink": "0.13.1",
23
- "@flink-app/test-utils": "0.13.1",
24
- "@flink-app/jwt-auth-plugin": "0.13.1"
22
+ "@flink-app/flink": "1.0.0",
23
+ "@flink-app/jwt-auth-plugin": "1.0.0",
24
+ "@flink-app/test-utils": "1.0.0"
25
25
  },
26
26
  "gitHead": "4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113",
27
27
  "scripts": {
@@ -1,16 +1,19 @@
1
1
  /**
2
2
  * Query parameters for OAuth callback request
3
+ *
4
+ * Note: All query parameters are normalized to strings or string arrays by Flink.
5
+ * Providers may send additional query parameters beyond those listed here.
3
6
  */
4
- export default interface CallbackRequest {
7
+ type CallbackRequest = Record<string, string | string[]> & {
5
8
  /**
6
9
  * Authorization code from OAuth provider
7
10
  */
8
- code: string;
11
+ code?: string;
9
12
 
10
13
  /**
11
14
  * CSRF protection state parameter
12
15
  */
13
- state: string;
16
+ state?: string;
14
17
 
15
18
  /**
16
19
  * Optional error from OAuth provider
@@ -31,7 +34,7 @@ export default interface CallbackRequest {
31
34
  /**
32
35
  * Response type - 'json' returns JSON instead of redirect
33
36
  */
34
- response_type?: "json";
37
+ response_type?: "json" | string;
35
38
 
36
39
  /**
37
40
  * Granted scopes (provider-specific)
@@ -59,6 +62,6 @@ export default interface CallbackRequest {
59
62
  * Session state or other provider-specific parameters
60
63
  */
61
64
  session_state?: string;
65
+ };
62
66
 
63
- [key: string]: string | undefined;
64
- }
67
+ export default CallbackRequest;
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * Query parameters for OAuth initiate request
3
+ *
4
+ * Note: All query parameters are normalized to strings or string arrays by Flink.
3
5
  */
4
- export default interface InitiateRequest {
6
+ type InitiateRequest = Record<string, string | string[]> & {
5
7
  /**
6
8
  * Optional redirect URI to return to after OAuth flow completes
7
9
  */
8
10
  redirectUri?: string;
9
- [key: string]: string | undefined;
10
- }
11
+ };
12
+
13
+ export default InitiateRequest;