Skip to content

Commit 10f3764

Browse files
committed
fix(credentials): name refused hosts in token responses and drop the S3 saved-credential setup flag
1 parent f2efc31 commit 10f3764

23 files changed

Lines changed: 32 additions & 126 deletions

File tree

‎apps/docs/content/docs/cli/knowledge.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ sim knowledge connectors create <knowledgeBaseId> [options]
10401040
| Option | Required | Description |
10411041
| --- | --- | --- |
10421042
| `--connector-type <value>` | Yes | Registered connector type. |
1043-
| `--credential-id <value>` | No | OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or, when this deployment enables it, a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors. |
1043+
| `--credential-id <value>` | No | OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors. |
10441044
| `--api-key <value>` | No | Write-only API key for connector types whose `auth.mode` is `apiKey` (see connector types), or a personal access token for an OAuth connector that also accepts one, such as GitHub. Send it instead of `credentialId`. Pass a raw key, or a secret reference written as the whole value `{{SECRET_NAME}}`, which the server resolves; `$SECRET_NAME` is not a reference. |
10451045
| `--source-config <json\|@file>` | Yes | Connector-specific source selection and filtering configuration. (JSON, or @path / @- to read a file or stdin). |
10461046
| `--sync-interval-minutes <value>` | No | Scheduled synchronization interval in minutes; zero disables scheduling. Defaults to 1440. |

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2649,7 +2649,7 @@ sim knowledge connectors create <knowledgeBaseId> [options]
26492649
| Option | Required | Description |
26502650
| --- | --- | --- |
26512651
| `--connector-type <value>` | Yes | Registered connector type. |
2652-
| `--credential-id <value>` | No | OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or, when this deployment enables it, a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors. |
2652+
| `--credential-id <value>` | No | OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors. |
26532653
| `--api-key <value>` | No | Write-only API key for connector types whose `auth.mode` is `apiKey` (see connector types), or a personal access token for an OAuth connector that also accepts one, such as GitHub. Send it instead of `credentialId`. Pass a raw key, or a secret reference written as the whole value `{{SECRET_NAME}}`, which the server resolves; `$SECRET_NAME` is not a reference. |
26542654
| `--source-config <json\|@file>` | Yes | Connector-specific source selection and filtering configuration. (JSON, or @path / @- to read a file or stdin). |
26552655
| `--sync-interval-minutes <value>` | No | Scheduled synchronization interval in minutes; zero disables scheduling. Defaults to 1440. |

