shibboleth-3.5.0

Classes | Public Member Functions | List of all members
shibsp::NameIDAttribute Class Reference

An Attribute whose values are derived from or mappable to a SAML NameID. More...

`#include <shibsp/attribute/NameIDAttribute.h>`

Inheritance diagram for shibsp::NameIDAttribute:

## Classes
struct | Value
| Holds all the fields associated with a NameID. More...

## Public Member Functions
| NameIDAttribute (const std::vector< std::string > &ids, const char *formatter="$Name!!$NameQualifier!!$SPNameQualifier", const char *hashAlg=nullptr)
| Constructor. More...
| NameIDAttribute (DDF &in)
| Constructs based on a remoted NameIDAttribute. More...
std::vector< Value > & | getValues ()
| Returns the set of values encoded as UTF-8 strings. More...
const std::vector< Value > & | getValues () const
| Returns the set of values encoded as UTF-8 strings. More...
size_t | valueCount () const
| Returns the number of values. More...
void | clearSerializedValues ()
| Informs the Attribute that values have changed and any serializations must be cleared. More...
const char * | getString (size_t index) const
| Gets the string equivalent of the value at the specified position (starting from zero). More...
const char * | getScope (size_t index) const
| Gets the "scope" of the value at the specified position (starting from zero). More...
void | removeValue (size_t index)
| Removes the value at the specified position (starting from zero). More...
const std::vector< std::string > & | getSerializedValues () const
| Returns serialized Attribute values encoded as UTF-8 strings. More...
DDF | marshall () const
| Marshalls an Attribute for remoting. More...
Public Member Functions inherited from shibsp::Attribute
const char * | getId () const
| Returns the Attribute identifier. More...
const std::vector< std::string > & | getAliases () const
| Returns all of the effective names for the Attribute. More...
std::vector< std::string > & | getAliases ()
| Returns all of the effective names for the Attribute. More...
void | setCaseSensitive (bool caseSensitive)
| Sets whether case sensitivity should apply to basic value comparisons. More...
void | setInternal (bool internal)
| Sets whether the attribute should be exported for CGI use. More...
bool | isCaseSensitive () const
| Indicates whether case sensitivity should apply to basic value comparisons. More...
bool | isInternal () const
| Indicates whether the attribute should be exported for CGI use. More...
virtual size_t | valueCount () const
| Returns the number of values. More...
virtual const std::vector< std::string > & | getSerializedValues () const
| Returns serialized Attribute values encoded as UTF-8 strings. More...
virtual void | clearSerializedValues ()=0
| Informs the Attribute that values have changed and any serializations must be cleared. More...
virtual const char * | getString (size_t index) const
| Gets the string equivalent of the value at the specified position (starting from zero). More...
virtual const char * | getScope (size_t index) const
| Gets the "scope" of the value at the specified position (starting from zero). More...
virtual void | removeValue (size_t index)
| Removes the value at the specified position (starting from zero). More...
virtual DDF | marshall () const
| Marshalls an Attribute for remoting. More...

## Additional Inherited Members
Public Types inherited from shibsp::Attribute
typedef Attribute * | AttributeFactory(DDF &in)
| A function that unmarshalls remoted data into the proper Attribute subclass.
Static Public Member Functions inherited from shibsp::Attribute
static Attribute * | unmarshall (DDF &in)
| Unmarshalls a remoted Attribute. More...
static void | registerFactory (const char *type, AttributeFactory *factory)
| Registers an AttributeFactory function for a given attribute "type". More...
static void | deregisterFactory (const char *type)
| Deregisters an AttributeFactory function for a given attribute "type". More...
static void | deregisterFactories ()
| Clears the map of factories.
Protected Member Functions inherited from shibsp::Attribute
| Attribute (const std::vector< std::string > &ids)
| Constructor. More...
| Attribute (DDF &in)
| Constructs based on a remoted Attribute. More...
Protected Attributes inherited from shibsp::Attribute
std::vector< std::string > | m_serialized
| Maintains a copy of serialized attribute values, when possible. More...

## Detailed Description

An Attribute whose values are derived from or mappable to a SAML NameID.

## Constructor & Destructor Documentation

## ◆ NameIDAttribute() [1/2]

shibsp::NameIDAttribute::NameIDAttribute | ( | const std::vector< std::string > & | ids,
|  | const char * | formatter = `"$Name!!$NameQualifier!!$SPNameQualifier"`,
|  | const char * | hashAlg = `nullptr`
| ) |  |

Constructor.

Parameters

  ids | array with primary identifier in first position, followed by any aliases
  formatter | template for serialization of tuple
  hashAlg | hash algorithm to apply in producing serialized values

## ◆ NameIDAttribute() [2/2]

shibsp::NameIDAttribute::NameIDAttribute | ( | DDF & | in | ) |

Constructs based on a remoted NameIDAttribute.

Parameters

  in | input object containing marshalled NameIDAttribute

## Member Function Documentation

## ◆ clearSerializedValues()

void shibsp::NameIDAttribute::clearSerializedValues | ( |  | ) |
| virtual

Informs the Attribute that values have changed and any serializations must be cleared.

Implements shibsp::Attribute.

## ◆ getScope()

const char * shibsp::NameIDAttribute::getScope | ( | size_t | index | ) | const
| virtual

Gets the "scope" of the value at the specified position (starting from zero).

Parameters

  index | position of value

Returns
  the specified value's "scope", or nullptr if attribute is unscoped

Reimplemented from shibsp::Attribute.

## ◆ getSerializedValues()

const std::vector< std::string > & shibsp::NameIDAttribute::getSerializedValues | ( |  | ) | const
| virtual

Returns serialized Attribute values encoded as UTF-8 strings.

Returns
  an immutable vector of values

Reimplemented from shibsp::Attribute.

## ◆ getString()

const char * shibsp::NameIDAttribute::getString | ( | size_t | index | ) | const
| virtual

Gets the string equivalent of the value at the specified position (starting from zero).

Parameters

  index | position of value

Returns
  the specified value in its "string" form, or nullptr if undefined

Reimplemented from shibsp::Attribute.

## ◆ getValues() [1/2]

std::vector< Value > & shibsp::NameIDAttribute::getValues | ( |  | ) |

Returns the set of values encoded as UTF-8 strings.

Returns
  a mutable vector of the values

## ◆ getValues() [2/2]

const std::vector< Value > & shibsp::NameIDAttribute::getValues | ( |  | ) | const

Returns the set of values encoded as UTF-8 strings.

Returns
  an immutable vector of the values

## ◆ marshall()

DDF shibsp::NameIDAttribute::marshall | ( |  | ) | const
| virtual

Marshalls an Attribute for remoting.

This allows Attribute objects to be communicated across process boundaries without excess XML parsing. The DDF returned must be a struct containing a single list member named with the Attribute's "id". The name of the struct should contain the registered name of the Attribute implementation.

Reimplemented from shibsp::Attribute.

## ◆ removeValue()

void shibsp::NameIDAttribute::removeValue | ( | size_t | index | ) |
| virtual

Removes the value at the specified position (starting from zero).

Parameters

  index | position of value to remove

Reimplemented from shibsp::Attribute.

## ◆ valueCount()

size_t shibsp::NameIDAttribute::valueCount | ( |  | ) | const
| virtual

Returns the number of values.

Returns
  number of values

Reimplemented from shibsp::Attribute.

The documentation for this class was generated from the following file:

- shibsp/attribute/NameIDAttribute.h