diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-02-01 15:10:19 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-01 15:10:19 -0800 |
commit | fe71dd340ab396b93bde45df438041af5d85fd47 (patch) | |
tree | b07b92b80e5a8f113252ea0b650684567557c851 /indra/newview/llsecapi.cpp | |
parent | 1a9d19d95527d717b89d4ebf45af81824fcbdf44 (diff) |
Merge giab-viewer-trunk 2497, general merge of more
secapi stuff as well as certificate handling stuff.
Grid manager as well
Diffstat (limited to 'indra/newview/llsecapi.cpp')
-rw-r--r-- | indra/newview/llsecapi.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index c2cfde0dc7..cdf4a3fe01 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -38,11 +38,17 @@ std::map<std::string, LLPointer<LLSecAPIHandler> > gHandlerMap; - +LLPointer<LLSecAPIHandler> gSecAPIHandler; void initializeSecHandler() { gHandlerMap[BASIC_SECHANDLER] = new LLSecAPIBasicHandler(); + + // Currently, we only have the Basic handler, so we can point the main sechandler + // pointer to the basic handler. Later, we'll create a wrapper handler that + // selects the appropriate sechandler as needed, for instance choosing the + // mac keyring handler, with fallback to the basic sechandler + gSecAPIHandler = gHandlerMap[BASIC_SECHANDLER]; } // start using a given security api handler. If the string is empty // the default is used @@ -64,6 +70,28 @@ void registerSecHandler(const std::string& handler_type, gHandlerMap[handler_type] = handler; } +std::ostream& operator <<(std::ostream& s, const LLCredential& cred) +{ + return s << (std::string)cred; +} - +LLSD LLCredential::getLoginParams() +{ + LLSD result = LLSD::emptyMap(); + if (mIdentifier["type"].asString() == "agent") + { + // legacy credential + result["passwd"] = "$1$" + mAuthenticator["secret"].asString(); + result["first"] = mIdentifier["first_name"]; + result["last"] = mIdentifier["last_name"]; + + } + else if (mIdentifier["type"].asString() == "account") + { + result["username"] = mIdentifier["username"]; + result["passwd"] = mAuthenticator["secret"]; + + } + return result; +} |