Skip to content

string encryption in create attribute #1882

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

Merged
merged 14 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@e190a19",
"@appwrite.io/pink": "0.25.0",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
"@appwrite.io/pink-legacy": "^1.0.3",
"@appwrite.io/pink-svelte": "https://try-module.cloud/module/@appwrite/@appwrite.io/pink-svelte@0cc439f",
"@appwrite.io/pink-svelte": "https://try-module.cloud/-/@appwrite/@appwrite.io/pink-svelte@063404f",
"@popperjs/core": "^2.11.8",
"@sentry/sveltekit": "^8.38.0",
"@stripe/stripe-js": "^3.5.0",
Expand Down
35 changes: 9 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/lib/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type Column = PinkColumn & {
format?: string;
exclude?: boolean;
elements?: string[] | { value: string | number; label: string }[];
encrypt?: boolean;
};

export function isValueOfStringEnum<T extends Record<string, string>>(
Expand Down
1 change: 1 addition & 0 deletions src/lib/sdk/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export type Plan = {
backupPolicies: number;
emailBranding: boolean;
supportsCredits: boolean;
databasesAllowEncrypt: boolean;
buildSize: number; // in MB
deploymentSize: number; // in MB
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
Link,
Popover,
Table,
Tooltip,
Typography
} from '@appwrite.io/pink-svelte';
import Create from '../createAttribute.svelte';
import { isRelationship } from '../document-[document]/attributes/store';
import { isRelationship, isString } from '../document-[document]/attributes/store';
import FailedModal from '../failedModal.svelte';
import CreateIndex from '../indexes/createIndex.svelte';
import { attributes, type Attributes, isCsvImportInProgress } from '../store';
Expand All @@ -33,7 +34,8 @@
IconPlus,
IconSwitchHorizontal,
IconTrash,
IconViewList
IconViewList,
IconLockClosed
} from '@appwrite.io/pink-icons-svelte';
import type { ComponentProps } from 'svelte';
import { Click, trackEvent } from '$lib/actions/analytics';
Expand Down Expand Up @@ -112,25 +114,38 @@
{:else}
<Icon icon={option.icon} size="s" />
{/if}
<span class="text u-trim-1" data-private>{attribute.key}</span>
{#if attribute.status !== 'available'}
<Badge
size="s"
variant="secondary"
content={attribute.status}
type={getAttributeStatusBadge(attribute.status)} />
{#if attribute.error}
<Link.Button
variant="muted"
on:click={(e) => {
e.preventDefault();
error = attribute.error;
showFailed = true;
}}>Details</Link.Button>
<Layout.Stack direction="row" alignItems="center" gap="s">
<Layout.Stack inline direction="row" alignItems="center" gap="xxs">
<span class="text u-trim-1" data-private>{attribute.key}</span>
{#if isString(attribute) && !attribute.encrypt}
<Tooltip>
<Icon
size="s"
icon={IconLockClosed}
color="--fgcolor-neutral-tertiary" />
<div slot="tooltip">Encrypted</div>
</Tooltip>
{/if}
</Layout.Stack>
{#if attribute.status !== 'available'}
<Badge
size="s"
variant="secondary"
content={attribute.status}
type={getAttributeStatusBadge(attribute.status)} />
{#if attribute.error}
<Link.Button
variant="muted"
on:click={(e) => {
e.preventDefault();
error = attribute.error;
showFailed = true;
}}>Details</Link.Button>
{/if}
{:else if attribute.required}
<Badge size="xs" variant="secondary" content="required" />
{/if}
{:else if attribute.required}
<Badge size="s" variant="secondary" content="required" />
{/if}
</Layout.Stack>
</Layout.Stack>
</Table.Cell>
<Table.Cell column="type" {root}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,4 @@
label="Array"
bind:checked={data.array}
disabled={data.required || editing}
description="Indicate whether this attribute should act as an array, with the default value set as an empty
array." />
description="Indicate whether this attribute is an array. Defaults to an empty array." />
Loading