New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added changes for user credentials #392
Conversation
Hi Daniel, it is indeed perhaps a good idea if some SC people look into this too. Perhaps ACs can help out if more eyes are needed. |
terminology: "strax user account" refers to an account for strax users of the SC historians? |
Hej, thanks for the comments. This PR triggered some discussions if we should not go for a different authentication approach. Hence, it might be that the changes will never come. I will change the PR into a draft should have done this before, I am sorry about that.
|
…axen into scada_credentials
The failed test points to the test of the holoviews waveform plot. Dask dataframes are missing during import. I do not know why it is showing up now since the test was already added some time ago. |
So this PR is ready for merge, but we should wait until the next release since we have to updated the xenon config too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError(f'Cannot load SCADA information, from your xenon'
' config. SCADAInterface cannot be used.') from e
Thanks for the thorough review. I addressed your comments. We can merge this PR with the next release, have to time it a little bit though since we have to updated the xenon_config. |
What is the problem / what does the code in this PR do
In this PR we add the requirement of putting personalized user credentials before queering things from our Slow Control Historian database. The syntax has not changed much as shown in the the very last section of this notebook.
For some of our automatized services such as the online monitor and CMT we would need an additional "strax user account" which we can store in our .xenon_config file. In order to use this additional user the corresponding tools have to set a flag which is "private" to the interface and not visible from the outside.
Beside asking for the user credentials I added some quality of life features like a function to ask for the remaining time a token is valid as well as two safeguards to ensure that a query does not fail because of an expired token. In the later case a renewing of the credentials is necessary.
Further, I had to reduce the complexity of get_values. Hence, I clustered all time related checks and computations in a small helper function.