feat(api): let public API keys be scoped to single areas

A key could only ever read everything a user owns. When a second service
reads TREK on that user's behalf, that is more than it needs: Dawarich
wants trips, days and places, not notes, bookings or the wish list.

Keys can now be minted with an explicit list of areas, checked in the
guard and shown when the key is listed. Keys that existed before this
keep full read access, so nothing that works today stops working. A key
marked as limited whose list cannot be read grants nothing rather than
everything.
This commit is contained in:
Maurice
2026-09-12 23:34:42 +02:00
parent 906eef4349
commit dad1316172
35 changed files with 1657 additions and 35 deletions
+15
View File
@@ -537,6 +537,21 @@ const settings: TranslationStrings = {
'يعرض تلقائيًا مسار كل رحلة طيران وقطار وحجز آخر على الخريطة، دون الحاجة إلى تفعيله لكل عنصر على حدة.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'ما يمكن لهذا المفتاح قراءته',
'settings.apiScopes.hint':
'اترك كل شيء مفعّلاً لمفتاح ينبغي أن يرى كل شيء. أي خيار توقفه يُرفض لهذا المفتاح، لا يُحذف من الإجابة فحسب.',
'settings.apiScopes.all': 'كل شيء',
'settings.apiScopes.limited': '{count} من {total}',
'settings.apiScopes.trips': 'الرحلات',
'settings.apiScopes.days': 'الأيام',
'settings.apiScopes.places': 'الأماكن',
'settings.apiScopes.notes': 'ملاحظات اليوم',
'settings.apiScopes.reservations': 'الحجوزات',
'settings.apiScopes.accommodations': 'الإقامة',
'settings.apiScopes.travellers': 'من سيأتي',
'settings.apiScopes.bucket-list': 'قائمة الأمنيات',
'settings.apiScopes.stats': 'الإجماليات',
'settings.apiKeys.title': 'مفاتيح API',
'settings.apiKeys.description': 'مفاتيح لواجهة API العامة، حتى تتمكن برامج أخرى من قراءة رحلاتك. للقراءة فقط: لا يمكن للمفتاح تغيير أي شيء أو حذفه.',
'settings.apiKeys.create': 'إنشاء مفتاح',
+15
View File
@@ -552,6 +552,21 @@ const settings: TranslationStrings = {
'Mostra automaticamente no mapa a rota de cada voo, trem e outra reserva, sem precisar ativar item por item.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'O que esta chave pode ler',
'settings.apiScopes.hint':
'Deixe tudo ligado para uma chave que deve enxergar tudo. O que você desligar é recusado para esta chave, não apenas omitido da resposta.',
'settings.apiScopes.all': 'Tudo',
'settings.apiScopes.limited': '{count} de {total}',
'settings.apiScopes.trips': 'Viagens',
'settings.apiScopes.days': 'Dias',
'settings.apiScopes.places': 'Lugares',
'settings.apiScopes.notes': 'Notas do dia',
'settings.apiScopes.reservations': 'Reservas',
'settings.apiScopes.accommodations': 'Hospedagem',
'settings.apiScopes.travellers': 'Quem vai',
'settings.apiScopes.bucket-list': 'Lista de desejos',
'settings.apiScopes.stats': 'Totais',
'settings.apiKeys.title': 'Chaves de API',
'settings.apiKeys.description': 'Chaves para a API pública, para que outros softwares possam ler suas viagens. Somente leitura: uma chave não pode alterar nem excluir nada.',
'settings.apiKeys.create': 'Criar chave',
+15
View File
@@ -555,6 +555,21 @@ const settings: TranslationStrings = {
'Dibuixa automàticament al mapa la ruta de cada vol, tren i altra reserva — no cal activar-la una per una.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Què pot llegir aquesta clau',
'settings.apiScopes.hint':
'Deixa-ho tot activat per a una clau que ho hagi de veure tot. El que desactivis es denega per a aquesta clau, no només es deixa fora de la resposta.',
'settings.apiScopes.all': 'Tot',
'settings.apiScopes.limited': '{count} de {total}',
'settings.apiScopes.trips': 'Viatges',
'settings.apiScopes.days': 'Dies',
'settings.apiScopes.places': 'Llocs',
'settings.apiScopes.notes': 'Notes del dia',
'settings.apiScopes.reservations': 'Reserves',
'settings.apiScopes.accommodations': 'Allotjament',
'settings.apiScopes.travellers': 'Qui hi va',
'settings.apiScopes.bucket-list': 'Llista de desitjos',
'settings.apiScopes.stats': 'Totals',
'settings.apiKeys.title': 'Claus API',
'settings.apiKeys.description': 'Claus per a l\'API pública, perquè altres programes puguin llegir els teus viatges. Només lectura: una clau no pot canviar ni esborrar res.',
'settings.apiKeys.create': 'Crea una clau',
+15
View File
@@ -544,6 +544,21 @@ const settings: TranslationStrings = {
'Automaticky zobrazí na mapě trasu každého letu, vlaku a jiné rezervace, aniž byste ji museli zapínat jednotlivě.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Co smí tento klíč číst',
'settings.apiScopes.hint':
'Pro klíč, který má vidět všechno, nechte vše zapnuté. Cokoli vypnete, bude tomuto klíči odepřeno, nejen vynecháno z odpovědi.',
'settings.apiScopes.all': 'Vše',
'settings.apiScopes.limited': '{count} z {total}',
'settings.apiScopes.trips': 'Cesty',
'settings.apiScopes.days': 'Dny',
'settings.apiScopes.places': 'Místa',
'settings.apiScopes.notes': 'Poznámky ke dni',
'settings.apiScopes.reservations': 'Rezervace',
'settings.apiScopes.accommodations': 'Ubytování',
'settings.apiScopes.travellers': 'Kdo jede',
'settings.apiScopes.bucket-list': 'Seznam přání',
'settings.apiScopes.stats': 'Souhrny',
'settings.apiKeys.title': 'Klíče API',
'settings.apiKeys.description': 'Klíče pro veřejné API, aby jiný software mohl číst tvoje cesty. Jen pro čtení: klíč nemůže nic měnit ani mazat.',
'settings.apiKeys.create': 'Vytvořit klíč',
+15
View File
@@ -555,6 +555,21 @@ const settings: TranslationStrings = {
'Zeigt die Route für jeden Flug, jede Zugfahrt und jede andere Buchung automatisch auf der Karte an – ohne sie einzeln aktivieren zu müssen.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Was dieser Schlüssel lesen darf',
'settings.apiScopes.hint':
'Lass alles an, wenn der Schlüssel alles sehen soll. Was du abschaltest, wird für diesen Schlüssel abgelehnt und nicht nur aus der Antwort weggelassen.',
'settings.apiScopes.all': 'Alles',
'settings.apiScopes.limited': '{count} von {total}',
'settings.apiScopes.trips': 'Reisen',
'settings.apiScopes.days': 'Tage',
'settings.apiScopes.places': 'Orte',
'settings.apiScopes.notes': 'Tagesnotizen',
'settings.apiScopes.reservations': 'Buchungen',
'settings.apiScopes.accommodations': 'Unterkunft',
'settings.apiScopes.travellers': 'Wer mitkommt',
'settings.apiScopes.bucket-list': 'Wunschliste',
'settings.apiScopes.stats': 'Summen',
'settings.apiKeys.title': 'API-Schlüssel',
'settings.apiKeys.description': 'Schlüssel für die öffentliche API, damit andere Software deine Reisen lesen kann. Nur lesend: ein Schlüssel kann nichts ändern oder löschen.',
'settings.apiKeys.create': 'Schlüssel erstellen',
+15
View File
@@ -543,6 +543,21 @@ const settings: TranslationStrings = {
'Automatically draw the route for every flight, train and other booking on the map — no need to switch it on per item.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'What this key may read',
'settings.apiScopes.hint':
'Leave everything on for a key that should see all of it. Anything you switch off is refused for this key, not just left out of the answer.',
'settings.apiScopes.all': 'Everything',
'settings.apiScopes.limited': '{count} of {total}',
'settings.apiScopes.trips': 'Trips',
'settings.apiScopes.days': 'Days',
'settings.apiScopes.places': 'Places',
'settings.apiScopes.notes': 'Day notes',
'settings.apiScopes.reservations': 'Bookings',
'settings.apiScopes.accommodations': 'Accommodation',
'settings.apiScopes.travellers': 'Who is coming',
'settings.apiScopes.bucket-list': 'Wishlist',
'settings.apiScopes.stats': 'Totals',
'settings.apiKeys.title': 'API Keys',
'settings.apiKeys.description': 'Keys for the public API, so other software can read your trips. Read-only: a key cannot change or delete anything.',
'settings.apiKeys.create': 'Create key',
+15
View File
@@ -553,6 +553,21 @@ const settings: TranslationStrings = {
'Muestra automáticamente en el mapa la ruta de cada vuelo, tren y otra reserva, sin necesidad de activarla una por una.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Qué puede leer esta clave',
'settings.apiScopes.hint':
'Déjalo todo activado para una clave que deba verlo todo. Lo que desactives se le deniega a esta clave, no solo se omite de la respuesta.',
'settings.apiScopes.all': 'Todo',
'settings.apiScopes.limited': '{count} de {total}',
'settings.apiScopes.trips': 'Viajes',
'settings.apiScopes.days': 'Días',
'settings.apiScopes.places': 'Lugares',
'settings.apiScopes.notes': 'Notas del día',
'settings.apiScopes.reservations': 'Reservas',
'settings.apiScopes.accommodations': 'Alojamiento',
'settings.apiScopes.travellers': 'Quién viene',
'settings.apiScopes.bucket-list': 'Lista de deseos',
'settings.apiScopes.stats': 'Totales',
'settings.apiKeys.title': 'Claves API',
'settings.apiKeys.description': 'Claves para la API pública, para que otro software pueda leer tus viajes. Solo lectura: una clave no puede cambiar ni borrar nada.',
'settings.apiKeys.create': 'Crear clave',
+15
View File
@@ -561,6 +561,21 @@ const settings: TranslationStrings = {
"Affiche automatiquement sur la carte l'itinéraire de chaque vol, trajet en train et autre réservation, sans avoir à l'activer un par un.",
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Ce que cette clé peut lire',
'settings.apiScopes.hint':
'Laissez tout activé pour une clé qui doit tout voir. Ce que vous désactivez est refusé à cette clé, et pas seulement omis de la réponse.',
'settings.apiScopes.all': 'Tout',
'settings.apiScopes.limited': '{count} sur {total}',
'settings.apiScopes.trips': 'Voyages',
'settings.apiScopes.days': 'Jours',
'settings.apiScopes.places': 'Lieux',
'settings.apiScopes.notes': 'Notes du jour',
'settings.apiScopes.reservations': 'Réservations',
'settings.apiScopes.accommodations': 'Hébergement',
'settings.apiScopes.travellers': 'Qui participe',
'settings.apiScopes.bucket-list': 'Liste de souhaits',
'settings.apiScopes.stats': 'Totaux',
'settings.apiKeys.title': 'Clés API',
'settings.apiKeys.description': 'Clés pour l\'API publique, afin que d\'autres logiciels puissent lire vos voyages. Lecture seule : une clé ne peut rien modifier ni supprimer.',
'settings.apiKeys.create': 'Créer une clé',
+15
View File
@@ -564,6 +564,21 @@ const settings: TranslationStrings = {
'Εμφανίζει αυτόματα στον χάρτη τη διαδρομή κάθε πτήσης, τρένου και άλλης κράτησης, χωρίς να χρειάζεται να την ενεργοποιείτε μία προς μία.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Τι μπορεί να διαβάσει αυτό το κλειδί',
'settings.apiScopes.hint':
'Αφήστε τα όλα ενεργά για ένα κλειδί που πρέπει να τα βλέπει όλα. Ό,τι απενεργοποιήσετε απορρίπτεται για αυτό το κλειδί, δεν παραλείπεται απλώς από την απάντηση.',
'settings.apiScopes.all': 'Τα πάντα',
'settings.apiScopes.limited': '{count} από {total}',
'settings.apiScopes.trips': 'Ταξίδια',
'settings.apiScopes.days': 'Ημέρες',
'settings.apiScopes.places': 'Τοποθεσίες',
'settings.apiScopes.notes': 'Σημειώσεις ημέρας',
'settings.apiScopes.reservations': 'Κρατήσεις',
'settings.apiScopes.accommodations': 'Διαμονή',
'settings.apiScopes.travellers': 'Ποιοι συμμετέχουν',
'settings.apiScopes.bucket-list': 'Λίστα επιθυμιών',
'settings.apiScopes.stats': 'Σύνολα',
'settings.apiKeys.title': 'Κλειδιά API',
'settings.apiKeys.description': 'Κλειδιά για το δημόσιο API, ώστε άλλο λογισμικό να μπορεί να διαβάζει τα ταξίδια σου. Μόνο για ανάγνωση: ένα κλειδί δεν μπορεί να αλλάξει ή να διαγράψει τίποτα.',
'settings.apiKeys.create': 'Δημιουργία κλειδιού',
+15
View File
@@ -554,6 +554,21 @@ const settings: TranslationStrings = {
'Automatikusan megjeleníti minden repülőjárat, vonat és egyéb foglalás útvonalát a térképen, nincs szükség egyenkénti bekapcsolásra.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Mit olvashat ez a kulcs',
'settings.apiScopes.hint':
'Hagyj mindent bekapcsolva, ha a kulcs mindent láthat. Amit kikapcsolsz, azt a rendszer megtagadja ettől a kulcstól, nem csak kihagyja a válaszból.',
'settings.apiScopes.all': 'Minden',
'settings.apiScopes.limited': '{count} / {total}',
'settings.apiScopes.trips': 'Utazások',
'settings.apiScopes.days': 'Napok',
'settings.apiScopes.places': 'Helyszínek',
'settings.apiScopes.notes': 'Napi jegyzetek',
'settings.apiScopes.reservations': 'Foglalások',
'settings.apiScopes.accommodations': 'Szállás',
'settings.apiScopes.travellers': 'Kik utaznak',
'settings.apiScopes.bucket-list': 'Kívánságlista',
'settings.apiScopes.stats': 'Összesítések',
'settings.apiKeys.title': 'API-kulcsok',
'settings.apiKeys.description': 'Kulcsok a nyilvános API-hoz, hogy más szoftverek olvashassák az utazásaidat. Csak olvasható: a kulcs semmit nem módosít és nem töröl.',
'settings.apiKeys.create': 'Kulcs létrehozása',
+15
View File
@@ -550,6 +550,21 @@ const settings: TranslationStrings = {
'Menampilkan rute setiap penerbangan, kereta, dan pemesanan lainnya di peta secara otomatis, tanpa perlu mengaktifkannya satu per satu.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Apa yang boleh dibaca kunci ini',
'settings.apiScopes.hint':
'Biarkan semuanya menyala untuk kunci yang boleh melihat semuanya. Apa pun yang kamu matikan akan ditolak untuk kunci ini, bukan sekadar tidak disertakan dalam jawaban.',
'settings.apiScopes.all': 'Semuanya',
'settings.apiScopes.limited': '{count} dari {total}',
'settings.apiScopes.trips': 'Perjalanan',
'settings.apiScopes.days': 'Hari',
'settings.apiScopes.places': 'Tempat',
'settings.apiScopes.notes': 'Catatan harian',
'settings.apiScopes.reservations': 'Pemesanan',
'settings.apiScopes.accommodations': 'Akomodasi',
'settings.apiScopes.travellers': 'Siapa yang ikut',
'settings.apiScopes.bucket-list': 'Daftar keinginan',
'settings.apiScopes.stats': 'Total',
'settings.apiKeys.title': 'Kunci API',
'settings.apiKeys.description': 'Kunci untuk API publik, agar perangkat lunak lain dapat membaca perjalananmu. Hanya baca: kunci tidak dapat mengubah atau menghapus apa pun.',
'settings.apiKeys.create': 'Buat kunci',
+15
View File
@@ -552,6 +552,21 @@ const settings: TranslationStrings = {
'Mostra automaticamente sulla mappa il percorso di ogni volo, treno e altra prenotazione, senza doverlo attivare singolarmente.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Cosa può leggere questa chiave',
'settings.apiScopes.hint':
'Lascia tutto attivo per una chiave che deve vedere ogni cosa. Ciò che disattivi viene rifiutato per questa chiave, non semplicemente omesso dalla risposta.',
'settings.apiScopes.all': 'Tutto',
'settings.apiScopes.limited': '{count} di {total}',
'settings.apiScopes.trips': 'Viaggi',
'settings.apiScopes.days': 'Giorni',
'settings.apiScopes.places': 'Luoghi',
'settings.apiScopes.notes': 'Note del giorno',
'settings.apiScopes.reservations': 'Prenotazioni',
'settings.apiScopes.accommodations': 'Alloggio',
'settings.apiScopes.travellers': 'Chi partecipa',
'settings.apiScopes.bucket-list': 'Lista dei desideri',
'settings.apiScopes.stats': 'Totali',
'settings.apiKeys.title': 'Chiavi API',
'settings.apiKeys.description': 'Chiavi per l\'API pubblica, così altri software possono leggere i tuoi viaggi. Sola lettura: una chiave non può modificare né eliminare nulla.',
'settings.apiKeys.create': 'Crea chiave',
+15
View File
@@ -523,6 +523,21 @@ const settings: TranslationStrings = {
'フライトや電車などすべての予約のルートを、個別にオンにしなくても地図上に自動的に表示します。',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'このキーが読み取れる範囲',
'settings.apiScopes.hint':
'すべて読み取らせたいキーは、全部オンのままにしてください。オフにした項目は、応答から省かれるのではなく、このキーには拒否されます。',
'settings.apiScopes.all': 'すべて',
'settings.apiScopes.limited': '{total}件中{count}件',
'settings.apiScopes.trips': '旅行',
'settings.apiScopes.days': '日程',
'settings.apiScopes.places': '場所',
'settings.apiScopes.notes': '日ごとのメモ',
'settings.apiScopes.reservations': '予約',
'settings.apiScopes.accommodations': '宿泊',
'settings.apiScopes.travellers': '同行者',
'settings.apiScopes.bucket-list': 'ウィッシュリスト',
'settings.apiScopes.stats': '合計',
'settings.apiKeys.title': 'API キー',
'settings.apiKeys.description': '公開 API 用のキーです。ほかのソフトウェアが旅程を読み取れるようになります。読み取り専用で、変更や削除はできません。',
'settings.apiKeys.create': 'キーを作成',
+15
View File
@@ -540,6 +540,21 @@ const settings: TranslationStrings = {
'항공편, 기차 등 모든 예약의 경로를 개별적으로 켤 필요 없이 지도에 자동으로 표시합니다.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': '이 키가 읽을 수 있는 항목',
'settings.apiScopes.hint':
'모든 것을 볼 수 있어야 하는 키라면 전부 켜 두세요. 끈 항목은 이 키에 대해 응답에서 빠지는 정도가 아니라 아예 거부됩니다.',
'settings.apiScopes.all': '전체',
'settings.apiScopes.limited': '{total}개 중 {count}개',
'settings.apiScopes.trips': '여행',
'settings.apiScopes.days': '일자',
'settings.apiScopes.places': '장소',
'settings.apiScopes.notes': '일자 메모',
'settings.apiScopes.reservations': '예약',
'settings.apiScopes.accommodations': '숙소',
'settings.apiScopes.travellers': '동행자',
'settings.apiScopes.bucket-list': '위시리스트',
'settings.apiScopes.stats': '합계',
'settings.apiKeys.title': 'API 키',
'settings.apiKeys.description': '공개 API용 키입니다. 다른 소프트웨어가 여행을 읽을 수 있습니다. 읽기 전용이라 무엇도 바꾸거나 지울 수 없습니다.',
'settings.apiKeys.create': '키 만들기',
+15
View File
@@ -553,6 +553,21 @@ const settings: TranslationStrings = {
'Toont automatisch de route van elke vlucht, trein en andere boeking op de kaart, zonder dat u dit per boeking hoeft in te schakelen.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Wat deze sleutel mag lezen',
'settings.apiScopes.hint':
'Laat alles aan staan voor een sleutel die alles mag zien. Alles wat je uitzet, wordt voor deze sleutel geweigerd en niet alleen uit het antwoord weggelaten.',
'settings.apiScopes.all': 'Alles',
'settings.apiScopes.limited': '{count} van {total}',
'settings.apiScopes.trips': 'Reizen',
'settings.apiScopes.days': 'Dagen',
'settings.apiScopes.places': 'Plaatsen',
'settings.apiScopes.notes': 'Dagnotities',
'settings.apiScopes.reservations': 'Boekingen',
'settings.apiScopes.accommodations': 'Accommodatie',
'settings.apiScopes.travellers': 'Wie er meegaan',
'settings.apiScopes.bucket-list': 'Wensenlijst',
'settings.apiScopes.stats': 'Totalen',
'settings.apiKeys.title': 'API-sleutels',
'settings.apiKeys.description': 'Sleutels voor de publieke API, zodat andere software je reizen kan lezen. Alleen-lezen: een sleutel kan niets wijzigen of verwijderen.',
'settings.apiKeys.create': 'Sleutel aanmaken',
+15
View File
@@ -552,6 +552,21 @@ const settings: TranslationStrings = {
'Automatycznie pokazuje na mapie trasę każdego lotu, pociągu i innej rezerwacji, bez konieczności włączania jej pojedynczo.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Co ten klucz może odczytywać',
'settings.apiScopes.hint':
'Zostaw wszystko włączone dla klucza, który ma widzieć całość. Wszystko, co wyłączysz, jest dla tego klucza odrzucane, a nie tylko pomijane w odpowiedzi.',
'settings.apiScopes.all': 'Wszystko',
'settings.apiScopes.limited': '{count} z {total}',
'settings.apiScopes.trips': 'Podróże',
'settings.apiScopes.days': 'Dni',
'settings.apiScopes.places': 'Miejsca',
'settings.apiScopes.notes': 'Notatki dnia',
'settings.apiScopes.reservations': 'Rezerwacje',
'settings.apiScopes.accommodations': 'Noclegi',
'settings.apiScopes.travellers': 'Kto jedzie',
'settings.apiScopes.bucket-list': 'Lista marzeń',
'settings.apiScopes.stats': 'Podsumowania',
'settings.apiKeys.title': 'Klucze API',
'settings.apiKeys.description': 'Klucze do publicznego API, aby inne oprogramowanie mogło odczytywać Twoje podróże. Tylko odczyt: klucz niczego nie zmieni ani nie usunie.',
'settings.apiKeys.create': 'Utwórz klucz',
+15
View File
@@ -554,6 +554,21 @@ const settings: TranslationStrings = {
'Автоматически показывает на карте маршрут для каждого рейса, поезда и другого бронирования — без необходимости включать это отдельно для каждого элемента.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Что этот ключ может читать',
'settings.apiScopes.hint':
'Оставьте всё включённым для ключа, который должен видеть всё. Всё, что вы выключите, для этого ключа будет запрещено, а не просто опущено в ответе.',
'settings.apiScopes.all': 'Всё',
'settings.apiScopes.limited': '{count} из {total}',
'settings.apiScopes.trips': 'Поездки',
'settings.apiScopes.days': 'Дни',
'settings.apiScopes.places': 'Места',
'settings.apiScopes.notes': 'Заметки дня',
'settings.apiScopes.reservations': 'Бронирования',
'settings.apiScopes.accommodations': 'Проживание',
'settings.apiScopes.travellers': 'Кто едет',
'settings.apiScopes.bucket-list': 'Список желаний',
'settings.apiScopes.stats': 'Итоги',
'settings.apiKeys.title': 'Ключи API',
'settings.apiKeys.description': 'Ключи для публичного API, чтобы другие программы могли читать ваши поездки. Только чтение: ключ ничего не изменит и не удалит.',
'settings.apiKeys.create': 'Создать ключ',
+15
View File
@@ -549,6 +549,21 @@ const settings: TranslationStrings = {
'Visar automatiskt rutten för varje flyg, tåg och annan bokning på kartan, utan att du behöver aktivera det för varje bokning för sig.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Vad den här nyckeln får läsa',
'settings.apiScopes.hint':
'Lämna allt påslaget för en nyckel som ska se allt. Det du stänger av nekas för den här nyckeln, det utelämnas inte bara ur svaret.',
'settings.apiScopes.all': 'Allt',
'settings.apiScopes.limited': '{count} av {total}',
'settings.apiScopes.trips': 'Resor',
'settings.apiScopes.days': 'Dagar',
'settings.apiScopes.places': 'Platser',
'settings.apiScopes.notes': 'Dagsanteckningar',
'settings.apiScopes.reservations': 'Bokningar',
'settings.apiScopes.accommodations': 'Boende',
'settings.apiScopes.travellers': 'Vilka som följer med',
'settings.apiScopes.bucket-list': 'Önskelista',
'settings.apiScopes.stats': 'Totalsummor',
'settings.apiKeys.title': 'API-nycklar',
'settings.apiKeys.description': 'Nycklar för det publika API:et, så att annan programvara kan läsa dina resor. Endast läsning: en nyckel kan inte ändra eller ta bort något.',
'settings.apiKeys.create': 'Skapa nyckel',
+15
View File
@@ -550,6 +550,21 @@ const settings: TranslationStrings = {
'Haritada her uçuş, tren ve diğer rezervasyonun rotasını, tek tek açmaya gerek kalmadan otomatik olarak gösterir.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Bu anahtar neleri okuyabilir',
'settings.apiScopes.hint':
'Her şeyi görmesi gereken bir anahtar için hepsini açık bırakın. Kapattığınız her şey bu anahtar için reddedilir, yalnızca yanıttan çıkarılmakla kalmaz.',
'settings.apiScopes.all': 'Her şey',
'settings.apiScopes.limited': '{total} içinden {count}',
'settings.apiScopes.trips': 'Geziler',
'settings.apiScopes.days': 'Günler',
'settings.apiScopes.places': 'Yerler',
'settings.apiScopes.notes': 'Gün notları',
'settings.apiScopes.reservations': 'Rezervasyonlar',
'settings.apiScopes.accommodations': 'Konaklama',
'settings.apiScopes.travellers': 'Kimler geliyor',
'settings.apiScopes.bucket-list': 'Dilek listesi',
'settings.apiScopes.stats': 'Toplamlar',
'settings.apiKeys.title': 'API Anahtarları',
'settings.apiKeys.description': 'Genel API için anahtarlar, böylece başka yazılımlar gezilerini okuyabilir. Yalnızca okuma: bir anahtar hiçbir şeyi değiştiremez veya silemez.',
'settings.apiKeys.create': 'Anahtar oluştur',
+15
View File
@@ -553,6 +553,21 @@ const settings: TranslationStrings = {
'Автоматично показує на карті маршрут для кожного рейсу, поїзда та іншого бронювання — без потреби вмикати це окремо для кожного елемента.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Що цей ключ може читати',
'settings.apiScopes.hint':
'Залиште все увімкненим для ключа, який має бачити геть усе. Усе, що ви вимкнете, для цього ключа буде заборонено, а не просто пропущено у відповіді.',
'settings.apiScopes.all': 'Усе',
'settings.apiScopes.limited': '{count} з {total}',
'settings.apiScopes.trips': 'Подорожі',
'settings.apiScopes.days': 'Дні',
'settings.apiScopes.places': 'Місця',
'settings.apiScopes.notes': 'Нотатки дня',
'settings.apiScopes.reservations': 'Бронювання',
'settings.apiScopes.accommodations': 'Проживання',
'settings.apiScopes.travellers': 'Хто їде',
'settings.apiScopes.bucket-list': 'Список бажань',
'settings.apiScopes.stats': 'Підсумки',
'settings.apiKeys.title': 'Ключі API',
'settings.apiKeys.description': 'Ключі для публічного API, щоб інші програми могли читати ваші подорожі. Лише читання: ключ нічого не змінить і не видалить.',
'settings.apiKeys.create': 'Створити ключ',
+15
View File
@@ -554,6 +554,21 @@ const settings: TranslationStrings = {
'Tự động hiển thị trên bản đồ tuyến đường của mỗi chuyến bay, tàu hỏa và đặt chỗ khác, không cần bật riêng từng mục.',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': 'Khóa này được phép đọc gì',
'settings.apiScopes.hint':
'Hãy bật tất cả cho khóa cần xem được mọi thứ. Bất cứ mục nào bạn tắt sẽ bị từ chối với khóa này, chứ không chỉ là bị lược khỏi câu trả lời.',
'settings.apiScopes.all': 'Tất cả',
'settings.apiScopes.limited': '{count} trên {total}',
'settings.apiScopes.trips': 'Chuyến đi',
'settings.apiScopes.days': 'Ngày',
'settings.apiScopes.places': 'Địa điểm',
'settings.apiScopes.notes': 'Ghi chú theo ngày',
'settings.apiScopes.reservations': 'Đặt chỗ',
'settings.apiScopes.accommodations': 'Chỗ ở',
'settings.apiScopes.travellers': 'Ai cùng đi',
'settings.apiScopes.bucket-list': 'Danh sách mong muốn',
'settings.apiScopes.stats': 'Tổng hợp',
'settings.apiKeys.title': 'Khóa API',
'settings.apiKeys.description': 'Khóa cho API công khai, để phần mềm khác có thể đọc các chuyến đi của bạn. Chỉ đọc: khóa không thể thay đổi hay xóa bất cứ thứ gì.',
'settings.apiKeys.create': 'Tạo khóa',
+15
View File
@@ -517,6 +517,21 @@ const settings: TranslationStrings = {
'settings.alwaysShowRoutesHint': '自動在地圖上顯示每個航班、火車及其他預訂的路線,不需要逐一手動開啟。',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': '這組金鑰可讀取的內容',
'settings.apiScopes.hint':
'若希望這組金鑰能看到全部內容,就全部保持開啟。任何你關閉的項目都會對這組金鑰直接拒絕,而不只是從回應中省略。',
'settings.apiScopes.all': '全部',
'settings.apiScopes.limited': '{total} 項中的 {count} 項',
'settings.apiScopes.trips': '旅行',
'settings.apiScopes.days': '日期',
'settings.apiScopes.places': '地點',
'settings.apiScopes.notes': '每日備註',
'settings.apiScopes.reservations': '訂位',
'settings.apiScopes.accommodations': '住宿',
'settings.apiScopes.travellers': '同行者',
'settings.apiScopes.bucket-list': '願望清單',
'settings.apiScopes.stats': '總計',
'settings.apiKeys.title': 'API 金鑰',
'settings.apiKeys.description': '公開 API 的金鑰,讓其他軟體讀取你的行程。唯讀:金鑰無法修改或刪除任何內容。',
'settings.apiKeys.create': '建立金鑰',
+15
View File
@@ -513,6 +513,21 @@ const settings: TranslationStrings = {
'settings.alwaysShowRoutesHint': '自动在地图上显示每个航班、火车和其他预订的路线,无需逐个手动开启。',
// Public API keys (Settings -> Integrations)
// ── API keys: what a key may read ─────────────────────────────────────────
'settings.apiScopes.title': '此密钥可读取的内容',
'settings.apiScopes.hint':
'如果希望这个密钥看到全部内容,就保持全部开启。任何被关闭的内容对该密钥都会被拒绝,而不只是不出现在结果里。',
'settings.apiScopes.all': '全部',
'settings.apiScopes.limited': '{total} 项中的 {count} 项',
'settings.apiScopes.trips': '行程',
'settings.apiScopes.days': '日程',
'settings.apiScopes.places': '地点',
'settings.apiScopes.notes': '每日备注',
'settings.apiScopes.reservations': '预订',
'settings.apiScopes.accommodations': '住宿',
'settings.apiScopes.travellers': '同行人员',
'settings.apiScopes.bucket-list': '愿望清单',
'settings.apiScopes.stats': '统计总计',
'settings.apiKeys.title': 'API 密钥',
'settings.apiKeys.description': '公开 API 的密钥,让其他软件读取你的行程。只读:密钥无法修改或删除任何内容。',
'settings.apiKeys.create': '创建密钥',
@@ -206,6 +206,82 @@ export const publicApiTripListSchema = z.object({
});
export type PublicApiTripList = z.infer<typeof publicApiTripListSchema>;
/**
* What an integration key is allowed to read.
*
* These are **not** `include`. `include` picks which sections a response
* carries and any caller may ask for any of them; these decide what the key may
* see at all, and the server refuses the rest. The two were confused often
* enough that it is worth saying plainly: handing an integration a key because
* it wanted day notes used to hand it every trip in full.
*
* The sections mirror the `include` vocabulary so an integrator does not have
* to learn two lists, plus the two endpoints that are not a trip section:
* `bucket-list` (hangs off the user) and `stats` (aggregates everything, which
* is exactly why a narrow key must be able to exclude it).
*/
export const PUBLIC_API_SCOPES = [
'trips',
'days',
'places',
'notes',
'reservations',
'accommodations',
'travellers',
'bucket-list',
'stats',
] as const;
export type PublicApiScope = (typeof PUBLIC_API_SCOPES)[number];
/**
* How a key's access is decided.
*
* `all` is an explicit value rather than an absent list, because "no list means
* everything" is the kind of sentinel where a bug that drops the column grants
* full access instead of none. Every key minted before scopes existed is `all`,
* which is exactly what it was and still is.
*/
export const PUBLIC_API_SCOPE_MODES = ['all', 'limited'] as const;
export const publicApiScopeModeSchema = z.enum(PUBLIC_API_SCOPE_MODES);
export type PublicApiScopeMode = z.infer<typeof publicApiScopeModeSchema>;
/**
* What a key may read, resolved.
*
* `mode: 'all'` carries the full list rather than an empty one, so a consumer
* never has to reimplement "empty means everything" — the rule this type exists
* to get rid of.
*/
export const publicApiGrantSchema = z.object({
mode: publicApiScopeModeSchema,
scopes: z.array(z.enum(PUBLIC_API_SCOPES)),
});
export type PublicApiGrant = z.infer<typeof publicApiGrantSchema>;
/**
* Minting an integration key. A key created without `scopes` reads everything,
* which is what every key did before this existed — narrowing is opt-in, so no
* integration breaks the day the column ships.
*/
export const apiTokenCreateRequestSchema = z.object({
name: z.string().optional(),
scopes: z.array(z.enum(PUBLIC_API_SCOPES)).min(1).optional(),
});
export type ApiTokenCreateRequest = z.infer<typeof apiTokenCreateRequestSchema>;
/** A key as the settings list shows it. The key itself is never in here. */
export const apiTokenSummarySchema = z.object({
id: z.number(),
name: z.string(),
token_prefix: z.string(),
created_at: z.string(),
last_used_at: z.string().nullable(),
scope_mode: publicApiScopeModeSchema,
/** The chosen sections; the full list when the mode is `all`. */
scopes: z.array(z.enum(PUBLIC_API_SCOPES)),
});
export type ApiTokenSummary = z.infer<typeof apiTokenSummarySchema>;
/**
* The trip the traveller most recently took, for a dashboard that wants to name it.
*