`TupleKey` should support `relation=None`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 85
- Forks
- 36
- Merge medio
- 3 h 8 min
- PR fusionados (30 d)
- 3
Descripción
Checklist
- I have looked into the README and have not found a suitable solution or answer.
- I have looked into the documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have upgraded to the latest version of OpenFGA and the issue still persists.
- I have searched the Slack community and have not found a suitable solution or answer.
- I agree to the terms within the OpenFGA Code of Conduct.
Description
The docs describe how to use the read() method with a TupleKey with no relation set to get a list of all relations a user has with an object. Currently the TupleKey object validation prevents the relation from being None.
Expectation
Not to throw an error when omitting relation or setting to None.
Reproduction
Essentially the code from the docs:
body = TupleKey(
user="user:bob",
object="document:123",
)
Working around the validation and submitting the query confirms the behavior describes from the docs (i.e., listing the relations) works as expected:
Issuing a query with a workaround:
body = TupleKey(
user="user:bob",
relation="",
object="document:123",
)
body._relation = None
# call `read(body)` ...
OpenFGA SDK version
0.4.0 (but the code in main appears broken)
OpenFGA version
v1.5.0
SDK Configuration
[default options]
Logs
No response
References
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en openfga_sdk/models/tuple_key.py, en la validación de TupleKey a la que hace referencia el issue, y luego reproduce el ejemplo de la documentación con read(). Se considera terminado cuando construir TupleKey con relation omitida o establecida en None ya no genere un error y la consulta de relaciones pueda enumerar las relaciones del usuario.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- authorization
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 42/100