This program demonstrates access control to the THttpServer with digest methods.
Authentication file auth.txt was generated with following shell commands:
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
When macro started and opening in browser with url
User name and password will be requested. One should either specify guest account without password or admin account with password 'admin'
User with guest account only can monitor histograms User with admin account see commands, which can be executed
{
TH1D *
hpx =
new TH1D(
"hpx",
"This is the px distribution",100,-4,4);
hpx->SetDirectory(
nullptr);
hpxpy->SetDirectory(
nullptr);
printf(
"Please start macro from directory where auth.txt file is available\n");
printf(
"It required to supply authentication information for the http server\n");
return;
}
serv->RegisterCommand(
"/ResetHPX",
"/hpx/->Reset();",
"button;rootsys/icons/ed_delete.png");
serv->SetItemField(
"/ResetHPX",
"_update_item",
"hpx");
serv->RegisterCommand(
"/ResetHPXPY",
"/hpxpy/->Reset();",
"button;rootsys/icons/bld_delete.png");
serv->SetItemField(
"/ResetHPXPY",
"_update_item",
"hpxpy");
serv->RegisterCommand(
"/RebinHPX",
"/hpx/->Rebin(%arg1%);",
"button;rootsys/icons/ed_execute.png");
serv->SetItemField(
"/RebinHPX",
"_update_item",
"hpx");
serv->Restrict(
"/ResetHPX",
"visible=admin");
serv->Restrict(
"/ResetHPXPY",
"visible=admin");
serv->Restrict(
"/RebinHPX",
"allow=admin");
}
}
}
R__EXTERN TSystem * gSystem
1-D histogram with a double per channel (see TH1 documentation)
2-D histogram with a double per channel (see TH1 documentation)
Online http server for arbitrary ROOT application.
Random number generator class based on M.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
- Author
- Sergey Linev
Definition in file httpaccess.C.