API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · secrets

Secret Schema

ID del esquema
secret
Colección
secrets
Permisos
  • Leersecret_view
  • Crearsecret_create
  • Modificarsecret_edit
  • Eliminarsecret_delete
Relaciones

Campos

Secret Schema

secrets4 permisos

Zero-knowledge encrypted secret entity (v2 — ADR 0084 + ADR 0089). The server never sees plaintext title, tags, notes, or payload — only IDs, ciphertext, and HMAC-trigram blind index entries.

encryptedTitlestringobligatorio

AES-256-GCM encrypted title, base64url-encoded.

mín. 1 caracteres
titleIvstringobligatorio

12-byte IV for title encryption, base64url-encoded.

mín. 1 caracteres
lifecycleStatestringopcional

DESTROYED: Der Schlüssel wurde vernichtet, die damit verschlüsselten Daten sind weg.

ACTIVEDESTROYEDnull
solo lecturaadmite null
destroyedAtdatetimeopcional
solo lecturaadmite null
destroyedByUserIduuidopcional
solo lecturaadmite null
encryptedTagsobjectopcional

Encrypted blob of tags (JSON-serialized array). Plaintext tags MUST NOT be sent.

admite null
ciphertextstringobligatorio

AES-256-GCM ciphertext of JSON.stringify(tags), base64url.

mín. 1 caracteres
ivstringobligatorio

12-byte IV, base64url.

mín. 1 caracteres
encryptedNotesobjectopcional

Optional encrypted free-text notes blob.

admite null
ciphertextstringobligatorio
mín. 1 caracteres
ivstringobligatorio
mín. 1 caracteres
titleIndexstring[]obligatorio

Per-scope HMAC-trigram blind index for searchable encryption (ADR 0089). Empty array allowed only when no searchable text was provided at write time.

titleIndexVersionintegerobligatorio

SEARCH_INDEX_VERSION at write time. Bumped when normalisation rules change; client lazy-reindexes on save.

≥ 1
secretTypestringobligatorio

Type-key (plaintext OK — needed for UI grouping / icons; on its own it does not reveal secret content).

1–100 caracteresPatrón
assetIduuidopcional→ asset

Linked asset UUID

admite null
linkedAssetIdsuuid[]opcional

Additional linked asset UUIDs besides the primary `assetId` (e.g. one backup encryption key used by several backup servers). Assignment only; `?assetId=` on the list matches both. Does not influence `assetPartyId`.

máx. 50 elementosadmite null
partyIduuidopcional

Linked party/customer UUID. NOT a plain link — this field selects the CRYPTO SCOPE: it switches the client to customer-key encryption (`wrappedCustomerKey`), puts the blind index under the customer-SSK, and opens the row to every holder of that customer key in `buildVaultSecretVisibilityFilter`. Only ever set it together with a matching re-encryption. To express "belongs to customer X" for filtering, use `assetPartyId`.

admite null
assetPartyIduuidopcional

Denormalized `asset.partyId` of the linked asset — assignment/filtering only. Carries NO cryptographic meaning and is deliberately absent from the vault visibility filter. Server-derived; never trusted from the client.

admite null
contractIduuidopcional

Linked contract UUID

admite null
encryptedPayloadstringobligatorio

AES-256-GCM encrypted payload, base64url-encoded

mín. 1 caracteres
payloadIvstringobligatorio

12-byte IV for AES-256-GCM, base64url-encoded

mín. 1 caracteres
dekUnchangedbooleanopcional

Transport-only client assertion that the DEK was reused for this update. Stripped by secret.hooks.ts beforeUpdate — never stored.

admite null
skipPayloadHistorybooleanopcional

Transport-only client assertion that no password-type field changed in this payload update; the version ring is left untouched. Stripped by secret.hooks.ts beforeUpdate — never stored.

admite null
wrappedKeysobject[]opcional

Wrapped DEK entries for individually authorized users

admite null
userIduuidobligatorio

User who can decrypt this secret

wrappedDekstringobligatorio

