Warning, file /include/root/TSecContext.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TSecContext
0013 #define ROOT_TSecContext
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include "TObject.h"
0026 #include "TString.h"
0027 #include "TDatime.h"
0028
0029
0030 R__EXTERN const TDatime kROOTTZERO;
0031
0032
0033 class TSecContextCleanup;
0034 class TPwdCtx;
0035
0036 class TSecContext : public TObject {
0037
0038 friend class TRootSecContext;
0039
0040 private:
0041 void *fContext;
0042 TList *fCleanup;
0043 TDatime fExpDate;
0044 TString fHost;
0045 TString fID;
0046 Int_t fMethod;
0047 TString fMethodName;
0048 Int_t fOffSet;
0049 TString fToken;
0050 TString fUser;
0051
0052 virtual Bool_t CleanupSecContext(Bool_t all);
0053 void Cleanup();
0054
0055 protected:
0056 TSecContext(const TSecContext&);
0057 TSecContext& operator=(const TSecContext&);
0058
0059 public:
0060
0061 TSecContext(const char *url, Int_t meth, Int_t offset,
0062 const char *id, const char *token,
0063 TDatime expdate = kROOTTZERO, void *ctx = nullptr);
0064 TSecContext(const char *user, const char *host, Int_t meth, Int_t offset,
0065 const char *id, const char *token,
0066 TDatime expdate = kROOTTZERO, void *ctx = nullptr);
0067 virtual ~TSecContext();
0068
0069 void AddForCleanup(Int_t port, Int_t proto, Int_t type);
0070 virtual const char *AsString(TString &out);
0071
0072 virtual void DeActivate(Option_t *opt = "CR");
0073 void *GetContext() const { return fContext; }
0074 TDatime GetExpDate() const { return fExpDate; }
0075 const char *GetHost() const { return fHost; }
0076 const char *GetID() const { return fID; }
0077 Int_t GetMethod() const { return fMethod; }
0078 const char *GetMethodName() const { return fMethodName; }
0079 Int_t GetOffSet() const { return fOffSet; }
0080 TList *GetSecContextCleanup() const { return fCleanup; }
0081 const char *GetToken() const { return fToken; }
0082 const char *GetUser() const { return fUser; }
0083
0084 Bool_t IsA(const char *methodname);
0085 Bool_t IsActive() const;
0086
0087 void Print(Option_t *option = "F") const override;
0088
0089 void SetExpDate(TDatime expdate) { fExpDate= expdate; }
0090 void SetID(const char *id) { fID= id; }
0091 void SetOffSet(Int_t offset) { fOffSet = offset; }
0092 void SetUser(const char *user) { fUser = user; }
0093
0094 ClassDefOverride(TSecContext,0)
0095 };
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 class TSecContextCleanup : public TObject {
0109
0110 private:
0111 Int_t fPort;
0112 Int_t fServerProtocol;
0113 Int_t fServerType;
0114
0115 public:
0116 TSecContextCleanup(Int_t port, Int_t proto, Int_t type) :
0117 fPort(port), fServerProtocol(proto), fServerType(type) { };
0118 virtual ~TSecContextCleanup() { };
0119
0120 Int_t GetPort() const { return fPort; }
0121 Int_t GetProtocol() const { return fServerProtocol; }
0122 Int_t GetType() const { return fServerType; }
0123
0124 ClassDefOverride(TSecContextCleanup,0)
0125 };
0126
0127
0128
0129
0130
0131
0132 class TPwdCtx {
0133
0134 private:
0135 TString fPasswd;
0136 Bool_t fPwHash;
0137
0138 public:
0139 TPwdCtx(const char *pwd, Bool_t pwh): fPasswd(pwd), fPwHash(pwh) {};
0140 virtual ~TPwdCtx() {};
0141
0142 const char *GetPasswd() const { return fPasswd; }
0143 Bool_t IsPwHash() const { return fPwHash; }
0144
0145 };
0146
0147
0148 #endif