Fix
This commit is contained in:
1 parent
7ab7acd533
commit
176b1fe47f
18 files changed
+422
-30
No files matched your search
@@ -65,3 +65,6 @@ apps/web/static/.audit/
|
|||||||
# codehelper (generated local — do not commit)
|
# codehelper (generated local — do not commit)
|
||||||
.zed/
|
.zed/
|
||||||
matej.md
|
matej.md
|
||||||
|
# Source snapshot from npm run zip
|
||||||
|
/descrybe.zip
|
||||||
|
/descrybe.zip.tmp
|
||||||
@@ -6,11 +6,65 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/descrybe/descrybe-v2/apps/api/internal/auth"
|
"github.com/descrybe/descrybe-v2/apps/api/internal/auth"
|
||||||
|
"github.com/descrybe/descrybe-v2/apps/api/internal/billing"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// allowAPIKeyManager authorizes API-key management using the SAME per-member
|
||||||
|
// settings.api_keys permission as the dashboard and RequireMemberFeature.
|
||||||
|
// Members with the area disabled cannot create, rename or revoke keys. Company
|
||||||
|
// admins, owners and platform admins keep their existing privileges.
|
||||||
|
// This check is deliberately repeated at the handler: direct calls must not
|
||||||
|
// bypass the router's member-permission middleware.
|
||||||
|
func (s *Server) allowAPIKeyManager(w http.ResponseWriter, r *http.Request) bool {
|
||||||
|
if CompanyAdminAllowed(r.Context()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
uid, okUser := UserIDFromContext(r.Context())
|
||||||
|
cid, okCompany := CompanyIDFromContext(r.Context())
|
||||||
|
if !okUser || !okCompany {
|
||||||
|
Error(w, http.StatusUnauthorized, "unauthorized")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
isPlatformAdmin, err := s.checkPlatformAdmin(r.Context(), uid)
|
||||||
|
if err != nil {
|
||||||
|
Error(w, http.StatusInternalServerError, "authorization check failed")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if isPlatformAdmin {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
isOwner, err := s.checkCompanyOwner(r.Context(), uid)
|
||||||
|
if err != nil {
|
||||||
|
Error(w, http.StatusInternalServerError, "authorization check failed")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if isOwner {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Ordinary members need both the company's API entitlement and their
|
||||||
|
// effective per-member grant. A permissions lookup error fails closed.
|
||||||
|
if s.Billing == nil {
|
||||||
|
Error(w, http.StatusForbidden, "API keys permission required")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !s.requireFeatures(w, r, "settings.api_keys", "capability.api_access") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
perms, err := s.Billing.MemberPermissions(r.Context(), cid, uid)
|
||||||
|
if err != nil {
|
||||||
|
Error(w, http.StatusServiceUnavailable, "permissions temporarily unavailable")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if billing.MemberDeniesFeature(perms, "settings.api_keys") {
|
||||||
|
Error(w, http.StatusForbidden, "API keys permission required")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
|
||||||
cid, _ := CompanyIDFromContext(r.Context())
|
cid, _ := CompanyIDFromContext(r.Context())
|
||||||
limit, offset := ParseLimitOffset(r)
|
limit, offset := ParseLimitOffset(r)
|
||||||
@@ -49,7 +103,7 @@ func (s *Server) handleListAPIKeys(w http.ResponseWriter, r *http.Request) {
|
|||||||
func (s *Server) handleCreateAPIKey(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handleCreateAPIKey(w http.ResponseWriter, r *http.Request) {
|
||||||
cid, _ := CompanyIDFromContext(r.Context())
|
cid, _ := CompanyIDFromContext(r.Context())
|
||||||
uid, _ := UserIDFromContext(r.Context())
|
uid, _ := UserIDFromContext(r.Context())
|
||||||
if !s.allowCompanyAdminOrPlatform(w, r) {
|
if !s.allowAPIKeyManager(w, r) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !s.requireFeatures(w, r, "settings.api_keys", "capability.api_access") {
|
if !s.requireFeatures(w, r, "settings.api_keys", "capability.api_access") {
|
||||||
@@ -85,7 +139,7 @@ func (s *Server) handleCreateAPIKey(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func (s *Server) handleUpdateAPIKey(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handleUpdateAPIKey(w http.ResponseWriter, r *http.Request) {
|
||||||
cid, _ := CompanyIDFromContext(r.Context())
|
cid, _ := CompanyIDFromContext(r.Context())
|
||||||
if !s.allowCompanyAdminOrPlatform(w, r) {
|
if !s.allowAPIKeyManager(w, r) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !s.requireFeatures(w, r, "settings.api_keys", "capability.api_access") {
|
if !s.requireFeatures(w, r, "settings.api_keys", "capability.api_access") {
|
||||||
@@ -140,7 +194,7 @@ func (s *Server) handleUpdateAPIKey(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func (s *Server) handleRevokeAPIKey(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handleRevokeAPIKey(w http.ResponseWriter, r *http.Request) {
|
||||||
cid, _ := CompanyIDFromContext(r.Context())
|
cid, _ := CompanyIDFromContext(r.Context())
|
||||||
if !s.allowCompanyAdminOrPlatform(w, r) {
|
if !s.allowAPIKeyManager(w, r) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
id, err := uuid.Parse(chi.URLParam(r, "id"))
|
id, err := uuid.Parse(chi.URLParam(r, "id"))
|
||||||
|
|||||||
@@ -55,3 +55,44 @@ func TestHandleUpdateAPIKeyRejectsInvalidID(t *testing.T) {
|
|||||||
t.Fatalf("status = %d body=%s, want 400", rec.Code, rec.Body.String())
|
t.Fatalf("status = %d body=%s, want 400", rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API-key management is separate from company-admin / team / billing privileges.
|
||||||
|
// Explicit permission checks are also enforced for handler calls that do not
|
||||||
|
// pass through the router's RequireMemberFeature middleware.
|
||||||
|
func TestAllowAPIKeyManagerPrivilegesAndMissingGrant(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
uid := uuid.MustParse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
|
||||||
|
cid := uuid.MustParse("11111111-1111-1111-1111-111111111111")
|
||||||
|
cases := []struct {
|
||||||
|
name string
|
||||||
|
role string
|
||||||
|
platform bool
|
||||||
|
owner bool
|
||||||
|
want int
|
||||||
|
}{
|
||||||
|
{name: "company admin", role: "admin", want: http.StatusOK},
|
||||||
|
{name: "platform admin", role: "member", platform: true, want: http.StatusOK},
|
||||||
|
{name: "company owner", role: "member", owner: true, want: http.StatusOK},
|
||||||
|
{name: "ordinary member without loaded permissions", role: "member", want: http.StatusForbidden},
|
||||||
|
}
|
||||||
|
for _, tc := range cases {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
s := &Server{
|
||||||
|
testPlatformAdmin: func(context.Context, uuid.UUID) (bool, error) { return tc.platform, nil },
|
||||||
|
testCompanyOwner: func(context.Context, uuid.UUID) (bool, error) { return tc.owner, nil },
|
||||||
|
}
|
||||||
|
ctx := context.WithValue(context.Background(), ctxUserID, uid)
|
||||||
|
ctx = context.WithValue(ctx, ctxCompanyID, cid)
|
||||||
|
ctx = context.WithValue(ctx, ctxRole, tc.role)
|
||||||
|
req := httptest.NewRequest(http.MethodPost, "/api/api-keys", nil).WithContext(ctx)
|
||||||
|
rec := httptest.NewRecorder()
|
||||||
|
allowed := s.allowAPIKeyManager(rec, req)
|
||||||
|
if allowed != (tc.want == http.StatusOK) {
|
||||||
|
t.Fatalf("allowAPIKeyManager allowed=%v status=%d", allowed, rec.Code)
|
||||||
|
}
|
||||||
|
if !allowed && rec.Code != tc.want {
|
||||||
|
t.Fatalf("status=%d body=%s, want %d", rec.Code, rec.Body.String(), tc.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -270,6 +270,76 @@ func TestAuthSessionCoreEndpoints(t *testing.T) {
|
|||||||
t.Fatalf("revoke api-key status=%d body=%s", rec.Code, rec.Body.String())
|
t.Fatalf("revoke api-key status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A normal teammate with an explicit API Keys area grant may manage keys,
|
||||||
|
// without being made a company administrator. Denying the area closes both
|
||||||
|
// the list endpoint and the create/rename/revoke endpoints.
|
||||||
|
_, err = pg.Exec(ctx, `
|
||||||
|
UPDATE memberships SET role = 'member', permissions = '{"settings.api_keys":false}'::jsonb
|
||||||
|
WHERE company_id = $1 AND user_id = $2`, companyID, userID)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("restrict api-key member: %v", err)
|
||||||
|
}
|
||||||
|
rec = do(http.MethodGet, "/api/api-keys", "", false)
|
||||||
|
if rec.Code != http.StatusForbidden {
|
||||||
|
t.Fatalf("member denied api-keys list status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
rec = do(http.MethodPost, "/api/api-keys", `{"name":"blocked"}`, true)
|
||||||
|
if rec.Code != http.StatusForbidden {
|
||||||
|
t.Fatalf("member denied api-key create status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
_, err = pg.Exec(ctx, `
|
||||||
|
UPDATE memberships SET permissions = '{}'::jsonb
|
||||||
|
WHERE company_id = $1 AND user_id = $2`, companyID, userID)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("allow api-key member: %v", err)
|
||||||
|
}
|
||||||
|
rec = do(http.MethodPost, "/api/api-keys", `{"name":"member-key"}`, true)
|
||||||
|
if rec.Code != http.StatusCreated {
|
||||||
|
t.Fatalf("member create api-key status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
memberKey := decode(t, rec)
|
||||||
|
memberKeyID := fmt.Sprint(memberKey["id"])
|
||||||
|
if !strings.HasPrefix(fmt.Sprint(memberKey["key"]), "dk_") {
|
||||||
|
t.Fatalf("member create did not return one-time secret: %v", memberKey)
|
||||||
|
}
|
||||||
|
rec = do(http.MethodGet, "/api/api-keys", "", false)
|
||||||
|
if rec.Code != http.StatusOK {
|
||||||
|
t.Fatalf("member list api-keys status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
if strings.Contains(rec.Body.String(), fmt.Sprint(memberKey["key"])) {
|
||||||
|
t.Fatal("list endpoint must never expose full API secrets")
|
||||||
|
}
|
||||||
|
rec = do(http.MethodPatch, "/api/api-keys/"+memberKeyID, `{"name":"member-renamed"}`, true)
|
||||||
|
if rec.Code != http.StatusOK || fmt.Sprint(decode(t, rec)["name"]) != "member-renamed" {
|
||||||
|
t.Fatalf("member rename api-key status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
// Revoking the member's API Keys area closes modification of keys they
|
||||||
|
// previously created, without affecting unrelated team permissions.
|
||||||
|
_, err = pg.Exec(ctx, `
|
||||||
|
UPDATE memberships SET permissions = '{"settings.api_keys":false}'::jsonb
|
||||||
|
WHERE company_id = $1 AND user_id = $2`, companyID, userID)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("remove api-key access: %v", err)
|
||||||
|
}
|
||||||
|
rec = do(http.MethodPatch, "/api/api-keys/"+memberKeyID, `{"name":"should-not-rename"}`, true)
|
||||||
|
if rec.Code != http.StatusForbidden {
|
||||||
|
t.Fatalf("member denied api-key rename status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
rec = do(http.MethodDelete, "/api/api-keys/"+memberKeyID, "", true)
|
||||||
|
if rec.Code != http.StatusForbidden {
|
||||||
|
t.Fatalf("member denied api-key revoke status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
_, err = pg.Exec(ctx, `
|
||||||
|
UPDATE memberships SET permissions = '{}'::jsonb
|
||||||
|
WHERE company_id = $1 AND user_id = $2`, companyID, userID)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("restore api-key access: %v", err)
|
||||||
|
}
|
||||||
|
rec = do(http.MethodDelete, "/api/api-keys/"+memberKeyID, "", true)
|
||||||
|
if rec.Code != http.StatusOK {
|
||||||
|
t.Fatalf("member revoke api-key status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
}
|
||||||
|
|
||||||
rec = do(http.MethodPost, "/api/auth/logout", `{}`, true)
|
rec = do(http.MethodPost, "/api/auth/logout", `{}`, true)
|
||||||
if rec.Code != http.StatusOK {
|
if rec.Code != http.StatusOK {
|
||||||
t.Fatalf("logout status=%d body=%s", rec.Code, rec.Body.String())
|
t.Fatalf("logout status=%d body=%s", rec.Code, rec.Body.String())
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { describe, it } from "node:test";
|
||||||
|
import { canManageApiKeys } from "./api-key-permissions.ts";
|
||||||
|
|
||||||
|
describe("API key management permissions", () => {
|
||||||
|
it("allows a non-admin with both API Keys and API access", () => {
|
||||||
|
assert.equal(canManageApiKeys(false, true, true), true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects a non-admin without the API Keys permission", () => {
|
||||||
|
assert.equal(canManageApiKeys(false, false, true), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects a non-admin without the company API entitlement", () => {
|
||||||
|
assert.equal(canManageApiKeys(false, true, false), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps preexisting company-admin UI access", () => {
|
||||||
|
assert.equal(canManageApiKeys(true, false, false), true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/** API keys are manageable by company admins or members granted both the
|
||||||
|
* API Keys area and the company's API entitlement. Company admins retain the
|
||||||
|
* preexisting UI access (server checks the plan when mutating keys). */
|
||||||
|
export function canManageApiKeys(
|
||||||
|
companyAdmin: boolean,
|
||||||
|
apiKeysAreaAllowed: boolean,
|
||||||
|
apiAccessAllowed: boolean
|
||||||
|
): boolean {
|
||||||
|
return companyAdmin || (apiKeysAreaAllowed && apiAccessAllowed);
|
||||||
|
}
|
||||||
@@ -2077,12 +2077,12 @@ export const de: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "E-Mail-Alert-Einstellungen kommen bald. Fehlerbenachrichtigungen standardmäßig an (wie in-app); Abschluss-Mails bleiben aus, außer Sie aktivieren sie.",
|
"settings.emailAlertsHelp": "E-Mail-Alert-Einstellungen kommen bald. Fehlerbenachrichtigungen standardmäßig an (wie in-app); Abschluss-Mails bleiben aus, außer Sie aktivieren sie.",
|
||||||
"settings.emailAlertsBody": "Konfigurieren Sie Transaktionsmail vorerst unter Unternehmen → E-Mail-Integration. In-App-Alerts oben gelten weiter.",
|
"settings.emailAlertsBody": "Konfigurieren Sie Transaktionsmail vorerst unter Unternehmen → E-Mail-Integration. In-App-Alerts oben gelten weiter.",
|
||||||
"settings.apiKeysLegacyNotice": "Legacy-API-Schlüssel wurden nicht migriert. Neuen Schlüssel erstellen  das Geheimnis wird nur einmal angezeigt.",
|
"settings.apiKeysLegacyNotice": "Legacy-API-Schlüssel wurden nicht migriert. Neuen Schlüssel erstellen  das Geheimnis wird nur einmal angezeigt.",
|
||||||
"settings.apiKeysAdminOnly": "Nur Unternehmens-Admins können API-Schlüssel erstellen oder widerrufen. Vorhandene Präfixe können Sie anzeigen.",
|
"settings.apiKeysAdminOnly": "Zum Verwalten von API-Schlüsseln fehlt dir die Berechtigung. Bitte den Firmeninhaber, API-Schlüssel in deinen Berechtigungen zu aktivieren.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Kopieren für vorhandene Schlüssel nicht verfügbar  nur Präfix gespeichert. Neuen Schlüssel erstellen, Geheimnis einmal kopieren, alten bei Bedarf widerrufen.",
|
"settings.apiKeysCopyUnavailableNotice": "Kopieren für vorhandene Schlüssel nicht verfügbar  nur Präfix gespeichert. Neuen Schlüssel erstellen, Geheimnis einmal kopieren, alten bei Bedarf widerrufen.",
|
||||||
"settings.apiKeysForbidden": "Sie dürfen API-Schlüssel nicht anzeigen. Bitten Sie einen Unternehmens-Admin um Hilfe.",
|
"settings.apiKeysForbidden": "Sie dürfen API-Schlüssel nicht anzeigen. Bitten Sie einen Unternehmens-Admin um Hilfe.",
|
||||||
"settings.noApiKeys": "Noch keine API-Schlüssel",
|
"settings.noApiKeys": "Noch keine API-Schlüssel",
|
||||||
"settings.noApiKeysHelpAdmin": "Legacy-API-Schlüssel wurden nicht migriert. Neuen Schlüssel für Descrybe-API (X-API-Key) erstellen. Vollständiges Geheimnis nur einmal sichtbar.",
|
"settings.noApiKeysHelpAdmin": "Legacy-API-Schlüssel wurden nicht migriert. Neuen Schlüssel für Descrybe-API (X-API-Key) erstellen. Vollständiges Geheimnis nur einmal sichtbar.",
|
||||||
"settings.noApiKeysHelpMember": "Noch keine API-Schlüssel für dieses Unternehmen. Legacy-Schlüssel nicht migriert  Admin um Erstellung bitten.",
|
"settings.noApiKeysHelpMember": "Für dieses Unternehmen gibt es noch keine API-Schlüssel. Bitte den Firmeninhaber, API-Schlüssel in deinen Berechtigungen zu aktivieren.",
|
||||||
"settings.unnamedKey": "Unbenannter Schlüssel",
|
"settings.unnamedKey": "Unbenannter Schlüssel",
|
||||||
"settings.neverUsed": "Nie verwendet",
|
"settings.neverUsed": "Nie verwendet",
|
||||||
"settings.apiKeyActions": "API-Schlüssel-Aktionen",
|
"settings.apiKeyActions": "API-Schlüssel-Aktionen",
|
||||||
|
|||||||
@@ -2487,7 +2487,7 @@ export const en: MessageDict = {
|
|||||||
"settings.apiKeysLegacyNotice":
|
"settings.apiKeysLegacyNotice":
|
||||||
"Legacy API keys were not migrated. Create a new key to restore API access. The secret is shown only once.",
|
"Legacy API keys were not migrated. Create a new key to restore API access. The secret is shown only once.",
|
||||||
"settings.apiKeysAdminOnly":
|
"settings.apiKeysAdminOnly":
|
||||||
"Only company admins can create, rename, or revoke API keys. You can view existing key prefixes.",
|
"Your teammate permissions do not allow managing API keys. Ask the company owner to enable API Keys in your permissions.",
|
||||||
"settings.apiKeysCopyUnavailableNotice":
|
"settings.apiKeysCopyUnavailableNotice":
|
||||||
"After you create a key, copy the full secret immediately (or from the row menu while this page stays open). Existing keys only store a prefix, so create a new key if you lost the secret.",
|
"After you create a key, copy the full secret immediately (or from the row menu while this page stays open). Existing keys only store a prefix, so create a new key if you lost the secret.",
|
||||||
"settings.apiKeysForbidden":
|
"settings.apiKeysForbidden":
|
||||||
@@ -2496,7 +2496,7 @@ export const en: MessageDict = {
|
|||||||
"settings.noApiKeysHelpAdmin":
|
"settings.noApiKeysHelpAdmin":
|
||||||
"Legacy API keys were not migrated. Create a new key to authenticate Descrybe API requests (X-API-Key). The full secret is shown only once.",
|
"Legacy API keys were not migrated. Create a new key to authenticate Descrybe API requests (X-API-Key). The full secret is shown only once.",
|
||||||
"settings.noApiKeysHelpMember":
|
"settings.noApiKeysHelpMember":
|
||||||
"No API keys for this company yet. Legacy keys were not migrated. Ask a company admin to create one.",
|
"No API keys for this company yet. Ask the company owner to enable API Keys in your permissions.",
|
||||||
"settings.unnamedKey": "Unnamed Key",
|
"settings.unnamedKey": "Unnamed Key",
|
||||||
"settings.neverUsed": "Never used",
|
"settings.neverUsed": "Never used",
|
||||||
"settings.apiKeyActions": "API key actions",
|
"settings.apiKeyActions": "API key actions",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const es: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "Las preferencias de alertas por correo llegarán pronto. Las alertas de fallo estarán activas por defecto (como en la app); los correos de finalización permanecerán desactivados salvo que te suscribas.",
|
"settings.emailAlertsHelp": "Las preferencias de alertas por correo llegarán pronto. Las alertas de fallo estarán activas por defecto (como en la app); los correos de finalización permanecerán desactivados salvo que te suscribas.",
|
||||||
"settings.emailAlertsBody": "Por ahora, configura el correo transaccional en Empresa → Integración de correo. Las alertas in-app de arriba siguen aplicando.",
|
"settings.emailAlertsBody": "Por ahora, configura el correo transaccional en Empresa → Integración de correo. Las alertas in-app de arriba siguen aplicando.",
|
||||||
"settings.apiKeysLegacyNotice": "Las claves API antiguas no se migraron. Crea una nueva para restaurar el acceso  el secreto se muestra solo una vez.",
|
"settings.apiKeysLegacyNotice": "Las claves API antiguas no se migraron. Crea una nueva para restaurar el acceso  el secreto se muestra solo una vez.",
|
||||||
"settings.apiKeysAdminOnly": "Solo los administradores pueden crear o revocar claves API. Puedes ver los prefijos existentes.",
|
"settings.apiKeysAdminOnly": "No tienes permiso para gestionar claves API. Pide al propietario de la empresa que habilite Claves API en tus permisos.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Copia no disponible para claves existentes  solo se guarda el prefijo. Crea una nueva para copiar el secreto completo una vez y revoca la antigua si hace falta.",
|
"settings.apiKeysCopyUnavailableNotice": "Copia no disponible para claves existentes  solo se guarda el prefijo. Crea una nueva para copiar el secreto completo una vez y revoca la antigua si hace falta.",
|
||||||
"settings.apiKeysForbidden": "No tienes permiso para ver las claves API. Pide ayuda a un administrador de la empresa.",
|
"settings.apiKeysForbidden": "No tienes permiso para ver las claves API. Pide ayuda a un administrador de la empresa.",
|
||||||
"settings.noApiKeys": "Aún no hay claves API",
|
"settings.noApiKeys": "Aún no hay claves API",
|
||||||
"settings.noApiKeysHelpAdmin": "Las claves API antiguas no se migraron. Crea una nueva para autenticar solicitudes Descrybe (X-API-Key). El secreto completo se muestra solo una vez.",
|
"settings.noApiKeysHelpAdmin": "Las claves API antiguas no se migraron. Crea una nueva para autenticar solicitudes Descrybe (X-API-Key). El secreto completo se muestra solo una vez.",
|
||||||
"settings.noApiKeysHelpMember": "Aún no hay claves API para esta empresa. Las antiguas no se migraron  pide a un administrador que cree una.",
|
"settings.noApiKeysHelpMember": "Aún no hay claves API para esta empresa. Pide al propietario que habilite Claves API en tus permisos.",
|
||||||
"settings.unnamedKey": "Clave sin nombre",
|
"settings.unnamedKey": "Clave sin nombre",
|
||||||
"settings.neverUsed": "Nunca usado",
|
"settings.neverUsed": "Nunca usado",
|
||||||
"settings.apiKeyActions": "Acciones de clave API",
|
"settings.apiKeyActions": "Acciones de clave API",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const fr: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "Les préférences d’alertes e-mail arrivent bientôt. Les alertes d’échec seront activées par défaut (comme in-app) ; les e-mails d’achèvement resteront off sauf opt-in.",
|
"settings.emailAlertsHelp": "Les préférences d’alertes e-mail arrivent bientôt. Les alertes d’échec seront activées par défaut (comme in-app) ; les e-mails d’achèvement resteront off sauf opt-in.",
|
||||||
"settings.emailAlertsBody": "Pour l’instant, configurez le mail transactionnel sous Entreprise → Intégration e-mail. Les alertes in-app ci-dessus s’appliquent toujours.",
|
"settings.emailAlertsBody": "Pour l’instant, configurez le mail transactionnel sous Entreprise → Intégration e-mail. Les alertes in-app ci-dessus s’appliquent toujours.",
|
||||||
"settings.apiKeysLegacyNotice": "Les clés API héritées n’ont pas été migrées. Créez-en une nouvelle pour restaurer l’accès  le secret n’est affiché qu’une fois.",
|
"settings.apiKeysLegacyNotice": "Les clés API héritées n’ont pas été migrées. Créez-en une nouvelle pour restaurer l’accès  le secret n’est affiché qu’une fois.",
|
||||||
"settings.apiKeysAdminOnly": "Seuls les administrateurs peuvent créer ou révoquer des clés API. Vous pouvez voir les préfixes existants.",
|
"settings.apiKeysAdminOnly": "Vous n’avez pas la permission de gérer les clés API. Demandez au propriétaire de l’entreprise d’activer Clés API dans vos autorisations.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Copie indisponible pour les clés existantes  seul le préfixe est stocké. Créez une nouvelle clé pour copier le secret une fois, puis révoquez l’ancienne si besoin.",
|
"settings.apiKeysCopyUnavailableNotice": "Copie indisponible pour les clés existantes  seul le préfixe est stocké. Créez une nouvelle clé pour copier le secret une fois, puis révoquez l’ancienne si besoin.",
|
||||||
"settings.apiKeysForbidden": "Vous n’avez pas l’autorisation de voir les clés API. Demandez de l’aide àun administrateur.",
|
"settings.apiKeysForbidden": "Vous n’avez pas l’autorisation de voir les clés API. Demandez de l’aide àun administrateur.",
|
||||||
"settings.noApiKeys": "Pas encore de clés API",
|
"settings.noApiKeys": "Pas encore de clés API",
|
||||||
"settings.noApiKeysHelpAdmin": "Les clés API héritées n’ont pas été migrées. Créez-en une pour authentifier les requêtes Descrybe (X-API-Key). Le secret complet n’est affiché qu’une fois.",
|
"settings.noApiKeysHelpAdmin": "Les clés API héritées n’ont pas été migrées. Créez-en une pour authentifier les requêtes Descrybe (X-API-Key). Le secret complet n’est affiché qu’une fois.",
|
||||||
"settings.noApiKeysHelpMember": "Aucune clé API pour cette entreprise. Les clés héritées n’ont pas été migrées  demandez àun administrateur d’en créer une.",
|
"settings.noApiKeysHelpMember": "Aucune clé API pour cette entreprise. Demandez au propriétaire d’activer Clés API dans vos autorisations.",
|
||||||
"settings.unnamedKey": "Clé sans nom",
|
"settings.unnamedKey": "Clé sans nom",
|
||||||
"settings.neverUsed": "Jamais utilisé",
|
"settings.neverUsed": "Jamais utilisé",
|
||||||
"settings.apiKeyActions": "Actions de clé API",
|
"settings.apiKeyActions": "Actions de clé API",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const it: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "Le preferenze di avviso e-mail arrivano presto. Gli avvisi di errore saranno on di default (come in-app); le email di completamento restano off salvo opt-in.",
|
"settings.emailAlertsHelp": "Le preferenze di avviso e-mail arrivano presto. Gli avvisi di errore saranno on di default (come in-app); le email di completamento restano off salvo opt-in.",
|
||||||
"settings.emailAlertsBody": "Per ora configura la mail transazionale in Azienda → Integrazione e-mail. Gli avvisi in-app sopra restano validi.",
|
"settings.emailAlertsBody": "Per ora configura la mail transazionale in Azienda → Integrazione e-mail. Gli avvisi in-app sopra restano validi.",
|
||||||
"settings.apiKeysLegacyNotice": "Le chiavi API legacy non sono state migrate. Creane una nuova per ripristinare l’accesso  il segreto è mostrato una sola volta.",
|
"settings.apiKeysLegacyNotice": "Le chiavi API legacy non sono state migrate. Creane una nuova per ripristinare l’accesso  il segreto è mostrato una sola volta.",
|
||||||
"settings.apiKeysAdminOnly": "Solo gli amministratori possono creare o revocare chiavi API. Puoi vedere i prefissi esistenti.",
|
"settings.apiKeysAdminOnly": "Non hai il permesso di gestire le chiavi API. Chiedi al proprietario dell’azienda di abilitare Chiavi API nelle tue autorizzazioni.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Copia non disponibile per chiavi esistenti  è salvato solo il prefisso. Crea una nuova chiave per copiare il segreto una volta, poi revoca la vecchia se serve.",
|
"settings.apiKeysCopyUnavailableNotice": "Copia non disponibile per chiavi esistenti  è salvato solo il prefisso. Crea una nuova chiave per copiare il segreto una volta, poi revoca la vecchia se serve.",
|
||||||
"settings.apiKeysForbidden": "Non hai l’autorizzazione a vedere le chiavi API. Chiedi aiuto a un amministratore.",
|
"settings.apiKeysForbidden": "Non hai l’autorizzazione a vedere le chiavi API. Chiedi aiuto a un amministratore.",
|
||||||
"settings.noApiKeys": "Nessuna chiave API ancora",
|
"settings.noApiKeys": "Nessuna chiave API ancora",
|
||||||
"settings.noApiKeysHelpAdmin": "Le chiavi API legacy non sono state migrate. Creane una per autenticare le richieste Descrybe (X-API-Key). Il segreto completo è mostrato una sola volta.",
|
"settings.noApiKeysHelpAdmin": "Le chiavi API legacy non sono state migrate. Creane una per autenticare le richieste Descrybe (X-API-Key). Il segreto completo è mostrato una sola volta.",
|
||||||
"settings.noApiKeysHelpMember": "Nessuna chiave API per questa azienda. Le chiavi legacy non sono state migrate  chiedi a un amministratore di crearne una.",
|
"settings.noApiKeysHelpMember": "Non ci sono ancora chiavi API per questa azienda. Chiedi al proprietario di abilitare Chiavi API nelle tue autorizzazioni.",
|
||||||
"settings.unnamedKey": "Chiave senza nome",
|
"settings.unnamedKey": "Chiave senza nome",
|
||||||
"settings.neverUsed": "Mai usato",
|
"settings.neverUsed": "Mai usato",
|
||||||
"settings.apiKeyActions": "Azioni chiave API",
|
"settings.apiKeyActions": "Azioni chiave API",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const ja: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "メールアラートè¨ÂÂ定ã¯近æâ€â€Ã‚¥Ã¥â€¦Â¬Ã©â€“‹ã€‚失æ•â€â€ÃƒÂ£Ã¢â‚¬Å¡Ã‚¢Ã£Æ’©ãƒ¼ãƒˆã¯デフォルトオン(アãƒâ€â€ÃƒÂ£Ã†â€™Ã‚ªÃ¥â€ â€¦Ã£Â¨åÂŒ様)。完了メールã¯オãƒâ€â€ÃƒÂ£Ã†â€™Ã‹â€ インãÂÂâ€â€ÃƒÂ£Ã‚ªã„é™ÂÂりオフã§ã™。",
|
"settings.emailAlertsHelp": "メールアラートè¨ÂÂ定ã¯近æâ€â€Ã‚¥Ã¥â€¦Â¬Ã©â€“‹ã€‚失æ•â€â€ÃƒÂ£Ã¢â‚¬Å¡Ã‚¢Ã£Æ’©ãƒ¼ãƒˆã¯デフォルトオン(アãƒâ€â€ÃƒÂ£Ã†â€™Ã‚ªÃ¥â€ â€¦Ã£Â¨åÂŒ様)。完了メールã¯オãƒâ€â€ÃƒÂ£Ã†â€™Ã‹â€ インãÂÂâ€â€ÃƒÂ£Ã‚ªã„é™ÂÂりオフã§ã™。",
|
||||||
"settings.emailAlertsBody": "当é¢ã¯会社 → メール連æÂºã§トランザクションメールをè¨ÂÂ定ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。上記ã®アãƒâ€â€ÃƒÂ£Ã†â€™Ã‚ªÃ¥â€ â€¦Ã£â€šÂ¢Ã£Æ’©ãƒ¼ãƒˆã¯引ãÂÂÂÂç¶šãÂÂÂÂé©çâ€Â¨ã•れã¾ã™。",
|
"settings.emailAlertsBody": "当é¢ã¯会社 → メール連æÂºã§トランザクションメールをè¨ÂÂ定ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。上記ã®アãƒâ€â€ÃƒÂ£Ã†â€™Ã‚ªÃ¥â€ â€¦Ã£â€šÂ¢Ã£Æ’©ãƒ¼ãƒˆã¯引ãÂÂÂÂç¶šãÂÂÂÂé©çâ€Â¨ã•れã¾ã™。",
|
||||||
"settings.apiKeysLegacyNotice": "レガシーAPIã‚ÂÂーã¯移行ã•れã¦ã„ã¾ã›ん。新ãÂÂâ€â€ÃƒÂ£Ã‚„ã‚ÂÂーを作æˆÂÂãÂÂâ€â€ÃƒÂ£Ã‚¦アクセスを復元  シークレットã¯一度ã ã‘表示ã•れã¾ã™。",
|
"settings.apiKeysLegacyNotice": "レガシーAPIã‚ÂÂーã¯移行ã•れã¦ã„ã¾ã›ん。新ãÂÂâ€â€ÃƒÂ£Ã‚„ã‚ÂÂーを作æˆÂÂãÂÂâ€â€ÃƒÂ£Ã‚¦アクセスを復元  シークレットã¯一度ã ã‘表示ã•れã¾ã™。",
|
||||||
"settings.apiKeysAdminOnly": "APIã‚ÂÂーã®作æˆÂÂ・å–り消ãÂÂâ€â€ÃƒÂ£Ã‚¯会社ã®管ç†者ã®ã¿。æâ€â€Ã‚¢Ã¥Â˜ã®ã‚ÂÂー接é ÂÂ辞ã¯閲覧ã§ãÂÂÂÂã¾ã™。",
|
"settings.apiKeysAdminOnly": "APIキーを管理する権限がありません。会社の所有者に、権限設定でAPIキーを有効にするよう依頼してください。",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "æâ€â€Ã‚¢Ã¥Â˜ã‚ÂÂーã¯コãƒâ€Âーä¸ÂÂå¯  接é ÂÂ辞ã®ã¿ä¿ÂÂå˜。新è¦ÂÂã‚ÂÂーã§シークレットを一度コãƒâ€ÂーãÂÂâ€â€ÃƒÂ£Ã¢â€šÂ¬Ã‚Âå¿…è¦ÂÂãªらå¤ã„ã‚ÂÂーをå–り消ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。",
|
"settings.apiKeysCopyUnavailableNotice": "æâ€â€Ã‚¢Ã¥Â˜ã‚ÂÂーã¯コãƒâ€Âーä¸ÂÂå¯  接é ÂÂ辞ã®ã¿ä¿ÂÂå˜。新è¦ÂÂã‚ÂÂーã§シークレットを一度コãƒâ€ÂーãÂÂâ€â€ÃƒÂ£Ã¢â€šÂ¬Ã‚Âå¿…è¦ÂÂãªらå¤ã„ã‚ÂÂーをå–り消ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。",
|
||||||
"settings.apiKeysForbidden": "APIã‚ÂÂーを表示ã™る権é™ÂÂãÂÂ΋‚りã¾ã›ん。会社ã®管ç†者ã«ä¾ÂÂé ¼ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。",
|
"settings.apiKeysForbidden": "APIã‚ÂÂーを表示ã™る権é™ÂÂãÂÂ΋‚りã¾ã›ん。会社ã®管ç†者ã«ä¾ÂÂé ¼ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。",
|
||||||
"settings.noApiKeys": "APIã‚ÂÂーã¯ã¾ã ã‚りã¾ã›ん",
|
"settings.noApiKeys": "APIã‚ÂÂーã¯ã¾ã ã‚りã¾ã›ん",
|
||||||
"settings.noApiKeysHelpAdmin": "レガシーAPIã‚ÂÂーã¯移行ã•れã¦ã„ã¾ã›ん。Descrybe API(X-API-Key)çâ€Â¨ã«新ãÂÂâ€â€ÃƒÂ£Ã‚„ã‚ÂÂーを作æˆÂÂãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。完全ãªシークレットã¯一度ã ã‘表示ã•れã¾ã™。",
|
"settings.noApiKeysHelpAdmin": "レガシーAPIã‚ÂÂーã¯移行ã•れã¦ã„ã¾ã›ん。Descrybe API(X-API-Key)çâ€Â¨ã«新ãÂÂâ€â€ÃƒÂ£Ã‚„ã‚ÂÂーを作æˆÂÂãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。完全ãªシークレットã¯一度ã ã‘表示ã•れã¾ã™。",
|
||||||
"settings.noApiKeysHelpMember": "ã“ã®会社ã«ã¯ã¾ã APIã‚ÂÂーãÂÂ΋‚りã¾ã›ん。レガシーã‚ÂÂーã¯移行ã•れã¦ã„ã¾ã›ん  管ç†者ã«作æˆÂÂã‚’ä¾ÂÂé ¼ãÂÂâ€â€ÃƒÂ£Ã‚¦ãÂÂÂÂã ã•ã„。",
|
"settings.noApiKeysHelpMember": "この会社にはまだAPIキーがありません。会社の所有者に権限設定でAPIキーを有効にするよう依頼してください。",
|
||||||
"settings.unnamedKey": "ç„¡åÂÂÂÂã‚ÂÂー",
|
"settings.unnamedKey": "ç„¡åÂÂÂÂã‚ÂÂー",
|
||||||
"settings.neverUsed": "未使çâ€Â¨",
|
"settings.neverUsed": "未使çâ€Â¨",
|
||||||
"settings.apiKeyActions": "APIã‚ÂÂーæ“ÂÂ作",
|
"settings.apiKeyActions": "APIã‚ÂÂーæ“ÂÂ作",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const nl: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "E-mailwaarschuwingsvoorkeuren komen binnenkort. Foutmeldingen standaard aan (zoals in-app); voltooiingsmails blijven uit tenzij u zich aanmeldt.",
|
"settings.emailAlertsHelp": "E-mailwaarschuwingsvoorkeuren komen binnenkort. Foutmeldingen standaard aan (zoals in-app); voltooiingsmails blijven uit tenzij u zich aanmeldt.",
|
||||||
"settings.emailAlertsBody": "Configureer voorlopig transactionele mail onder Bedrijf → E-mailintegratie. In-app-alerts hierboven blijven gelden.",
|
"settings.emailAlertsBody": "Configureer voorlopig transactionele mail onder Bedrijf → E-mailintegratie. In-app-alerts hierboven blijven gelden.",
|
||||||
"settings.apiKeysLegacyNotice": "Legacy API-sleutels zijn niet gemigreerd. Maak een nieuwe aan  het geheim wordt slechts één keer getoond.",
|
"settings.apiKeysLegacyNotice": "Legacy API-sleutels zijn niet gemigreerd. Maak een nieuwe aan  het geheim wordt slechts één keer getoond.",
|
||||||
"settings.apiKeysAdminOnly": "Alleen bedrijfsbeheerders kunnen API-sleutels aanmaken of intrekken. U kunt bestaande voorvoegsels bekijken.",
|
"settings.apiKeysAdminOnly": "Je hebt geen toestemming om API-sleutels te beheren. Vraag de bedrijfseigenaar om API-sleutels in je machtigingen in te schakelen.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Kopiëren niet beschikbaar voor bestaande sleutels  alleen voorvoegsel opgeslagen. Maak een nieuwe aan om het geheim één keer te kopiëren en trek de oude in indien nodig.",
|
"settings.apiKeysCopyUnavailableNotice": "Kopiëren niet beschikbaar voor bestaande sleutels  alleen voorvoegsel opgeslagen. Maak een nieuwe aan om het geheim één keer te kopiëren en trek de oude in indien nodig.",
|
||||||
"settings.apiKeysForbidden": "U mag geen API-sleutels bekijken. Vraag een bedrijfsbeheerder om hulp.",
|
"settings.apiKeysForbidden": "U mag geen API-sleutels bekijken. Vraag een bedrijfsbeheerder om hulp.",
|
||||||
"settings.noApiKeys": "Nog geen API-sleutels",
|
"settings.noApiKeys": "Nog geen API-sleutels",
|
||||||
"settings.noApiKeysHelpAdmin": "Legacy API-sleutels zijn niet gemigreerd. Maak een nieuwe voor Descrybe API-verzoeken (X-API-Key). Het volledige geheim wordt slechts één keer getoond.",
|
"settings.noApiKeysHelpAdmin": "Legacy API-sleutels zijn niet gemigreerd. Maak een nieuwe voor Descrybe API-verzoeken (X-API-Key). Het volledige geheim wordt slechts één keer getoond.",
|
||||||
"settings.noApiKeysHelpMember": "Nog geen API-sleutels voor dit bedrijf. Legacy-sleutels niet gemigreerd  vraag een beheerder er een aan te maken.",
|
"settings.noApiKeysHelpMember": "Er zijn nog geen API-sleutels voor dit bedrijf. Vraag de eigenaar om API-sleutels in je machtigingen in te schakelen.",
|
||||||
"settings.unnamedKey": "Naamloze sleutel",
|
"settings.unnamedKey": "Naamloze sleutel",
|
||||||
"settings.neverUsed": "Nooit gebruikt",
|
"settings.neverUsed": "Nooit gebruikt",
|
||||||
"settings.apiKeyActions": "API-sleutelacties",
|
"settings.apiKeyActions": "API-sleutelacties",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const pl: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "Preferencje alertów e-mail wkrótce. Alerty błędów domyślnie włączone (jak w aplikacji); maile o ukończeniu wyłączone, chyba że się zapiszesz.",
|
"settings.emailAlertsHelp": "Preferencje alertów e-mail wkrótce. Alerty błędów domyślnie włączone (jak w aplikacji); maile o ukończeniu wyłączone, chyba że się zapiszesz.",
|
||||||
"settings.emailAlertsBody": "Na razie skonfiguruj mail transakcyjny w Firma → Integracja e-mail. Alerty in-app powyżej nadal obowiązują.",
|
"settings.emailAlertsBody": "Na razie skonfiguruj mail transakcyjny w Firma → Integracja e-mail. Alerty in-app powyżej nadal obowiązują.",
|
||||||
"settings.apiKeysLegacyNotice": "Starsze klucze API nie zostały zmigrowane. Utwórz nowy  sekret pokazywany jest tylko raz.",
|
"settings.apiKeysLegacyNotice": "Starsze klucze API nie zostały zmigrowane. Utwórz nowy  sekret pokazywany jest tylko raz.",
|
||||||
"settings.apiKeysAdminOnly": "Tylko administratorzy firmy mogą tworzyć lub unieważniać klucze API. Możesz przeglądać istniejące prefiksy.",
|
"settings.apiKeysAdminOnly": "Nie masz uprawnień do zarządzania kluczami API. Poproś właściciela firmy o włączenie Kluczy API w Twoich uprawnieniach.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Kopiowanie niedostępne dla istniejących kluczy  przechowywany jest tylko prefiks. Utwórz nowy, skopiuj sekret raz, potem unieważnij stary w razie potrzeby.",
|
"settings.apiKeysCopyUnavailableNotice": "Kopiowanie niedostępne dla istniejących kluczy  przechowywany jest tylko prefiks. Utwórz nowy, skopiuj sekret raz, potem unieważnij stary w razie potrzeby.",
|
||||||
"settings.apiKeysForbidden": "Nie masz uprawnień do przeglądania kluczy API. Poproś administratora firmy o pomoc.",
|
"settings.apiKeysForbidden": "Nie masz uprawnień do przeglądania kluczy API. Poproś administratora firmy o pomoc.",
|
||||||
"settings.noApiKeys": "Brak kluczy API",
|
"settings.noApiKeys": "Brak kluczy API",
|
||||||
"settings.noApiKeysHelpAdmin": "Starsze klucze API nie zostały zmigrowane. Utwórz nowy do uwierzytelniania żądań Descrybe (X-API-Key). Pełny sekret pokazywany jest tylko raz.",
|
"settings.noApiKeysHelpAdmin": "Starsze klucze API nie zostały zmigrowane. Utwórz nowy do uwierzytelniania żądań Descrybe (X-API-Key). Pełny sekret pokazywany jest tylko raz.",
|
||||||
"settings.noApiKeysHelpMember": "Brak jeszcze kluczy API dla tej firmy. Starsze nie zostały zmigrowane  poproś administratora o utworzenie.",
|
"settings.noApiKeysHelpMember": "Ta firma nie ma jeszcze kluczy API. Poproś właściciela o włączenie Kluczy API w Twoich uprawnieniach.",
|
||||||
"settings.unnamedKey": "Klucz bez nazwy",
|
"settings.unnamedKey": "Klucz bez nazwy",
|
||||||
"settings.neverUsed": "Nigdy nie użyto",
|
"settings.neverUsed": "Nigdy nie użyto",
|
||||||
"settings.apiKeyActions": "Akcje klucza API",
|
"settings.apiKeyActions": "Akcje klucza API",
|
||||||
|
|||||||
@@ -2077,12 +2077,12 @@ export const pt: MessageDict = {
|
|||||||
"settings.emailAlertsHelp": "As preferências de alerta por e-mail chegam em breve. Alertas de falha estarão ativas por predefinição (como na app); e-mails de conclusão ficam off salvo opt-in.",
|
"settings.emailAlertsHelp": "As preferências de alerta por e-mail chegam em breve. Alertas de falha estarão ativas por predefinição (como na app); e-mails de conclusão ficam off salvo opt-in.",
|
||||||
"settings.emailAlertsBody": "Por agora, configure o correio transacional em Empresa → Integração de e-mail. Os alertas in-app acima continuam a aplicar-se.",
|
"settings.emailAlertsBody": "Por agora, configure o correio transacional em Empresa → Integração de e-mail. Os alertas in-app acima continuam a aplicar-se.",
|
||||||
"settings.apiKeysLegacyNotice": "As chaves API legado não foram migradas. Crie uma nova para restaurar o acesso  o segredo é mostrado apenas uma vez.",
|
"settings.apiKeysLegacyNotice": "As chaves API legado não foram migradas. Crie uma nova para restaurar o acesso  o segredo é mostrado apenas uma vez.",
|
||||||
"settings.apiKeysAdminOnly": "Só os administradores podem criar ou revogar chaves API. Pode ver os prefixos existentes.",
|
"settings.apiKeysAdminOnly": "Não tem permissão para gerir chaves API. Peça ao proprietário da empresa para ativar Chaves API nas suas permissões.",
|
||||||
"settings.apiKeysCopyUnavailableNotice": "Cópia indisponÃÂÂvel para chaves existentes  só o prefixo é guardado. Crie uma nova para copiar o segredo uma vez e revogue a antiga se necessário.",
|
"settings.apiKeysCopyUnavailableNotice": "Cópia indisponÃÂÂvel para chaves existentes  só o prefixo é guardado. Crie uma nova para copiar o segredo uma vez e revogue a antiga se necessário.",
|
||||||
"settings.apiKeysForbidden": "Não tem permissão para ver chaves API. Peça ajuda a um administrador da empresa.",
|
"settings.apiKeysForbidden": "Não tem permissão para ver chaves API. Peça ajuda a um administrador da empresa.",
|
||||||
"settings.noApiKeys": "Ainda sem chaves API",
|
"settings.noApiKeys": "Ainda sem chaves API",
|
||||||
"settings.noApiKeysHelpAdmin": "As chaves API legado não foram migradas. Crie uma nova para autenticar pedidos Descrybe (X-API-Key). O segredo completo é mostrado apenas uma vez.",
|
"settings.noApiKeysHelpAdmin": "As chaves API legado não foram migradas. Crie uma nova para autenticar pedidos Descrybe (X-API-Key). O segredo completo é mostrado apenas uma vez.",
|
||||||
"settings.noApiKeysHelpMember": "Ainda sem chaves API para esta empresa. As legado não foram migradas  peça a um administrador para criar uma.",
|
"settings.noApiKeysHelpMember": "Ainda não existem chaves API para esta empresa. Peça ao proprietário para ativar Chaves API nas suas permissões.",
|
||||||
"settings.unnamedKey": "Chave sem nome",
|
"settings.unnamedKey": "Chave sem nome",
|
||||||
"settings.neverUsed": "Nunca usado",
|
"settings.neverUsed": "Nunca usado",
|
||||||
"settings.apiKeyActions": "Ações de chave API",
|
"settings.apiKeyActions": "Ações de chave API",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import { afterNavigate, goto, replaceState } from "$app/navigation";
|
import { afterNavigate, goto, replaceState } from "$app/navigation";
|
||||||
import { page } from "$app/state";
|
import { page } from "$app/state";
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
type PlanLike
|
type PlanLike
|
||||||
} from "$lib/billing-display";
|
} from "$lib/billing-display";
|
||||||
import { canManageCompany } from "$lib/company-admin";
|
import { canManageCompany } from "$lib/company-admin";
|
||||||
|
import { canManageApiKeys as hasAPIKeyManagement } from "$lib/api-key-permissions";
|
||||||
import { authSession } from "$lib/auth-session.svelte";
|
import { authSession } from "$lib/auth-session.svelte";
|
||||||
import { planCapabilities } from "$lib/plan-capabilities.svelte";
|
import { planCapabilities } from "$lib/plan-capabilities.svelte";
|
||||||
import {
|
import {
|
||||||
@@ -202,6 +203,14 @@
|
|||||||
let apiKeys = $state<ApiKey[]>([]);
|
let apiKeys = $state<ApiKey[]>([]);
|
||||||
let pendingInvites = $state<PendingInvite[]>([]);
|
let pendingInvites = $state<PendingInvite[]>([]);
|
||||||
let canAdmin = $state(false);
|
let canAdmin = $state(false);
|
||||||
|
/** API-key access is separately grantable to ordinary teammates. */
|
||||||
|
const canManageApiKeys = $derived(
|
||||||
|
hasAPIKeyManagement(
|
||||||
|
canAdmin,
|
||||||
|
planCapabilities.can("settings.api_keys"),
|
||||||
|
planCapabilities.can("capability.api_access")
|
||||||
|
)
|
||||||
|
);
|
||||||
let canOwner = $state(false);
|
let canOwner = $state(false);
|
||||||
/** Per-member access overlay editor (owner-only edits; admins get a read-only view). */
|
/** Per-member access overlay editor (owner-only edits; admins get a read-only view). */
|
||||||
let permissionsOpen = $state(false);
|
let permissionsOpen = $state(false);
|
||||||
@@ -709,7 +718,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createApiKey() {
|
async function createApiKey() {
|
||||||
if (!canAdmin || !planCapabilities.can("settings.api_keys")) {
|
if (!canManageApiKeys || !planCapabilities.can("settings.api_keys")) {
|
||||||
error = i18n.t("settings.apiKeysAdminOnly");
|
error = i18n.t("settings.apiKeysAdminOnly");
|
||||||
notifyError(error);
|
notifyError(error);
|
||||||
return;
|
return;
|
||||||
@@ -753,7 +762,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function renameApiKey() {
|
async function renameApiKey() {
|
||||||
if (!canAdmin || !planCapabilities.can("settings.api_keys")) {
|
if (!canManageApiKeys || !planCapabilities.can("settings.api_keys")) {
|
||||||
error = i18n.t("settings.apiKeysAdminOnly");
|
error = i18n.t("settings.apiKeysAdminOnly");
|
||||||
notifyError(error);
|
notifyError(error);
|
||||||
return;
|
return;
|
||||||
@@ -1390,7 +1399,7 @@
|
|||||||
<TabsContent value="api-keys" class="space-y-6">
|
<TabsContent value="api-keys" class="space-y-6">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<h2 class="text-2xl font-semibold tracking-tight">{i18n.t("settings.apiKeysHeading")}</h2>
|
<h2 class="text-2xl font-semibold tracking-tight">{i18n.t("settings.apiKeysHeading")}</h2>
|
||||||
{#if canAdmin}
|
{#if canManageApiKeys}
|
||||||
<Button
|
<Button
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
data-assistant-target="api-keys-create"
|
data-assistant-target="api-keys-create"
|
||||||
@@ -1435,7 +1444,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if !canAdmin}
|
{#if !canManageApiKeys}
|
||||||
<Alert
|
<Alert
|
||||||
tone="info"
|
tone="info"
|
||||||
message={i18n.t("settings.apiKeysAdminOnly")}
|
message={i18n.t("settings.apiKeysAdminOnly")}
|
||||||
@@ -1479,11 +1488,11 @@
|
|||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title={i18n.t("empty.settings.noApiKeysTitle")}
|
title={i18n.t("empty.settings.noApiKeysTitle")}
|
||||||
message={canAdmin
|
message={canManageApiKeys
|
||||||
? i18n.t("settings.noApiKeysHelpAdmin")
|
? i18n.t("settings.noApiKeysHelpAdmin")
|
||||||
: i18n.t("settings.noApiKeysHelpMember")}
|
: i18n.t("settings.noApiKeysHelpMember")}
|
||||||
>
|
>
|
||||||
{#if canAdmin}
|
{#if canManageApiKeys}
|
||||||
<Button
|
<Button
|
||||||
disabled={saving}
|
disabled={saving}
|
||||||
data-assistant-target="api-keys-create"
|
data-assistant-target="api-keys-create"
|
||||||
@@ -1521,7 +1530,7 @@
|
|||||||
: i18n.t("settings.neverUsed")}
|
: i18n.t("settings.neverUsed")}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell stickyRight>
|
<TableCell stickyRight>
|
||||||
{#if canAdmin}
|
{#if canManageApiKeys}
|
||||||
{@const sessionSecret = sessionSecretFor(key.id)}
|
{@const sessionSecret = sessionSecretFor(key.id)}
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<DropdownMenu class="min-w-[10rem]">
|
<DropdownMenu class="min-w-[10rem]">
|
||||||
|
|||||||
+2
-1
@@ -35,7 +35,8 @@
|
|||||||
"dev:ps1": "pwsh -File scripts/dev.ps1",
|
"dev:ps1": "pwsh -File scripts/dev.ps1",
|
||||||
"seed:a1": "node scripts/run-in-dir.mjs apps/api go run ./cmd/seed-a1 -mode reimport -file ../../scripts/seed/a1-demo-data.sql.gz",
|
"seed:a1": "node scripts/run-in-dir.mjs apps/api go run ./cmd/seed-a1 -mode reimport -file ../../scripts/seed/a1-demo-data.sql.gz",
|
||||||
"seed:a1:export": "node scripts/run-in-dir.mjs apps/api go run ./cmd/seed-a1 -mode export -file ../../scripts/seed/a1-demo-data.sql.gz",
|
"seed:a1:export": "node scripts/run-in-dir.mjs apps/api go run ./cmd/seed-a1 -mode export -file ../../scripts/seed/a1-demo-data.sql.gz",
|
||||||
"reimport:a1": "npm run seed:a1"
|
"reimport:a1": "npm run seed:a1",
|
||||||
|
"zip": "node scripts/zip.mjs"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "10.0.4"
|
"concurrently": "10.0.4"
|
||||||
|
|||||||
+183
@@ -0,0 +1,183 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Source snapshot zip: tracked + untracked files that are not gitignored.
|
||||||
|
* Excludes node_modules, .git, secrets, build artifacts, and the zip itself.
|
||||||
|
*
|
||||||
|
* Usage: npm run zip
|
||||||
|
* Output: <repo>/descrybe.zip (entries prefixed with descrybe-v2/)
|
||||||
|
*/
|
||||||
|
import { spawnSync } from "node:child_process";
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { crc32, deflateRawSync } from "node:zlib";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const prefix = "descrybe-v2/";
|
||||||
|
const outName = "descrybe.zip";
|
||||||
|
const outPath = path.join(root, outName);
|
||||||
|
|
||||||
|
const BLOCKED_DIRS = new Set([
|
||||||
|
".bin",
|
||||||
|
".codehelper",
|
||||||
|
".git",
|
||||||
|
".idea",
|
||||||
|
".svelte-kit",
|
||||||
|
".vscode",
|
||||||
|
"coverage",
|
||||||
|
"dist",
|
||||||
|
"node_modules",
|
||||||
|
]);
|
||||||
|
|
||||||
|
function posixRel(p) {
|
||||||
|
return p.replaceAll("\\", "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
function shouldSkip(rel) {
|
||||||
|
const n = posixRel(rel);
|
||||||
|
if (!n || n === outName || n.endsWith(".zip")) return true;
|
||||||
|
if (n === ".env" || n.endsWith("/.env")) return true;
|
||||||
|
if (n.startsWith("data/uploads/") || n.startsWith("apps/api/data/uploads/")) return true;
|
||||||
|
if (n.startsWith("bin/") || n.startsWith("apps/api/bin/")) return true;
|
||||||
|
const parts = n.split("/");
|
||||||
|
return parts.some((part) => BLOCKED_DIRS.has(part));
|
||||||
|
}
|
||||||
|
|
||||||
|
function listSourceFiles() {
|
||||||
|
const r = spawnSync(
|
||||||
|
"git",
|
||||||
|
["ls-files", "-z", "--cached", "--others", "--exclude-standard"],
|
||||||
|
{ cwd: root, encoding: "buffer", maxBuffer: 32 * 1024 * 1024 },
|
||||||
|
);
|
||||||
|
if (r.error || r.status !== 0) {
|
||||||
|
const err = r.stderr?.toString("utf8")?.trim() || r.error?.message || "git ls-files failed";
|
||||||
|
console.error(`[zip] ${err}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const raw = r.stdout.toString("utf8");
|
||||||
|
return raw
|
||||||
|
.split("\0")
|
||||||
|
.filter(Boolean)
|
||||||
|
.filter((rel) => !shouldSkip(rel))
|
||||||
|
.filter((rel) => {
|
||||||
|
const abs = path.join(root, rel);
|
||||||
|
try {
|
||||||
|
return fs.statSync(abs).isFile();
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.sort();
|
||||||
|
}
|
||||||
|
|
||||||
|
function dosDateTime(d) {
|
||||||
|
const year = d.getFullYear();
|
||||||
|
if (year < 1980) return { time: 0, date: 0x21 };
|
||||||
|
const time = (d.getHours() << 11) | (d.getMinutes() << 5) | Math.floor(d.getSeconds() / 2);
|
||||||
|
const date = ((year - 1980) << 9) | ((d.getMonth() + 1) << 5) | d.getDate();
|
||||||
|
return { time, date };
|
||||||
|
}
|
||||||
|
|
||||||
|
function u16(n) {
|
||||||
|
const b = Buffer.alloc(2);
|
||||||
|
b.writeUInt16LE(n & 0xffff, 0);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
function u32(n) {
|
||||||
|
const b = Buffer.alloc(4);
|
||||||
|
b.writeUInt32LE(n >>> 0, 0);
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
const files = listSourceFiles();
|
||||||
|
if (files.length === 0) {
|
||||||
|
console.error("[zip] no files to archive");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tmpPath = `${outPath}.tmp`;
|
||||||
|
const out = fs.createWriteStream(tmpPath);
|
||||||
|
const central = [];
|
||||||
|
let offset = 0;
|
||||||
|
let bytes = 0;
|
||||||
|
|
||||||
|
function write(buf) {
|
||||||
|
out.write(buf);
|
||||||
|
offset += buf.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const rel of files) {
|
||||||
|
const abs = path.join(root, rel);
|
||||||
|
const data = fs.readFileSync(abs);
|
||||||
|
const st = fs.statSync(abs);
|
||||||
|
const compressed = deflateRawSync(data, { level: 9 });
|
||||||
|
const useStore = compressed.length >= data.length;
|
||||||
|
const payload = useStore ? data : compressed;
|
||||||
|
const method = useStore ? 0 : 8;
|
||||||
|
const name = Buffer.from(`${prefix}${posixRel(rel)}`, "utf8");
|
||||||
|
const { time, date } = dosDateTime(st.mtime);
|
||||||
|
const crc = crc32(data) >>> 0;
|
||||||
|
const localOff = offset;
|
||||||
|
|
||||||
|
write(Buffer.from("PK\u0003\u0004", "binary"));
|
||||||
|
write(u16(20));
|
||||||
|
write(u16(0x0800));
|
||||||
|
write(u16(method));
|
||||||
|
write(u16(time));
|
||||||
|
write(u16(date));
|
||||||
|
write(u32(crc));
|
||||||
|
write(u32(payload.length));
|
||||||
|
write(u32(data.length));
|
||||||
|
write(u16(name.length));
|
||||||
|
write(u16(0));
|
||||||
|
write(name);
|
||||||
|
write(payload);
|
||||||
|
|
||||||
|
const cd = Buffer.concat([
|
||||||
|
Buffer.from("PK\u0001\u0002", "binary"),
|
||||||
|
u16(20),
|
||||||
|
u16(20),
|
||||||
|
u16(0x0800),
|
||||||
|
u16(method),
|
||||||
|
u16(time),
|
||||||
|
u16(date),
|
||||||
|
u32(crc),
|
||||||
|
u32(payload.length),
|
||||||
|
u32(data.length),
|
||||||
|
u16(name.length),
|
||||||
|
u16(0),
|
||||||
|
u16(0),
|
||||||
|
u16(0),
|
||||||
|
u16(0),
|
||||||
|
u32(0),
|
||||||
|
u32(localOff),
|
||||||
|
name,
|
||||||
|
]);
|
||||||
|
central.push(cd);
|
||||||
|
bytes += data.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cdStart = offset;
|
||||||
|
for (const rec of central) write(rec);
|
||||||
|
const cdSize = offset - cdStart;
|
||||||
|
|
||||||
|
write(Buffer.from("PK\u0005\u0006", "binary"));
|
||||||
|
write(u16(0));
|
||||||
|
write(u16(0));
|
||||||
|
write(u16(files.length));
|
||||||
|
write(u16(files.length));
|
||||||
|
write(u32(cdSize));
|
||||||
|
write(u32(cdStart));
|
||||||
|
write(u16(0));
|
||||||
|
|
||||||
|
out.end(() => {
|
||||||
|
fs.renameSync(tmpPath, outPath);
|
||||||
|
const mb = (fs.statSync(outPath).size / (1024 * 1024)).toFixed(2);
|
||||||
|
const srcMb = (bytes / (1024 * 1024)).toFixed(2);
|
||||||
|
console.log(`[zip] wrote ${outName} (${files.length} files, ${srcMb} MB source → ${mb} MB zip)`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
Reference in new issue
Block a user