Actualizar capacidad de suplantación del usuario
Enable or disable whether a user can impersonate other users.
/users/{userId}/impersonatorAlcance users.writeSDK: solo @owbase/node
Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data. Account endpoints are read-only while impersonating: they report the target’s account, and anything that would change it is refused, so an impersonator cannot alter the target’s credentials or delete their account.
Parámetros
Sección titulada «Parámetros»userId string obligatorio
User ID.
impersonator boolean obligatorio
Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
Acceso: clave de API con el alcance users.write.
Respuestas
Sección titulada «Respuestas»200Éxito400Parámetro inválido o faltante401Sin sesión, sin permiso en el recurso o clave sin el alcance404Recurso de la ruta no encontrado429Límite de peticionesTodo error llega como JSON con code, type y message: consulta Errores.
import { Client, Users } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secret API key
const users = new Users(client);
const result = await users.updateImpersonator({ userId: '<USER_ID>', impersonator: false,});curl -X PATCH "https://cloud.owbase.dev/v1/users/<USER_ID>/impersonator" \ -H "X-Owbase-Project: <PROJECT_ID>" \ -H "X-Owbase-Key: $OWBASE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"impersonator":false}'{ "$id": "5e5ea5c16897e", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "John Doe", "password": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L/4LdgrVRXxE", "hash": "argon2", "hashOptions": {}, "registration": "2020-10-15T06:38:00.000+00:00", "status": true, "labels": [ "vip" ], "passwordUpdate": "2020-10-15T06:38:00.000+00:00", "phone": "+4930901820", "emailVerification": true, "emailIsFree": true, "emailIsDisposable": false, "emailIsCorporate": true, "emailIsCanonical": true, "passwordPwned": false, "phoneVerification": true, "mfa": true, "prefs": { "theme": "pink", "timezone": "UTC" }, "targets": [ { "$id": "259125845563242502", "$createdAt": "2020-10-15T06:38:00.000+00:00", "$updatedAt": "2020-10-15T06:38:00.000+00:00", "name": "Apple iPhone 12", "userId": "259125845563242502", "providerId": "259125845563242502", "providerType": "email", "identifier": "token", "expired": false } ], "accessedAt": "2020-10-15T06:38:00.000+00:00", "impersonator": false, "impersonatorUserId": "5e5ea5c16897e"}Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.