2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file shibsp/attribute/AttributeDecoder.h
20 * Decodes SAML NameID/Attribute objects into resolved Attributes.
23 #ifndef __shibsp_attrdecoder_h__
24 #define __shibsp_attrdecoder_h__
26 #include <shibsp/attribute/Attribute.h>
27 #include <xmltooling/XMLObject.h>
32 * Decodes XML objects into resolved Attributes.
34 class SHIBSP_API AttributeDecoder
36 MAKE_NONCOPYABLE(AttributeDecoder);
41 * @param e root of DOM to configure the decoder
43 AttributeDecoder(const xercesc::DOMElement* e);
45 /** Flag for case sensitivity of decoded attributes. */
49 virtual ~AttributeDecoder() {}
52 * Decodes an XMLObject into a resolved Attribute.
54 * @param ids array containing primary identifier in first position, followed by any aliases
55 * @param xmlObject XMLObject to decode
56 * @param assertingParty name of the party asserting the attribute
57 * @param relyingParty name of the party relying on the attribute
58 * @return a resolved Attribute, or NULL
60 virtual Attribute* decode(
61 const std::vector<std::string>& ids,
62 const xmltooling::XMLObject* xmlObject,
63 const char* assertingParty=NULL,
64 const char* relyingParty=NULL
69 /** Decodes into a SimpleAttribute. */
70 extern SHIBSP_API xmltooling::QName StringAttributeDecoderType;
72 /** Decodes into a ScopedAttribute. */
73 extern SHIBSP_API xmltooling::QName ScopedAttributeDecoderType;
75 /** Decodes into a NameIDAttribute. */
76 extern SHIBSP_API xmltooling::QName NameIDAttributeDecoderType;
78 /** Registers built-in AttributeDecoders into the runtime. */
79 void registerAttributeDecoders();
82 #endif /* __shibsp_attrdecoder_h__ */