ml-tooling / contaxy

MIT License
10 stars 8 forks source link

Track last access time and user for all services via session token creation. #50

Closed JNKielmann closed 2 years ago

JNKielmann commented 2 years ago

For some use cases it is required to track the last time a contaxy service was accessed (e.g. automatically stop a service has not been used for a certain time). This PR adds the properties last_access_time and last_access_user to the Service object that track when the service was last accessed and by which user. These values can be updated via a new endpoint /projects/{project_id}/services/{service_id}:update-service-access. Additionally, they are automatically updated if a new session token for a service is requested. As the session tokens are short-lived, this will cause a regular update of the last access time if the service is actively used.

lgtm-com[bot] commented 2 years ago

This pull request introduces 1 alert when merging e5e1073e282b0bcecbc0742ec2e55756b69fc551 into c2dfc79024055a60712697434dfd27da92585935 - view on LGTM.com

new alerts: