Skip to content

Commit 4d1e181

Browse files
stivenm16carburo
andauthored
Translation for experimental_taintUniqueValue article (#923)
* Translation for experimental_taintUniqueValue article * fix accent * Adjust line changes --------- Co-authored-by: Rainer Martinez <[email protected]>
1 parent 8a4be29 commit 4d1e181

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/content/reference/react/experimental_taintObjectReference.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,42 @@ title: experimental_taintObjectReference
44

55
<Wip>
66

7-
**This API is experimental and is not available in a stable version of React yet.**
7+
**Esta API es experimental y aún no está disponible en una versión estable de React.**
88

9-
You can try it by upgrading React packages to the most recent experimental version:
9+
Puedes probarla actualizando los paquetes de React a la versión experimental más reciente:
1010

1111
- `react@experimental`
1212
- `react-dom@experimental`
1313
- `eslint-plugin-react-hooks@experimental`
1414

15-
Experimental versions of React may contain bugs. Don't use them in production.
15+
Las versiones experimentales de React pueden contener errores. No las uses en producción.
1616

17-
This API is only available inside React Server Components.
17+
Esta API únicamente está disponible dentro de Componentes de Servidor en React
1818

1919
</Wip>
2020

2121

2222
<Intro>
2323

24-
`taintObjectReference` lets you prevent a specific object instance from being passed to a Client Component like a `user` object.
24+
`taintObjectReference` te permite evitar que una instancia específica de objeto sea pasada a un Componente Cliente, como un objecto `user`.
2525

2626
```js
2727
experimental_taintObjectReference(message, object);
2828
```
2929

30-
To prevent passing a key, hash or token, see [`taintUniqueValue`](/reference/react/experimental_taintUniqueValue).
30+
Para prevenir el pasar una llave, hash o token, ver [`taintUniqueValue`](/reference/react/experimental_taintUniqueValue).
3131

3232
</Intro>
3333

3434
<InlineToc />
3535

3636
---
3737

38-
## Reference {/*reference*/}
38+
## Referencia {/*reference*/}
3939

4040
### `taintObjectReference(message, object)` {/*taintobjectreference*/}
4141

42-
Call `taintObjectReference` with an object to register it with React as something that should not be allowed to be passed to the Client as is:
42+
Llama a `taintObjectReference` con un objeto para registrarlo en React como algo que no debería permitirse pasar al Cliente tal cual:
4343

4444
```js
4545
import {experimental_taintObjectReference} from 'react';
@@ -50,35 +50,35 @@ experimental_taintObjectReference(
5050
);
5151
```
5252

53-
[See more examples below.](#usage)
53+
[Ver más ejemplos abajo.](#usage)
5454

55-
#### Parameters {/*parameters*/}
55+
#### Parámetros {/*parameters*/}
5656

57-
* `message`: The message you want to display if the object gets passed to a Client Component. This message will be displayed as a part of the Error that will be thrown if the object gets passed to a Client Component.
57+
* `message`: El mensaje que deseas mostrar si el objeto se pasa a un Componente Cliente. Este mensaje se mostrará como parte del Error que se lanzará si el objeto se pasa a un Componente Cliente.
5858

59-
* `object`: The object to be tainted. Functions and class instances can be passed to `taintObjectReference` as `object`. Functions and classes are already blocked from being passed to Client Components but the React's default error message will be replaced by what you defined in `message`. When a specific instance of a Typed Array is passed to `taintObjectReference` as `object`, any other copies of the Typed Array will not be tainted.
59+
* `object`: El objeto a contaminar. Funciones e instancias de clases pueden ser pasadas a `taintObjectReference` como `object`. Las funciones y clases ya están bloqueadas para ser pasadas a Componentes Cliente, pero el mensaje de error predeterminado de React será reemplazado por lo que hayas definido en el `message`. Cuando una instancia específica de una matriz tipada se pasa a `taintObjectReference` como `object`, cualquier otra copia de la matriz tipada no será contaminada.
6060

61-
#### Returns {/*returns*/}
61+
#### Devuelve {/*returns*/}
6262

63-
`experimental_taintObjectReference` returns `undefined`.
63+
`experimental_taintObjectReference` devuelve `undefined`.
6464

6565
#### Caveats {/*caveats*/}
6666

67-
- Recreating or cloning a tainted object creates a new untainted object which may contain sensitive data. For example, if you have a tainted `user` object, `const userInfo = {name: user.name, ssn: user.ssn}` or `{...user}` will create new objects which are not tainted. `taintObjectReference` only protects against simple mistakes when the object is passed through to a Client Component unchanged.
67+
- Recrear o clonar un objeto contaminado crea un nuevo objeto no contaminado que puede contener datos sensibles. Por ejemplo, si tienes un objeto `user` contaminado, `const userInfo = {name: user.name, ssn: user.ssn}` o `{...user}` creará nuevos objetos que no estarán contamidos. `taintObjectReference` solo protege contra errores simples cuando el objeto se pasa sin cambios a un Componente Cliente.
6868

6969
<Pitfall>
7070

71-
**Do not rely on just tainting for security.** Tainting an object doesn't prevent leaking of every possible derived value. For example, the clone of a tainted object will create a new untainted object. Using data from a tainted object (e.g. `{secret: taintedObj.secret}`) will create a new value or object that is not tainted. Tainting is a layer of protection; a secure app will have multiple layers of protection, well designed APIs, and isolation patterns.
71+
**No confíes únicamente en la 'contaminación' para la seguridad.** Contaminar un objeto no evita la filtración de todos los valores derivados posibles. Por ejemplo, el clon de un objeto contaminado creará un nuevo objeto no contaminado. Usar datos de un objeto contaminado (e.j. `{secret: taintedObj.secret}`) creará un nuevo valor u objeto que no esté contaminado. La contaminación es una capa de protección; una aplicación segura tendrá múltiples capas de protección, APIs bien diseñadas y patrones de aislamiento.
7272

7373
</Pitfall>
7474

7575
---
7676

77-
## Usage {/*usage*/}
77+
## Uso {/*usage*/}
7878

79-
### Prevent user data from unintentionally reaching the client {/*prevent-user-data-from-unintentionally-reaching-the-client*/}
79+
### Evita que los datos de usuario lleguen al cliente de manera no intencionada {/*prevent-user-data-from-unintentionally-reaching-the-client*/}
8080

81-
A Client Component should never accept objects that carry sensitive data. Ideally, the data fetching functions should not expose data that the current user should not have access to. Sometimes mistakes happen during refactoring. To protect against these mistakes happening down the line we can "taint" the user object in our data API.
81+
Un Componente Cliente nunca debería aceptar objetos que contengan datos sensibles. Idealmente, las funciones de obtención de datos no deberían exponer datos a los que el usuario actual no debería tener acceso. A veces, ocurren errores durante la refactorización. Para protegernos contra estos errores en el futuro, podemos 'contaminar' el objeto de usuario en nuestra API de datos.
8282

8383
```js
8484
import {experimental_taintObjectReference} from 'react';
@@ -94,13 +94,13 @@ export async function getUser(id) {
9494
}
9595
```
9696

97-
Now whenever anyone tries to pass this object to a Client Component, an error will be thrown with the passed in error message instead.
97+
Ahora, cada vez que alguien intente pasar este objeto a un Componente Cliente, se lanzará un error con el mensaje de error proporcionado.
9898

9999
<DeepDive>
100100

101-
#### Protecting against leaks in data fetching {/*protecting-against-leaks-in-data-fetching*/}
101+
#### Protegiendo contra fugas en la obtención de datos. {/*protecting-against-leaks-in-data-fetching*/}
102102

103-
If you're running a Server Components environment that has access to sensitive data, you have to be careful not to pass objects straight through:
103+
Si estás ejecutando un entorno de Componentes de Servidor que tiene acceso a datos sensibles, debes tener cuidado de no pasar objetos directamente:
104104

105105
```js
106106
// api.js
@@ -130,7 +130,7 @@ export async function InfoCard({ user }) {
130130
}
131131
```
132132

133-
Ideally, the `getUser` should not expose data that the current user should not have access to. To prevent passing the `user` object to a Client Component down the line we can "taint" the user object:
133+
Idealmente, la función `getUser` no debería exponer datos a los que el `user` actual no debería tener acceso. Para evitar pasar el objeto de usuario a un Componente Cliente más adelante, podemos "contaminar" el objeto de usuario:
134134

135135

136136
```js
@@ -148,6 +148,6 @@ export async function getUser(id) {
148148
}
149149
```
150150

151-
Now if anyone tries to pass the `user` object to a Client Component, an error will be thrown with the passed in error message.
151+
Ahora, si alguien intenta pasar el objeto de `user` a un Componente Cliente, se lanzará un error con el mensaje de error proporcionado.
152152

153153
</DeepDive>

0 commit comments

Comments
 (0)