Skip to content
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
84 changes: 84 additions & 0 deletions e2e/integration/public-share-password.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { expect, test } from './lib/test-fixtures';

test.describe('public share passwords', () => {
test('visitors unlock a password protected public share', async ({
authedPage,
browser,
user,
}) => {
const username = user.credentials.username;
const page = authedPage;

// Create a password protected public share
await page.goto('/shares/public');
await page.getByRole('main').getByRole('button', { name: 'New Share' }).first().click();
const dialog = page.getByRole('dialog');
await dialog.getByLabel('Name').fill('Locked Share');
await dialog.getByLabel('Custom URL').fill('locked');
await dialog.getByLabel('Password (optional)').fill('abc');
await expect(dialog.getByText('Use 4 to 128 characters.')).toBeVisible();
await expect(dialog.getByRole('button', { name: 'Create' })).toBeDisabled();
await dialog.getByLabel('Password (optional)').fill('open sesame');
await dialog.getByRole('button', { name: 'Create' }).click();
await expect(page.getByText('Created new public share')).toBeVisible();
await expect(page.getByLabel('Password protected')).toBeVisible();

// A visitor has to enter the password first
const anon = await browser.newContext();
const visitor = await anon.newPage();
await visitor.goto(`/u/${username}/locked`);
await expect(visitor.getByRole('heading', { name: 'Locked Share' })).toBeVisible();
await expect(visitor.getByText('This public share is password protected.')).toBeVisible();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeHidden();

await visitor.getByLabel('Password').fill('wrong password');
await visitor.getByRole('button', { name: 'Unlock' }).click();
await expect(visitor.getByText('Incorrect password')).toBeVisible();

await visitor.getByLabel('Password').fill('open sesame');
await visitor.getByRole('button', { name: 'Unlock' }).click();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// The unlock is remembered for the tab
await visitor.reload();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// Changing the password locks the visitor out again
await page.getByRole('heading', { name: 'Locked Share' }).click();
await expect(page).toHaveURL(/\/shares\/public\/[0-9a-f-]+$/);
await page.goto(`${page.url()}/edit`);
const passwordCard = page.locator('[data-slot="card"]', {
hasText: 'Visitors have to enter it',
});
await passwordCard.getByLabel('New password').fill('new secret');
await passwordCard.getByRole('button', { name: 'Change password' }).click();
await expect(page.getByText('Password saved')).toBeVisible();

await visitor.reload();
await expect(visitor.getByText('This public share is password protected.')).toBeVisible();

// Removing it opens the share
await passwordCard.getByRole('button', { name: 'Remove password' }).click();
await expect(page.getByText('Password removed')).toBeVisible();
await expect(passwordCard.getByText(/No password/)).toBeVisible();

await visitor.reload();
await expect(visitor.getByRole('button', { name: 'Enter as Guest' })).toBeVisible();

// Adding a password sends a visitor who is in control back to the password prompt
await visitor.getByRole('button', { name: 'Enter as Guest' }).click();
await visitor.getByPlaceholder('Guest Name').fill('Visitor');
await visitor.getByRole('button', { name: 'Enter', exact: true }).click();
await expect(visitor.getByText('This public share is password protected.')).toBeHidden();

await passwordCard.getByLabel('Password', { exact: true }).fill('another secret');
await passwordCard.getByRole('button', { name: 'Set password' }).click();
await expect(page.getByText('Password saved')).toBeVisible();

await expect(
visitor.getByText('The owner set a new password. Enter it to continue.')
).toBeVisible();

await anon.close();
});
});
9 changes: 9 additions & 0 deletions messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "Ungültige benutzerdefinierte URL",
"problem_share_link_slug_invalid_desc": "Verwende 2–32 Kleinbuchstaben, Ziffern und einzelne Bindestriche, ohne Bindestrich am Anfang oder Ende.",
"problem_share_link_slug_taken_title": "Du hast bereits eine öffentliche Freigabe mit dieser benutzerdefinierten URL",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Mindestens ein Eintrag ist keine gültige Domain, es wurde nichts hinzugefügt",
"problem_share_shocker_share_limit_reached_title": "Shocker hat zu viele Freigaben",
"problem_share_shocker_share_limit_reached_desc": "Ein Shocker kann mit höchstens 100 Nutzern geteilt werden.",
"problem_share_link_too_many_share_links_title": "Du hast zu viele öffentliche Freigaben",
"problem_share_link_too_many_share_links_desc": "Du hast das Maximum von 500 öffentlichen Freigaben erreicht.",
"problem_share_link_not_password_protected_title": "Diese öffentliche Freigabe hat kein Passwort",
"problem_share_link_password_incorrect_title": "Falsches Passwort",
"problem_share_link_too_many_password_attempts_title": "Zu viele falsche Passwörter",
"problem_share_link_too_many_password_attempts_desc": "Für diese öffentliche Freigabe wurden zu viele falsche Passwörter eingegeben. Versuche es in ein paar Minuten erneut.",
"problem_user_profile_not_found_title": "Profil nicht gefunden",
"problem_user_profile_default_public_share_not_found_title": "Standardmäßige öffentliche Freigabe nicht gefunden",
"problem_user_profile_default_public_share_not_found_desc": "Sie ist möglicherweise abgelaufen oder wurde gelöscht.",
Expand Down
26 changes: 26 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,23 @@
"public_share_custom_url_optional": "Optional, lowercase letters, numbers and hyphens",
"public_share_slug_invalid": "Use 2-32 lowercase letters, numbers and single hyphens",
"public_share_slug_not_found_desc": "This public share does not exist, or its custom URL has changed.",
"public_share_password_title": "Password",
"public_share_password_settings_desc": "Visitors have to enter it before they can see or control the shockers. Setting or changing it disconnects everyone using this public share.",
"public_share_password_status_on": "Password protected",
"public_share_password_status_off": "No password, anyone with the link can use it",
"public_share_password_label": "Password",
"public_share_password_new": "New password",
"public_share_password_optional": "Password (optional)",
"public_share_password_set": "Set password",
"public_share_password_change": "Change password",
"public_share_password_remove": "Remove password",
"public_share_password_length": "Use {{min}} to {{max}} characters.",
"public_share_password_toast_set": "Password saved",
"public_share_password_toast_removed": "Password removed",
"public_share_password_desc": "This public share is password protected.",
"public_share_password_placeholder": "Enter the password",
"public_share_password_unlock": "Unlock",
"public_share_password_changed": "The owner set a new password. Enter it to continue.",
"public_share_settings_title": "Settings",
"public_share_settings_desc": "Name, custom URL and expiry of this public share.",
"public_share_toast_settings_saved": "Public share updated",
Expand Down Expand Up @@ -1140,6 +1157,15 @@
"problem_share_link_slug_invalid_title": "Invalid custom URL",
"problem_share_link_slug_invalid_desc": "Use 2-32 lowercase letters, numbers and single hyphens, not starting or ending with a hyphen.",
"problem_share_link_slug_taken_title": "You already have a public share with this custom URL",
"problem_admin_email_provider_blacklist_invalid_domains_title": "One or more entries are not valid domains, nothing was added",
"problem_share_shocker_share_limit_reached_title": "Shocker has too many shares",
"problem_share_shocker_share_limit_reached_desc": "A shocker can be shared with at most 100 users.",
"problem_share_link_too_many_share_links_title": "You have too many public shares",
"problem_share_link_too_many_share_links_desc": "You have reached the maximum of 500 public shares.",
"problem_share_link_not_password_protected_title": "This public share has no password",
"problem_share_link_password_incorrect_title": "Incorrect password",
"problem_share_link_too_many_password_attempts_title": "Too many incorrect passwords",
"problem_share_link_too_many_password_attempts_desc": "Too many incorrect passwords were entered for this public share. Try again in a few minutes.",
"problem_user_profile_not_found_title": "Profile not found",
"problem_user_profile_default_public_share_not_found_title": "Default public share not found",
"problem_user_profile_default_public_share_not_found_desc": "It may have expired or been deleted.",
Expand Down
9 changes: 9 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "URL personalizada no válida",
"problem_share_link_slug_invalid_desc": "Usa de 2 a 32 letras minúsculas, números y guiones simples, sin empezar ni terminar con un guion.",
"problem_share_link_slug_taken_title": "Ya tienes un enlace público con esta URL personalizada",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Una o más entradas no son dominios válidos, no se añadió nada",
"problem_share_shocker_share_limit_reached_title": "El shocker tiene demasiados accesos compartidos",
"problem_share_shocker_share_limit_reached_desc": "Un shocker se puede compartir con un máximo de 100 usuarios.",
"problem_share_link_too_many_share_links_title": "Tienes demasiados enlaces públicos",
"problem_share_link_too_many_share_links_desc": "Has alcanzado el máximo de 500 enlaces públicos.",
"problem_share_link_not_password_protected_title": "Este enlace público no tiene contraseña",
"problem_share_link_password_incorrect_title": "Contraseña incorrecta",
"problem_share_link_too_many_password_attempts_title": "Demasiadas contraseñas incorrectas",
"problem_share_link_too_many_password_attempts_desc": "Se introdujeron demasiadas contraseñas incorrectas para este enlace público. Inténtalo de nuevo en unos minutos.",
"problem_user_profile_not_found_title": "No se encontró el perfil",
"problem_user_profile_default_public_share_not_found_title": "No se encontró el enlace público predeterminado",
"problem_user_profile_default_public_share_not_found_desc": "Puede que haya caducado o se haya eliminado.",
Expand Down
9 changes: 9 additions & 0 deletions messages/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "Vigane kohandatud URL",
"problem_share_link_slug_invalid_desc": "Kasuta 2–32 väiketähte, numbrit ja üksikut sidekriipsu, mis ei alga ega lõppe sidekriipsuga.",
"problem_share_link_slug_taken_title": "Sul on juba selle kohandatud URL-iga avalik jagamine",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Üks või mitu kirjet ei ole kehtivad domeenid, midagi ei lisatud",
"problem_share_shocker_share_limit_reached_title": "Šokeril on liiga palju jagamisi",
"problem_share_shocker_share_limit_reached_desc": "Šokerit saab jagada kõige rohkem 100 kasutajaga.",
"problem_share_link_too_many_share_links_title": "Sul on liiga palju avalikke jagamisi",
"problem_share_link_too_many_share_links_desc": "Oled jõudnud 500 avaliku jagamise piirini.",
"problem_share_link_not_password_protected_title": "Sellel avalikul jagamisel pole parooli",
"problem_share_link_password_incorrect_title": "Vale parool",
"problem_share_link_too_many_password_attempts_title": "Liiga palju valesid paroole",
"problem_share_link_too_many_password_attempts_desc": "Selle avaliku jagamise jaoks sisestati liiga palju valesid paroole. Proovi mõne minuti pärast uuesti.",
"problem_user_profile_not_found_title": "Profiili ei leitud",
"problem_user_profile_default_public_share_not_found_title": "Vaikimisi avalikku jagamist ei leitud",
"problem_user_profile_default_public_share_not_found_desc": "See võib olla aegunud või kustutatud.",
Expand Down
9 changes: 9 additions & 0 deletions messages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "Virheellinen mukautettu URL",
"problem_share_link_slug_invalid_desc": "Käytä 2–32 pientä kirjainta, numeroa ja yksittäistä yhdysmerkkiä, ei yhdysmerkkiä alussa tai lopussa.",
"problem_share_link_slug_taken_title": "Sinulla on jo julkinen jako tällä mukautetulla URL-osoitteella",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Yksi tai useampi merkintä ei ole kelvollinen verkkotunnus, mitään ei lisätty",
"problem_share_shocker_share_limit_reached_title": "Shockerilla on liian monta jakoa",
"problem_share_shocker_share_limit_reached_desc": "Shockerin voi jakaa enintään 100 käyttäjälle.",
"problem_share_link_too_many_share_links_title": "Sinulla on liian monta julkista jakoa",
"problem_share_link_too_many_share_links_desc": "Olet saavuttanut 500 julkisen jaon enimmäismäärän.",
"problem_share_link_not_password_protected_title": "Tällä julkisella jaolla ei ole salasanaa",
"problem_share_link_password_incorrect_title": "Väärä salasana",
"problem_share_link_too_many_password_attempts_title": "Liian monta väärää salasanaa",
"problem_share_link_too_many_password_attempts_desc": "Tälle julkiselle jaolle syötettiin liian monta väärää salasanaa. Yritä uudelleen muutaman minuutin kuluttua.",
"problem_user_profile_not_found_title": "Profiilia ei löytynyt",
"problem_user_profile_default_public_share_not_found_title": "Oletusarvoista julkista jakoa ei löytynyt",
"problem_user_profile_default_public_share_not_found_desc": "Se on voinut vanhentua tai se on poistettu.",
Expand Down
9 changes: 9 additions & 0 deletions messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "URL personnalisée invalide",
"problem_share_link_slug_invalid_desc": "Utilise de 2 à 32 lettres minuscules, chiffres et tirets simples, sans tiret au début ni à la fin.",
"problem_share_link_slug_taken_title": "Tu as déjà un partage public avec cette URL personnalisée",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Une ou plusieurs entrées ne sont pas des domaines valides, rien n’a été ajouté",
"problem_share_shocker_share_limit_reached_title": "Le shocker a trop de partages",
"problem_share_shocker_share_limit_reached_desc": "Un shocker peut être partagé avec 100 utilisateurs au maximum.",
"problem_share_link_too_many_share_links_title": "Tu as trop de partages publics",
"problem_share_link_too_many_share_links_desc": "Tu as atteint le maximum de 500 partages publics.",
"problem_share_link_not_password_protected_title": "Ce partage public n’a pas de mot de passe",
"problem_share_link_password_incorrect_title": "Mot de passe incorrect",
"problem_share_link_too_many_password_attempts_title": "Trop de mots de passe incorrects",
"problem_share_link_too_many_password_attempts_desc": "Trop de mots de passe incorrects ont été saisis pour ce partage public. Réessaie dans quelques minutes.",
"problem_user_profile_not_found_title": "Profil introuvable",
"problem_user_profile_default_public_share_not_found_title": "Partage public par défaut introuvable",
"problem_user_profile_default_public_share_not_found_desc": "Il a peut-être expiré ou été supprimé.",
Expand Down
9 changes: 9 additions & 0 deletions messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,15 @@
"problem_share_link_slug_invalid_title": "カスタムURLが無効です",
"problem_share_link_slug_invalid_desc": "小文字、数字、単一のハイフンを2~32文字で使用してください。先頭と末尾にハイフンは使えません。",
"problem_share_link_slug_taken_title": "このカスタムURLの公開共有はすでにあります",
"problem_admin_email_provider_blacklist_invalid_domains_title": "無効なドメインが含まれているため、何も追加されませんでした",
"problem_share_shocker_share_limit_reached_title": "このショッカーの共有が多すぎます",
"problem_share_shocker_share_limit_reached_desc": "ショッカーは最大100人のユーザーと共有できます。",
"problem_share_link_too_many_share_links_title": "公開共有が多すぎます",
"problem_share_link_too_many_share_links_desc": "公開共有の上限(500件)に達しました。",
"problem_share_link_not_password_protected_title": "この公開共有にはパスワードがありません",
"problem_share_link_password_incorrect_title": "パスワードが正しくありません",
"problem_share_link_too_many_password_attempts_title": "パスワードの入力ミスが多すぎます",
"problem_share_link_too_many_password_attempts_desc": "この公開共有に対して誤ったパスワードが何度も入力されました。数分後にもう一度お試しください。",
"problem_user_profile_not_found_title": "プロフィールが見つかりません",
"problem_user_profile_default_public_share_not_found_title": "デフォルトの公開共有が見つかりません",
"problem_user_profile_default_public_share_not_found_desc": "期限切れか、削除された可能性があります。",
Expand Down
9 changes: 9 additions & 0 deletions messages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "Ugyldig egendefinert URL",
"problem_share_link_slug_invalid_desc": "Bruk 2–32 små bokstaver, tall og enkle bindestreker, uten bindestrek først eller sist.",
"problem_share_link_slug_taken_title": "Du har allerede en delingslenke med denne egendefinerte URL-en",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Én eller flere oppføringer er ikke gyldige domener, ingenting ble lagt til",
"problem_share_shocker_share_limit_reached_title": "Shockeren har for mange delinger",
"problem_share_shocker_share_limit_reached_desc": "En shocker kan deles med høyst 100 brukere.",
"problem_share_link_too_many_share_links_title": "Du har for mange delingslenker",
"problem_share_link_too_many_share_links_desc": "Du har nådd maksimum på 500 delingslenker.",
"problem_share_link_not_password_protected_title": "Denne delingslenken har ikke passord",
"problem_share_link_password_incorrect_title": "Feil passord",
"problem_share_link_too_many_password_attempts_title": "For mange feil passord",
"problem_share_link_too_many_password_attempts_desc": "Det ble skrevet inn for mange feil passord for denne delingslenken. Prøv igjen om noen minutter.",
"problem_user_profile_not_found_title": "Fant ikke profilen",
"problem_user_profile_default_public_share_not_found_title": "Fant ikke standard delingslenke",
"problem_user_profile_default_public_share_not_found_desc": "Den kan ha utløpt eller blitt slettet.",
Expand Down
9 changes: 9 additions & 0 deletions messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,15 @@
"problem_share_link_slug_invalid_title": "Ongeldige aangepaste URL",
"problem_share_link_slug_invalid_desc": "Gebruik 2–32 kleine letters, cijfers en enkele koppeltekens, zonder koppelteken aan het begin of eind.",
"problem_share_link_slug_taken_title": "Je hebt al een openbare deling met deze aangepaste URL",
"problem_admin_email_provider_blacklist_invalid_domains_title": "Een of meer items zijn geen geldige domeinen, er is niets toegevoegd",
"problem_share_shocker_share_limit_reached_title": "Shocker heeft te veel deelacties",
"problem_share_shocker_share_limit_reached_desc": "Een shocker kan met maximaal 100 gebruikers worden gedeeld.",
"problem_share_link_too_many_share_links_title": "Je hebt te veel openbare delingen",
"problem_share_link_too_many_share_links_desc": "Je hebt het maximum van 500 openbare delingen bereikt.",
"problem_share_link_not_password_protected_title": "Deze openbare deling heeft geen wachtwoord",
"problem_share_link_password_incorrect_title": "Onjuist wachtwoord",
"problem_share_link_too_many_password_attempts_title": "Te veel onjuiste wachtwoorden",
"problem_share_link_too_many_password_attempts_desc": "Er zijn te veel onjuiste wachtwoorden ingevoerd voor deze openbare deling. Probeer het over een paar minuten opnieuw.",
"problem_user_profile_not_found_title": "Profiel niet gevonden",
"problem_user_profile_default_public_share_not_found_title": "Standaard openbare deling niet gevonden",
"problem_user_profile_default_public_share_not_found_desc": "Deze is mogelijk verlopen of verwijderd.",
Expand Down
Loading