chamilo-lms
chamilo-lms copied to clipboard
Convert user_api_key.api_service to 'default'
Current behavior
By default, it is set to 'dokeos'.
Expected behavior
Instances of that keyword have been almost completely removed and we don't want to introduce another dependency on a name. Better use 'default'. The API keys are still used in some connections to other platforms (like the Drupal module).
Chamilo Version
1.11.6, but we need to remember to migrate this in the process to upgrade to 2.0
Something like UPDATE user_api_key SET api_service = 'default' WHERE api_service = 'dokeos'.
And also update the code to use 'default'. See usermanager.lib.php::get_api_keys() and main/auth/profile.php, at least.
Eliminar user_api_key si no se usa (donde se guarda el token para rest/v2.php?)
En chamilo 1.11.x user_api_key se usa para guardar el api v2.php, pero no se usa como "dokeos" sino como MsgREST
En chamilo 2 no se usa un api key, sino que se genera un json web token.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Entonces eliminar el campo user_api_key en master (y asegurarse que la migración lo toma en cuenta)
La tabla UserApiKey no existe en master, el campo user.user_api_key no existe en master, solo queda el campo user.api_token. Y por ahora no se usa es campo.
Revisando el código de rest/v2.php, se necesita esa tabla UserApiKey para validar a los usuarios. Lo más simple sería restaurar esa tabla.
Still pending:
- [x] change creation of user_api_key records to use 'default' by default
- [x] add a migration to convert existing values
- [x] change code to check for 'default'
Changed default for user_api_key in this PR https://github.com/chamilo/chamilo-lms/pull/4371