ECDH-wrapped DEK, base64url-encoded

mín. 1 caracteres
ephemeralPublicKeystringobligatorio

Ephemeral ECDH public key used for wrapping, JWK base64url-encoded

mín. 1 caracteres
wrappedTeamKeysobject[]opcional

Wrapped DEK entries for team-level access

Valor por defecto: []admite null
teamIduuidobligatorio

Org unit (team) ID

wrappedDekstringobligatorio

Team-key-wrapped DEK, base64url-encoded

mín. 1 caracteres
teamKeyVersionintegerobligatorio

Version of the team key used for wrapping

≥ 1
tenantWideAccessbooleanopcional

Whether this secret is accessible to all tenant members

Valor por defecto: false
confidentialbooleanopcional

Confidential entry (ADR 1195): only delivered to callers with secret_view_confidential (or the creator). null/absent follows the secret type; false overrides a confidential type.

admite null
wrappedTenantKeystringopcional

Tenant-key-wrapped DEK, base64url-encoded

admite null
tenantKeyVersionintegeropcional

Version of the tenant key used for wrapping

≥ 1admite null
folderIduuidopcional

Vault folder this secret belongs to

admite null
secretTypeIduuidopcional

Reference to VaultSecretType for custom type definitions

admite null
wrappedFolderKeystringopcional

DEK wrapped with Folder Key (AES-KW), base64url

admite null
folderKeyVersionintegeropcional

Version of the folder key used for wrapping

≥ 1admite null
wrappedCustomerKeystringopcional

DEK wrapped with Customer Key (AES-KW), base64url

admite null
customerKeyVersionintegeropcional

Version of the customer key used for wrapping

≥ 1admite null
importSourcestringopcional

Key of the import source this secret was created by (e.g. 'tanss', 'lastpass'). Absent for hand-created secrets.

máx. 100 caracteresadmite null
importedAtdatetimeopcional

When this secret was written by the import pipeline.

admite null
importConfirmedAtdatetimeopcional

When a user confirmed the imported values are correct. Null/absent on an imported secret means the confirmation panel is still pending.

solo lecturaadmite null
importConfirmedByuuidopcional

Internal user UUID who confirmed the import (users._id, not the auth id).

solo lecturaadmite null
needsRewrapbooleanopcional

Flagged after key rotation; triggers lazy re-wrap on next access

Valor por defecto: falseadmite null
lastRewrapAtdatetimeopcional

Timestamp of last successful re-wrap

admite null
previousVersionsobject[]opcional

Server-managed ring of previous encrypted payloads (newest first), all under the current DEK. ADR 0847.

máx. 10 elementossolo lecturaadmite null
encryptedPayloadstringobligatorio
mín. 1 caracteres
payloadIvstringobligatorio
mín. 1 caracteres
replacedAtdatetimeobligatorio
replacedByUserIdstringopcional
admite null
attachmentsobject[]opcional

Zero-knowledge encrypted file attachments stored in S3

Valor por defecto: []admite null
fileIduuidobligatorio

Unique file identifier

encryptedNamestringobligatorio

AES-256-GCM encrypted filename, base64url-encoded

mín. 1 caracteres
nameIvstringobligatorio

12-byte IV for filename encryption, base64url-encoded

mín. 1 caracteres
sizeBytesintegerobligatorio

Encrypted file size in bytes

≥ 0
fileIvstringobligatorio

12-byte IV for file content encryption, base64url-encoded

mín. 1 caracteres
uploadedAtdatetimeobligatorio

When the file was uploaded

uploadedByuuidobligatorio

User who uploaded the file

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/secrets — Lista, paginada y filtrable
  • GET /api/v1/secrets/<id> — Una entidad
  • POST /api/v1/secrets — Crear
  • PATCH /api/v1/secrets/<id> — Actualización parcial
  • DELETE /api/v1/secrets/<id> — Eliminación lógica
  • GET /api/v1/secrets/<id>/timeline — Auditoría y actividades

Búsqueda