2 * Copyright 2001-2009 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 saml/util/CommonDomainCookie.h
20 * Helper class for maintaining discovery cookie.
23 #ifndef __saml_cdc_h__
24 #define __saml_cdc_h__
26 #include <saml/base.h>
31 #if defined (_MSC_VER)
32 #pragma warning( push )
33 #pragma warning( disable : 4250 4251 )
38 * Helper class for maintaining discovery cookie.
40 class SAML_API CommonDomainCookie {
41 MAKE_NONCOPYABLE(CommonDomainCookie);
44 * Parses a cookie for reading or writing.
46 * @param cookie the raw cookie value
48 CommonDomainCookie(const char* cookie);
50 ~CommonDomainCookie();
53 * Returns list of IdPs stored in cookie.
55 * @return reference to vector of entityIDs
57 const std::vector<std::string>& get() const;
60 * Adds/moves an IdP to the front of the list.
62 * @param entityID name of IdP to add
63 * @return new value of cookie
65 const char* set(const char* entityID);
67 /** Name of cookie ("_saml_idp") */
68 static const char CDCName[];
71 std::string m_encoded;
72 std::vector<std::string> m_list;
76 #if defined (_MSC_VER)
77 #pragma warning( pop )
80 #endif /* __saml_cdc_h__ */