Skip to content

Commit 724e1ac

Browse files
authored
Fix issues with authentication for apps with no auth type (#17631)
* Ignore the prop configuration and validation for apps with no authentication type (i.e. they do not require authentication, nor have a way to do so). * Replace usage of deprecated `components` method from the SDK with `getComponents` * Fix linter errors in `CHANGELOG.md`
1 parent af19436 commit 724e1ac

File tree

5 files changed

+79
-71
lines changed

5 files changed

+79
-71
lines changed

packages/connect-react/CHANGELOG.md

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@
22

33
# Changelog
44

5-
# [1.3.1] - 2025-06-30
5+
## [1.3.2] - 2025-07-15
66

7-
## Changed
7+
### Changed
8+
9+
- Do not perform prop validation for `app` props with nil auth type. This will
10+
allow components to be deployed/executed without users having to authenticate
11+
to the app (which would fail given that the app doesn't have a way to
12+
authenticate anyways).
13+
- Use the `getComponents` method from the SDK instead of the deprecated
14+
`components` method.
15+
16+
## [1.3.1] - 2025-06-30
17+
18+
### Changed
819

920
- Fixed handling of the 'dir' prop type to exclude it from configurable props
1021

11-
# [1.3.0] - 2025-06-10
22+
## [1.3.0] - 2025-06-10
1223

13-
## Added
24+
### Added
1425

1526
- Support for `externalUserId` param across all components as the preferred way to identify users
1627
- Backward compatibility with existing `userId` parameter
1728

18-
## Changed
29+
### Changed
1930

2031
- All internal SDK calls now use `externalUserId` parameter for consistency with backend SDK
2132

22-
## Deprecated
33+
### Deprecated
2334

2435
- `userId` parameter in favor of `externalUserId` (existing code continues to work with console warnings)
2536

26-
## Migration
37+
### Migration
2738

2839
Replace `userId` with `externalUserId` in component props:
2940

@@ -35,137 +46,137 @@ Replace `userId` with `externalUserId` in component props:
3546
<ComponentFormContainer externalUserId={userId} />
3647
```
3748

38-
# [1.2.1] - 2025-06-07
49+
## [1.2.1] - 2025-06-07
3950

4051
- Fixing the SelectApp component to properly handle controlled values when not found in search results
4152
- Fixing infinite re-render issue in ComponentFormContainer by memoizing configurableProps
4253

43-
# [1.2.0] - 2025-06-05
54+
## [1.2.0] - 2025-06-05
4455

4556
- Adding basic support for 'sql' prop types
4657

47-
# [1.1.0] - 2025-06-04
58+
## [1.1.0] - 2025-06-04
4859

4960
- Adding support for 'object' prop types
5061
- Modifying string and string[] inputs to hide the dropdown in the case of no options
5162
- Added basic styling to hyperlinks in prop descriptions
5263

53-
# [1.0.2] - 2025-04-24
64+
## [1.0.2] - 2025-04-24
5465

5566
- Updating README to remove note about this package being in early preview
5667

57-
# [1.0.1] - 2025-04-16
68+
## [1.0.1] - 2025-04-16
5869

5970
- remove bad polyfill (would break checking `document`)
6071
- handle bad `decode-named-character-reference` browser import via vite resolve.alias
6172
- stop accidentally bundling `lodash` (-80KB for es build)
6273

63-
# [1.0.0-preview.30] - 2025-02-19
74+
## [1.0.0-preview.30] - 2025-02-19
6475

6576
- SelectApp and SelectComponent Improvements
6677

67-
# [1.0.0-preview.29] - 2025-02-10
78+
## [1.0.0-preview.29] - 2025-02-10
6879

6980
- Fix enableDebugging state update bug
7081

71-
# [1.0.0-preview.28] - 2025-02-05
82+
## [1.0.0-preview.28] - 2025-02-05
7283

7384
- Surface SDK errors in the form
7485

75-
# [1.0.0-preview.27] - 2025-01-30
86+
## [1.0.0-preview.27] - 2025-01-30
7687

7788
- Add styling to alerts
7889

79-
# [1.0.0-preview.26] - 2025-01-29
90+
## [1.0.0-preview.26] - 2025-01-29
8091

8192
- No change
8293

83-
# [1.0.0-preview.25] - 2025-01-28
94+
## [1.0.0-preview.25] - 2025-01-28
8495

8596
- Show prop labels instead of values after selecting dynamic props
8697
- Fix the bug where a remote option would not be reloaded when the form component is re-rendered
8798

88-
# [1.0.0-preview.24] - 2025-01-24
99+
## [1.0.0-preview.24] - 2025-01-24
89100

90101
- Fix the bug where inputting multiple strings into an array prop would merge the strings into one
91102
- Fix custom string input for remote options
92103
- Fix the reloading of a previously selected remote option when re-rendering the form component
93104

94-
# [1.0.0-preview.23] - 2025-01-22
105+
## [1.0.0-preview.23] - 2025-01-22
95106

96107
- Show the prop label instead of the value after selecting from a dropdown for string array props
97108

98-
# [1.0.0-preview.22] - 2025-01-21
109+
## [1.0.0-preview.22] - 2025-01-21
99110

100111
- Allow custom string input for remote options
101112

102-
# [1.0.0-preview.21] - 2025-01-17
113+
## [1.0.0-preview.21] - 2025-01-17
103114

104115
- Fix a bug in async prop value validation when the prop is a string
105116

106-
# [1.0.0-preview.20] - 2025-01-16
117+
## [1.0.0-preview.20] - 2025-01-16
107118

108119
- Check if a string prop is set instead of inspecting the contents of the string
109120

110-
# [1.0.0-preview.15] - 2024-12-18
121+
## [1.0.0-preview.15] - 2024-12-18
111122

112123
- Emit dynamic props via `onUpdateDynamicProps`
113124

114-
# [1.0.0-preview.14] - 2024-12-17
125+
## [1.0.0-preview.14] - 2024-12-17
115126

116127
- Fixed one case of "maximum update depth exceeded" (useEffect component dependency)
117128

118-
# [1.0.0-preview.13] - 2024-12-17
129+
## [1.0.0-preview.13] - 2024-12-17
119130

120131
- Added skippable prop types to support triggers
121132

122-
# [1.0.0-preview.12] - 2024-12-13
133+
## [1.0.0-preview.12] - 2024-12-13
123134

124135
- Don't throw when validating unexpected values from the api
125136

126-
# [1.0.0-preview.11] - 2024-12-13
137+
## [1.0.0-preview.11] - 2024-12-13
127138

128139
- Make prop validation more consistent with app behavior
129140
- Relax validation of string props when value is not a string
130141

131-
# [1.0.0-preview.10] - 2024-12-12
142+
## [1.0.0-preview.10] - 2024-12-12
132143

133144
- Enforce string length limits
134145

135-
# [1.0.0-preview.9] - 2024-12-10
146+
## [1.0.0-preview.9] - 2024-12-10
136147

137148
- Disabled submit button when form is incomplete
138149

139-
# [1.0.0-preview.8] - 2024-12-09
150+
## [1.0.0-preview.8] - 2024-12-09
140151

141152
- Fix dynamic props in the Connect demo app
142153

143-
# [1.0.0-preview.7] - 2024-12-05
154+
## [1.0.0-preview.7] - 2024-12-05
144155

145156
- Use proper casing for `stringOptions` now that configure prop is properly async
146157

147-
# [1.0.0-preview.6] - 2024-12-05
158+
## [1.0.0-preview.6] - 2024-12-05
148159

149160
- Handle configurable prop `withLabel` (eg. fixes config of Airtable `tableId`)
150161

151-
# [1.0.0-preview.5] - 2024-12-02
162+
## [1.0.0-preview.5] - 2024-12-02
152163

153164
- Change colors of "Connect App" button
154165

155-
# [1.0.0-preview.4] - 2024-11-27
166+
## [1.0.0-preview.4] - 2024-11-27
156167

157168
- Fix accidental use of useSuspenseQuery
158169
- Fix setState during render due to userId useEffect
159170

160-
# [1.0.0-preview.3] - 2024-11-27
171+
## [1.0.0-preview.3] - 2024-11-27
161172

162173
- Previous version broken, lack of build before publish (not sure how preview.1 shipped)
163174

164-
# [1.0.0-preview.2] - 2024-11-27
175+
## [1.0.0-preview.2] - 2024-11-27
165176

166177
- Externalize @emotion/react
167178
- Minor type improvements
168179

169-
# [1.0.0-preview.1] - 2024-11-22
180+
## [1.0.0-preview.1] - 2024-11-22
170181

171182
Initial release

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/hooks/use-components.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { useQuery } from "@tanstack/react-query";
2-
import type { GetComponentOpts } from "@pipedream/sdk";
2+
import type { GetComponentsOpts } from "@pipedream/sdk";
33
import { useFrontendClient } from "./frontend-client-context";
44

55
/**
66
* Get list of components
77
*/
8-
export const useComponents = (input?: GetComponentOpts) => {
8+
export const useComponents = (input?: GetComponentsOpts) => {
99
const client = useFrontendClient();
1010
const query = useQuery({
1111
queryKey: [
1212
"components",
1313
input,
1414
],
15-
queryFn: () => client.components(input),
15+
queryFn: () => client.getComponents(input),
1616
});
1717

1818
return {

packages/connect-react/src/utils/component.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ export function appPropErrors(opts: ValidationOpts<ConfigurablePropApp>): string
152152
"app field not registered",
153153
]
154154
}
155+
if (!app.auth_type) {
156+
// These apps don't require authentication since they can't be configured
157+
// (i.e. auth_type == "none")
158+
return
159+
}
155160
if (!value) {
156161
return [
157162
"no app configured",
@@ -164,23 +169,20 @@ export function appPropErrors(opts: ValidationOpts<ConfigurablePropApp>): string
164169
}
165170
const _value = value as PropValue<"app">
166171
if ("authProvisionId" in _value && !_value.authProvisionId) {
167-
if (app.auth_type) {
168-
const errs = []
169-
if (app.auth_type === "oauth" && !(_value as OauthAppPropValue).oauth_access_token) {
170-
errs.push("missing oauth token")
171-
}
172-
if (app.auth_type === "oauth" || app.auth_type === "keys") {
173-
const customFields = getCustomFields(app)
174-
const _valueWithCustomFields = _value as AppPropValueWithCustomFields<typeof customFields>
175-
for (const cf of customFields) {
176-
if (!cf.optional && !_valueWithCustomFields[cf.name]) {
177-
errs.push(`missing custom field: ${cf.name}`)
178-
}
172+
const errs = []
173+
if (app.auth_type === "oauth" && !(_value as OauthAppPropValue).oauth_access_token) {
174+
errs.push("missing oauth token")
175+
}
176+
if (app.auth_type === "oauth" || app.auth_type === "keys") {
177+
const customFields = getCustomFields(app)
178+
const _valueWithCustomFields = _value as AppPropValueWithCustomFields<typeof customFields>
179+
for (const cf of customFields) {
180+
if (!cf.optional && !_valueWithCustomFields[cf.name]) {
181+
errs.push(`missing custom field: ${cf.name}`)
179182
}
180183
}
181-
if (app.auth_type !== "none")
182-
errs.push("no auth provision configured")
183-
return errs
184184
}
185+
186+
return errs
185187
}
186188
}

pnpm-lock.yaml

Lines changed: 9 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)