ml-tooling / contaxy

MIT License
10 stars 8 forks source link

Add API Token to each service/job which allows access to itself #27

Closed JNKielmann closed 3 years ago

JNKielmann commented 3 years ago

Some service require a token that allows access to the service itself. For example, a ML workspace service needs this token to build the SSH setup command (the token has to be included in a curl call that downloads the setup script from the workspace). This PR adds the environment variable CONTAXY_API_TOKEN to each service which includes a token that provides read access to this service. For this, the AuthManager needs to be passed down through several function calls. In the get_default_environment_variables function it is then used to generate the token.

Note: The user creating the service will be used as the token subject. I don't know if this can cause issue but I think the service itself cannot be a token subject at the moment?