using namespace std;\r
\r
namespace shibsp {\r
+ static const XMLCh Scope[] = UNICODE_LITERAL_5(S,c,o,p,e);\r
+ static const XMLCh scopeDelimeter[] = UNICODE_LITERAL_14(s,c,o,p,e,D,e,l,i,m,e,t,e,r);\r
+\r
class SHIBSP_DLLLOCAL ScopedAttributeDecoder : virtual public AttributeDecoder\r
{\r
public:\r
- ScopedAttributeDecoder(const DOMElement* e) {}\r
+ ScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@') {\r
+ if (e) {\r
+ if (e->hasAttributeNS(NULL,scopeDelimeter)) {\r
+ auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));\r
+ m_delimeter = *(d.get());\r
+ }\r
+ }\r
+ }\r
~ScopedAttributeDecoder() {}\r
\r
shibsp::Attribute* decode(\r
const char* id, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL\r
) const;\r
+\r
+ private:\r
+ char m_delimeter;\r
};\r
\r
AttributeDecoder* SHIBSP_DLLLOCAL ScopedAttributeDecoderFactory(const DOMElement* const & e)\r
{\r
return new ScopedAttributeDecoder(e);\r
}\r
-\r
- static const XMLCh Scope[] = UNICODE_LITERAL_5(S,c,o,p,e);\r
};\r
\r
shibsp::Attribute* ScopedAttributeDecoder::decode(\r
const XMLCh* xmlscope;\r
QName scopeqname(NULL,Scope);\r
auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(id));\r
+ scoped->setCaseSensitive(m_caseSensitive);\r
vector< pair<string,string> >& dest = scoped->getValues();\r
vector<XMLObject*>::const_iterator v,stop;\r
\r
delete[] scope;\r
}\r
else {\r
- scope = strchr(val, '@');\r
+ scope = strchr(val, m_delimeter);\r
if (scope) {\r
*scope++ = 0;\r
if (*scope)\r
}\r
}\r
\r
- if (val && *val && *val!='@') {\r
- scope = strchr(val, '@');\r
+ if (val && *val && *val!=m_delimeter) {\r
+ scope = strchr(val, m_delimeter);\r
if (scope) {\r
*scope++ = 0;\r
if (*scope)\r
log.warn("ignoring NameID with no scope");\r
}\r
else {\r
- log.warn("ignoring NameID with no scope delimiter (@)");\r
+ log.warn("ignoring NameID with no scope delimiter (%c)", m_delimeter);\r
}\r
}\r
else {\r