‎apps/docs/content/docs/knowledgebase/connectors.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ API-key and personal-access-token connections use the credential shown in their
4646
| Azure DevOps | PAT with Project and Team Read, Wiki Read, Work Items Read, and Code Read. |
4747
| GitLab | PAT with `read_api` and access to the selected project; permission-aware methods have additional requirements. |
4848
| YouTube | YouTube Data API key from Google Cloud Console. |
49-
| Amazon S3 | Secret Access Key; enter Access Key ID, region, and bucket as configuration fields. Where enabled, **Authentication → Saved AWS credential** uses a workspace AWS credential instead (access keys, an assumed IAM role, or a keyless role trusted through Sim OIDC); it signs only for Amazon S3 in a commercial or GovCloud AWS region (not China or isolated regions), so it has no Access Key ID or custom endpoint. Either way, the identity needs `s3:ListBucket` on the bucket and `s3:GetObject` on the synced objects. |
49+
| Amazon S3 | Secret Access Key; enter Access Key ID, region, and bucket as configuration fields. **Authentication → Saved AWS credential** uses a workspace AWS credential instead (access keys, an assumed IAM role, or a keyless role trusted through Sim OIDC); it signs only for Amazon S3 in a commercial or GovCloud AWS region (not China or isolated regions), so it has no Access Key ID or custom endpoint. Either way, the identity needs `s3:ListBucket` on the bucket and `s3:GetObject` on the synced objects. |
5050
| Sentry | Auth token with `project:read` and `event:read`. |
5151
| PagerDuty | Create a [REST API key](https://support.pagerduty.com/main/docs/api-access-keys) under **Integrations → Developer Tools → API Access Keys**. |
5252
| SFTP | Password or unencrypted private key, plus a required SHA-256 host-key fingerprint; enter host, port, username, and root path as configuration fields. |

‎apps/docs/openapi-v2-knowledge.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7155,7 +7155,7 @@
71557155
"description": "Registered connector type."
71567156
},
71577157
"credentialId": {
7158-
"description": "OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or, when this deployment enables it, a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors.",
7158+
"description": "OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors.",
71597159
"type": "string",
71607160
"minLength": 1,
71617161
"maxLength": 255

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ import {
106106
kbDocumentSortParams,
107107
} from '@/app/workspace/[workspaceId]/knowledge/[id]/search-params'
108108
import { canDeleteKnowledgeBase } from '@/app/workspace/[workspaceId]/knowledge/permissions'
109-
import { useFeatureFlag } from '@/app/workspace/[workspaceId]/providers/feature-flags-provider'
110109
import { useRegisterGlobalCommands } from '@/app/workspace/[workspaceId]/providers/global-commands-provider'
111110
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
112111
import { BrandIcon } from '@/blocks/brand-icon'
@@ -421,7 +420,6 @@ export function KnowledgeBase({
421420
const [showDocumentTagsModal, setShowDocumentTagsModal] = useState(false)
422421
const [documentForTagsId, setDocumentForTagsId] = useState<string | null>(null)
423422
const showAddConnectorModal = addConnectorType != null
424-
const savedCredentialSetupEnabled = useFeatureFlag('knowledge-connector-saved-credentials')
425423
const updateAddConnectorParam = useCallback(
426424
(value: string | null) => {
427425
void setAddConnectorType(value, { history: 'replace', scroll: false })
@@ -1474,7 +1472,6 @@ export function KnowledgeBase({
14741472
knowledgeBaseId={id}
14751473
initialConnectorType={addConnectorType || undefined}
14761474
isSearchIndex={knowledgeBase?.isSearchIndex}
1477-
savedCredentialSetupEnabled={savedCredentialSetupEnabled}
14781475
/>
14791476
)}
14801477

@@ -1516,7 +1513,6 @@ export function KnowledgeBase({
15161513
isLoading={isLoadingConnectors}
15171514
canEdit={userPermissions.canEdit}
15181515
className='mt-0'
1519-
savedCredentialSetupEnabled={savedCredentialSetupEnabled}
15201516
/>
15211517
</ChipModalBody>
15221518
</ChipModal>

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ interface AddConnectorModalProps {
113113
initialSyncIntervalMinutes?: number
114114
onCreated?: (connectorType: string, connector: ConnectorData) => void
115115
setupDraftKey?: string
116-
/** Offers a key connector's saved-credential alternative, such as a saved AWS credential for S3. */
117-
savedCredentialSetupEnabled?: boolean
118116
}
119117

120118
type Step = 'select-type' | 'configure'
@@ -131,7 +129,6 @@ export function AddConnectorModal({
131129
lockedAccessMode,
132130
initialSyncIntervalMinutes = 1440,
133131
onCreated,
134-
savedCredentialSetupEnabled = false,
135132
setupDraftKey,
136133
scope: explicitScope,
137134
}: AddConnectorModalProps) {
@@ -221,9 +218,7 @@ export function AddConnectorModal({
221218
const isMembersMode = access.accessMode === 'members'
222219
const apiKeyConfig = connectorConfig ? getConnectorApiKeyConfig(connectorConfig.auth) : undefined
223220
const savedCredentialConfig =
224-
savedCredentialSetupEnabled && connectorConfig?.auth.mode === 'apiKey'
225-
? connectorConfig.auth.savedCredential
226-
: undefined
221+
connectorConfig?.auth.mode === 'apiKey' ? connectorConfig.auth.savedCredential : undefined
227222
const isApiKeyMode =
228223
connectorConfig?.auth.mode === 'apiKey'
229224
? !savedCredentialConfig || useApiKey

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ interface ConnectorsSectionProps {
3131
isLoading: boolean
3232
canEdit: boolean
3333
className?: string
34-
savedCredentialSetupEnabled?: boolean
3534
}
3635

3736
const STATUS_CONFIG = {
@@ -52,7 +51,6 @@ export function ConnectorsSection({
5251
isLoading,
5352
canEdit,
5453
className,
55-
savedCredentialSetupEnabled = false,
5654
}: ConnectorsSectionProps) {
5755
const scope = explicitScope ?? resourceScopeFromOwner({ workspaceId })
5856
const [editingConnector, setEditingConnector] = useState<ConnectorData | null>(null)
@@ -86,7 +84,6 @@ export function ConnectorsSection({
8684
knowledgeBaseId={knowledgeBaseId}
8785
isSearchIndex={isSearchIndex}
8886
connector={editingConnector}
89-
savedCredentialSetupEnabled={savedCredentialSetupEnabled}
9087
/>
9188
)}
9289
</div>

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/edit-connector-modal/edit-connector-modal.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ interface EditConnectorModalProps {
2626
knowledgeBaseId: string
2727
isSearchIndex?: boolean
2828
connector: ConnectorData
29-
savedCredentialSetupEnabled?: boolean
3029
}
3130

3231
export function EditConnectorModal({
@@ -36,7 +35,6 @@ export function EditConnectorModal({
3635
isSearchIndex = false,
3736
connector,
3837
scope,
39-
savedCredentialSetupEnabled = false,
4038
}: EditConnectorModalProps) {
4139
const [activeTab, setActiveTab] = useState('settings')
4240
const [documentFilter, setDocumentFilter] = useState<ConnectorDocumentFilter>('active')
@@ -46,7 +44,6 @@ export function EditConnectorModal({
4644
isSearchIndex,
4745
connector,
4846
onSaved: () => onOpenChange(false),
49-
savedCredentialSetupEnabled,
5047
})
5148

5249
return (

‎apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/edit-connector-modal/use-connector-settings-form.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ interface UseConnectorSettingsFormOptions {
127127
connector: ConnectorData
128128
onSaved: (connector: ConnectorData) => void
129129
syncing?: boolean
130-
/** Whether a key connector's saved credential may be replaced; the server refuses it while setup is off. */
131-
savedCredentialSetupEnabled?: boolean
132130
}
133131

134132
/** Editable connector settings shared by the source page and knowledge-base modal. */
@@ -139,7 +137,6 @@ export function useConnectorSettingsForm({
139137
connector,
140138
onSaved,
141139
syncing = isConnectorSyncingOrPending(connector),
142-
savedCredentialSetupEnabled = false,
143140
}: UseConnectorSettingsFormOptions) {
144141
const liveSearch = isSearchIndex
145142
const connectorConfig = liveSearchSourceMeta(
@@ -297,7 +294,7 @@ export function useConnectorSettingsForm({
297294
accessDirty && !accessModeChanged && isContentEngineAccessMode(access.accessMode)
298295
/** Exposes credential selection for mode changes and administrator credential recovery. */
299296
const needsWorkspaceCredential =
300-
(usesSavedCredential && savedCredentialSetupEnabled) ||
297+
usesSavedCredential ||
301298
(connectorConfig?.auth.mode === 'oauth' &&
302299
isContentEngineAccessMode(access.accessMode) &&
303300
(persistedAccess.accessMode === 'members' ||

‎apps/sim/app/workspace/[workspaceId]/layout.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
hasDesktopBackgroundExecutor,
1313
isDesktopBackgroundExecutorAvailable,
1414
} from '@/lib/desktop/executor/availability'
15-
import { isConnectorSavedCredentialSetupEnabled } from '@/lib/knowledge/connectors/saved-credential-rollout'
1615
import { isMothershipModelSelectorEnabled, isPlanModeEnabled } from '@/lib/mothership/feature-flags'
1716
import { resolveOrganizationEntryPath } from '@/lib/navigation/resolve-app-entry'
1817
import { isProjectsEnabled } from '@/lib/projects/rollout.server'
@@ -136,7 +135,6 @@ async function WorkspaceContent({
136135
desktopExecutorRegistered,
137136
projectsEnabled,
138137
simLinkOrganizationId,
139-
connectorSavedCredentialsEnabled,
140138
] = await Promise.all([
141139
cookies(),
142140
orgSettings,
@@ -156,7 +154,6 @@ async function WorkspaceContent({
156154
hasDesktopBackgroundExecutor(session.user.id),
157155
isProjectsEnabled(),
158156
resolveSimLinkOrganization(principal),
159-
isConnectorSavedCredentialSetupEnabled(),
160157
prefetchWorkspaceAccess(queryClient, workspaceId, principal),
161158
prefetchWorkspaceForkAvailability(queryClient, workspaceId, principal, hostContext),
162159
])
@@ -172,7 +169,6 @@ async function WorkspaceContent({
172169
'mothership-model-selector': modelSelectorEnabled,
173170
'mothership-plan-mode': planModeEnabled,
174171
projects: projectsEnabled,
175-
'knowledge-connector-saved-credentials': connectorSavedCredentialsEnabled,
176172
}}
177173
>
178174
<WorkspaceHostProvider workspaceId={workspaceId} initialContext={hostContext}>

0 commit comments

Comments
 (0)