Author: ruschein
Date: 2011-09-20 15:56:58 -0700 (Tue, 20 Sep 2011)
New Revision: 26899
Added:
csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.cc
csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.h
Modified:
csplugins/trunk/ucsd/ruschein/GSFS/progs/GSAuth.cc
csplugins/trunk/ucsd/ruschein/GSFS/progs/Makefile
Log:
Work in progress.
Modified: csplugins/trunk/ucsd/ruschein/GSFS/progs/GSAuth.cc
===================================================================
--- csplugins/trunk/ucsd/ruschein/GSFS/progs/GSAuth.cc 2011-09-20 22:47:22 UTC
(rev 26898)
+++ csplugins/trunk/ucsd/ruschein/GSFS/progs/GSAuth.cc 2011-09-20 22:56:58 UTC
(rev 26899)
@@ -3,14 +3,15 @@
#include <IniFile.h>
#include <MiscUtil.h>
#include <StringUtil.h>
+#include <UrlUtil.h>
int main(int /*argc*/, char */*argv*/[]) {
try {
const IniFile iniFile(MiscUtil::GetEnv("HOME") +
"/etc/GenomeSpace.ini");
const std::string host = iniFile.getString("",
"gsIdentityServer");
- const std::string username = iniFile.getString("",
"gsUsername");
- const std::string password = iniFile.getString("",
"gsPassword");
+ const std::string username =
UrlUtil::UrlEncode(iniFile.getString("", "gsUsername"));
+ const std::string password =
UrlUtil::UrlEncode(iniFile.getString("", "gsPassword"));
const std::string protocol = iniFile.getString("",
"gsProtocol");
const unsigned port = iniFile.getUnsigned("", "gsPort");
const std::string context = iniFile.getString("", "gsContext");
Added: csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.cc
===================================================================
--- csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.cc
(rev 0)
+++ csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.cc 2011-09-20
22:56:58 UTC (rev 26899)
@@ -0,0 +1,23 @@
+#include "GsSession.h"
+
+
+GsSession::GsSession(): isInitialised_(false) {
+}
+
+
+GsSession::GsSession(const std::string &token): isInitialised_(false) {
+ token_ = token;
+}
+
+
+bool GsSession::login(const std::string &/*username*/, const std::string
&/*password*/) {
+ if (!isInitialised_)
+ initialise();
+
+ return true;
+}
+
+
+void GsSession::initialise() {
+ isInitialised_ = true;
+}
Added: csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.h
===================================================================
--- csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.h
(rev 0)
+++ csplugins/trunk/ucsd/ruschein/GSFS/progs/GsSession.h 2011-09-20
22:56:58 UTC (rev 26899)
@@ -0,0 +1,35 @@
+#ifndef GS_SESSION_H
+#define GS_SESSION_H
+
+
+#include <string>
+
+
+class GsSession {
+ /*
+ * The GenomeSpace login token. It contains the username and an
expiration
+ * date/time.
+ */
+ std::string token_;
+
+ bool isInitialised_;
+
+ std::string identityServiceUrl_;
+ std::string dataManagerServiceUrl_;
+public:
+ /**
+ * Basic constructor uses the default URL for the Identity Service.
+ */
+ GsSession();
+
+ GsSession(const std::string &token);
+
+ bool login(const std::string &username, const std::string &password);
+private:
+ void initialise();
+};
+
+
+#endif // ifndef GS_SESSION_H
+
+
Modified: csplugins/trunk/ucsd/ruschein/GSFS/progs/Makefile
===================================================================
--- csplugins/trunk/ucsd/ruschein/GSFS/progs/Makefile 2011-09-20 22:47:22 UTC
(rev 26898)
+++ csplugins/trunk/ucsd/ruschein/GSFS/progs/Makefile 2011-09-20 22:56:58 UTC
(rev 26899)
@@ -18,5 +18,8 @@
GSAuth.o: GSAuth.cc
$(CXX) $(CXXFLAGS) -c $<
+GsSession.o: GsSession.cc GsSession.h
+ $(CXX) $(CXXFLAGS) -I. -c $<
+
clean:
rm -f *.o *~ $(PROGS)
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.