-
Notifications
You must be signed in to change notification settings - Fork 159
Azure Explicit Credentials #8357
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
web-common/src/features/sources/modal/AzureMultiStepForm.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| <script lang="ts"> | ||
| import Input from "@rilldata/web-common/components/forms/Input.svelte"; | ||
| import Checkbox from "@rilldata/web-common/components/forms/Checkbox.svelte"; | ||
| import InformationalField from "@rilldata/web-common/components/forms/InformationalField.svelte"; | ||
| import Radio from "@rilldata/web-common/components/forms/Radio.svelte"; | ||
| import { ConnectorDriverPropertyType } from "@rilldata/web-common/runtime-client"; | ||
| import { normalizeErrors } from "./utils"; | ||
| import { AZURE_AUTH_OPTIONS, type AzureAuthMethod } from "./constants"; | ||
|
|
||
| export let properties: any[] = []; | ||
| export let paramsForm: any; | ||
| export let paramsErrors: Record<string, any>; | ||
| export let onStringInputChange: (e: Event) => void; | ||
|
|
||
| let azureAuthMethod: AzureAuthMethod = "connection_string"; | ||
|
|
||
| const filteredParamsProperties = properties; | ||
|
|
||
| function clearFields(keys: string[]) { | ||
| paramsForm.update( | ||
| ($form) => { | ||
| for (const key of keys) { | ||
| $form[key] = ""; | ||
| } | ||
| return $form; | ||
| }, | ||
| { taint: false }, | ||
| ); | ||
| } | ||
|
|
||
| $: if (azureAuthMethod === "connection_string") { | ||
| clearFields([ | ||
| "azure_storage_account", | ||
| "azure_storage_key", | ||
| "azure_storage_sas_token", | ||
| ]); | ||
| } else if (azureAuthMethod === "storage_key") { | ||
| clearFields(["azure_storage_connection_string", "azure_storage_sas_token"]); | ||
| } else if (azureAuthMethod === "sas_token") { | ||
| clearFields(["azure_storage_connection_string", "azure_storage_key"]); | ||
| } else if (azureAuthMethod === "public") { | ||
| clearFields([ | ||
| "azure_storage_connection_string", | ||
| "azure_storage_account", | ||
| "azure_storage_key", | ||
| "azure_storage_sas_token", | ||
| ]); | ||
| } | ||
| </script> | ||
|
|
||
| <div> | ||
| <div class="py-1.5 first:pt-0 last:pb-0"> | ||
| <div class="text-sm font-medium mb-4">Authentication</div> | ||
| <Radio | ||
| bind:value={azureAuthMethod} | ||
| options={AZURE_AUTH_OPTIONS} | ||
| name="azure-auth-method" | ||
| > | ||
| <svelte:fragment slot="custom-content" let:option> | ||
| {#if option.value === "connection_string"} | ||
| <Input | ||
| id="azure_storage_connection_string" | ||
| label="Connection String" | ||
| placeholder="Enter your Azure storage connection string" | ||
| optional={false} | ||
| secret={true} | ||
| hint="Paste an Azure Storage connection string" | ||
| errors={normalizeErrors( | ||
| paramsErrors.azure_storage_connection_string, | ||
| )} | ||
| bind:value={$paramsForm.azure_storage_connection_string} | ||
| alwaysShowError | ||
| /> | ||
| {:else if option.value === "storage_key"} | ||
| <div class="space-y-3"> | ||
| <Input | ||
| id="azure_storage_account" | ||
| label="Storage Account Name" | ||
| placeholder="Enter your Azure storage account name" | ||
| optional={false} | ||
| secret={false} | ||
| hint="Exact name of the Azure storage account" | ||
| errors={normalizeErrors(paramsErrors.azure_storage_account)} | ||
| bind:value={$paramsForm.azure_storage_account} | ||
| alwaysShowError | ||
| /> | ||
| <Input | ||
| id="azure_storage_key" | ||
| label="Storage Account Key" | ||
| placeholder="Enter your storage account key" | ||
| optional={false} | ||
| secret={true} | ||
| hint="Primary or secondary storage account key" | ||
| errors={normalizeErrors(paramsErrors.azure_storage_key)} | ||
| bind:value={$paramsForm.azure_storage_key} | ||
| alwaysShowError | ||
| /> | ||
| </div> | ||
| {:else if option.value === "sas_token"} | ||
| <div class="space-y-3"> | ||
| <Input | ||
| id="azure_storage_account" | ||
| label="Storage Account Name" | ||
| placeholder="Enter your Azure storage account name" | ||
| optional={false} | ||
| secret={false} | ||
| hint="Account hosting the blob container" | ||
| errors={normalizeErrors(paramsErrors.azure_storage_account)} | ||
| bind:value={$paramsForm.azure_storage_account} | ||
| alwaysShowError | ||
| /> | ||
| <Input | ||
| id="azure_storage_sas_token" | ||
| label="SAS Token" | ||
| placeholder="Enter your SAS token" | ||
| optional={false} | ||
| secret={true} | ||
| hint="Shared Access Signature token with blob permissions" | ||
| errors={normalizeErrors(paramsErrors.azure_storage_sas_token)} | ||
| bind:value={$paramsForm.azure_storage_sas_token} | ||
| alwaysShowError | ||
| /> | ||
| </div> | ||
| {/if} | ||
| </svelte:fragment> | ||
| </Radio> | ||
| </div> | ||
|
|
||
| {#each filteredParamsProperties as property (property.key)} | ||
| {@const propertyKey = property.key ?? ""} | ||
| {#if propertyKey !== "path" && propertyKey !== "azure_storage_connection_string" && propertyKey !== "azure_storage_account" && propertyKey !== "azure_storage_key" && propertyKey !== "azure_storage_sas_token"} | ||
| <div class="py-1.5 first:pt-0 last:pb-0"> | ||
| {#if property.type === ConnectorDriverPropertyType.TYPE_STRING || property.type === ConnectorDriverPropertyType.TYPE_NUMBER} | ||
| <Input | ||
| id={propertyKey} | ||
| label={property.displayName} | ||
| placeholder={property.placeholder} | ||
| optional={!property.required} | ||
| secret={property.secret} | ||
| hint={property.hint} | ||
| errors={normalizeErrors(paramsErrors[propertyKey])} | ||
| bind:value={$paramsForm[propertyKey]} | ||
| onInput={(_, e) => onStringInputChange(e)} | ||
| alwaysShowError | ||
| /> | ||
| {:else if property.type === ConnectorDriverPropertyType.TYPE_BOOLEAN} | ||
| <Checkbox | ||
| id={propertyKey} | ||
| bind:checked={$paramsForm[propertyKey]} | ||
| label={property.displayName} | ||
| hint={property.hint} | ||
| optional={!property.required} | ||
| /> | ||
| {:else if property.type === ConnectorDriverPropertyType.TYPE_INFORMATIONAL} | ||
| <InformationalField | ||
| description={property.description} | ||
| hint={property.hint} | ||
| href={property.docsUrl} | ||
| /> | ||
| {/if} | ||
| </div> | ||
| {/if} | ||
| {/each} | ||
| </div> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.