Class TestSources
java.lang.Object
net.shibboleth.idp.saml.impl.testing.TestSources
Basic data sources for testing the attribute generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA staticAttributeDefinitionfor testing.private static classA staticDataConnector. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.shibboleth.idp.attribute.StringAttributeValueAStringAttributeValuewith value "at1-Attribute".static final StringA value from the attribute.static final net.shibboleth.idp.attribute.StringAttributeValueAStringAttributeValuewith value "at1-Data".static final StringA value from both providers.static final StringRegexp.static final PatternaPatternderived fromCONNECTOR_ATTRIBUTE_VALUE_REGEXP.static final net.shibboleth.idp.attribute.StringAttributeValueAStringAttributeValuewith value "Connect".static final net.shibboleth.idp.attribute.StringAttributeValueAStringAttributeValuewith value "at1-Data".static final StringA value from the connector.static final StringThe name of the attribute we use as source.static final Stringa attribute connector to depend upon.static final StringThe name of another attribute we use as source.static final String"https://idp.example.org/idp".static final String"PETER_THE_PRINCIPAL".static final net.shibboleth.idp.attribute.StringAttributeValue[]Still more attributes values.static final String[]Another attributes values.static final String"https://sp.example.org/sp".static final StringThe name we use in this test for the static connector.static final StringAuthentication method for Principal method testsstatic final StringPrincipal name for Principal method testsstatic final StringRelying party name for Principal method tests -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContextcreateResolutionContext(String principal, String issuerID, String recipientId) create aAttributeResolutionContext.static net.shibboleth.idp.attribute.resolver.ResolverAttributeDefinitionDependencymakeAttributeDefinitionDependency(String attributeId) Make aResolverAttributeDefinitionDependency.static net.shibboleth.idp.attribute.resolver.ResolverDataConnectorDependencymakeDataConnectorDependency(String connectorId, String attributeId) Make aResolverDataConnectorDependency.static net.shibboleth.idp.attribute.resolver.AttributeDefinitionreturn aSAML2NameIDAttributeDefinition(which doesn't carry string atribure values)static net.shibboleth.idp.attribute.resolver.AttributeDefinitionCreate a static attribute with known values.static net.shibboleth.idp.attribute.resolver.AttributeDefinitionpopulatedStaticAttribute(String attributeName, int attributeValuesCount) static net.shibboleth.idp.attribute.resolver.AttributeDefinitionpopulatedStaticAttribute(net.shibboleth.idp.attribute.IdPAttribute attribute) Create a static attribute with known attribute.static net.shibboleth.idp.attribute.resolver.DataConnectorCreate a static connector with known attributes and values.static net.shibboleth.idp.attribute.resolver.DataConnectorpopulatedStaticConnector(List<net.shibboleth.idp.attribute.IdPAttribute> attributes) Create a static connector with provided attributes and values.
-
Field Details
-
STATIC_CONNECTOR_NAME
The name we use in this test for the static connector.- See Also:
-
DEPENDS_ON_ATTRIBUTE_NAME_ATTR
The name of the attribute we use as source.- See Also:
-
DEPENDS_ON_ATTRIBUTE_NAME_CONNECTOR
a attribute connector to depend upon.- See Also:
-
DEPENDS_ON_SECOND_ATTRIBUTE_NAME
The name of another attribute we use as source.- See Also:
-
SECOND_ATTRIBUTE_VALUE_STRINGS
Another attributes values. -
SECOND_ATTRIBUTE_VALUE_RESULTS
@Nonnull public static final net.shibboleth.idp.attribute.StringAttributeValue[] SECOND_ATTRIBUTE_VALUE_RESULTSStill more attributes values. -
COMMON_ATTRIBUTE_VALUE_STRING
A value from both providers.- See Also:
-
COMMON_ATTRIBUTE_VALUE_RESULT
@Nonnull public static final net.shibboleth.idp.attribute.StringAttributeValue COMMON_ATTRIBUTE_VALUE_RESULTAStringAttributeValuewith value "at1-Data". -
CONNECTOR_ATTRIBUTE_VALUE_STRING
A value from the connector.- See Also:
-
CONNECTOR_ATTRIBUTE_VALUE_RESULT
@Nonnull public static final net.shibboleth.idp.attribute.StringAttributeValue CONNECTOR_ATTRIBUTE_VALUE_RESULTAStringAttributeValuewith value "at1-Data". -
ATTRIBUTE_ATTRIBUTE_VALUE_STRING
A value from the attribute.- See Also:
-
ATTRIBUTE_ATTRIBUTE_VALUE_RESULT
@Nonnull public static final net.shibboleth.idp.attribute.StringAttributeValue ATTRIBUTE_ATTRIBUTE_VALUE_RESULTAStringAttributeValuewith value "at1-Attribute". -
CONNECTOR_ATTRIBUTE_VALUE_REGEXP
Regexp. for CONNECTOR_ATTRIBUTE_VALUE (for map and regexp testing).- See Also:
-
CONNECTOR_ATTRIBUTE_VALUE_REGEXP_PATTERN
aPatternderived fromCONNECTOR_ATTRIBUTE_VALUE_REGEXP. -
CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULT
@Nonnull public static final net.shibboleth.idp.attribute.StringAttributeValue CONNECTOR_ATTRIBUTE_VALUE_REGEXP_RESULTAStringAttributeValuewith value "Connect". -
TEST_PRINCIPAL
Principal name for Principal method tests- See Also:
-
TEST_RELYING_PARTY
Relying party name for Principal method tests- See Also:
-
TEST_AUTHN_METHOD
Authentication method for Principal method tests- See Also:
-
IDP_ENTITY_ID
"https://idp.example.org/idp".- See Also:
-
PRINCIPAL_ID
"PETER_THE_PRINCIPAL".- See Also:
-
SP_ENTITY_ID
"https://sp.example.org/sp".- See Also:
-
-
Constructor Details
-
TestSources
private TestSources()Constructor.
-
-
Method Details
-
populatedStaticConnector
@Nonnull public static net.shibboleth.idp.attribute.resolver.DataConnector populatedStaticConnector(@Nonnull List<net.shibboleth.idp.attribute.IdPAttribute> attributes) throws ComponentInitializationException Create a static connector with provided attributes and values.- Parameters:
attributes- the objects to populate it with- Returns:
- The connector
- Throws:
ComponentInitializationException- if we cannot initialized (unlikely)
-
populatedStaticConnector
@Nonnull public static net.shibboleth.idp.attribute.resolver.DataConnector populatedStaticConnector() throws ComponentInitializationExceptionCreate a static connector with known attributes and values.- Returns:
- The connector
- Throws:
ComponentInitializationException- if we cannot initialized (unlikely)
-
populatedStaticAttribute
@Nonnull public static net.shibboleth.idp.attribute.resolver.AttributeDefinition populatedStaticAttribute() throws ComponentInitializationExceptionCreate a static attribute with known values.- Returns:
- the attribute definition
- Throws:
ComponentInitializationException- if we cannot initialized (unlikely)
-
populatedStaticAttribute
@Nonnull public static net.shibboleth.idp.attribute.resolver.AttributeDefinition populatedStaticAttribute(@Nonnull String attributeName, int attributeValuesCount) throws ComponentInitializationException - Throws:
ComponentInitializationException
-
populatedStaticAttribute
@Nonnull public static net.shibboleth.idp.attribute.resolver.AttributeDefinition populatedStaticAttribute(@Nonnull net.shibboleth.idp.attribute.IdPAttribute attribute) throws ComponentInitializationException Create a static attribute with known attribute.- Parameters:
attribute- the input attribute- Returns:
- the attribute definition
- Throws:
ComponentInitializationException- if we cannot initialized (unlikely)
-
nonStringAttributeDefiniton
@Nonnull public static net.shibboleth.idp.attribute.resolver.AttributeDefinition nonStringAttributeDefiniton(@Nonnull String name) throws ComponentInitializationException return aSAML2NameIDAttributeDefinition(which doesn't carry string atribure values)- Parameters:
name- the name- Returns:
- the definition
- Throws:
ComponentInitializationException- for completeness
-
createResolutionContext
public static net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext createResolutionContext(@Nonnull String principal, @Nonnull String issuerID, @Nonnull String recipientId) create aAttributeResolutionContext.- Parameters:
principal- principalissuerID- issuerIDrecipientId- recipientId- Returns:
- the freshly minted context
-
makeAttributeDefinitionDependency
@Nonnull public static net.shibboleth.idp.attribute.resolver.ResolverAttributeDefinitionDependency makeAttributeDefinitionDependency(@Nonnull String attributeId) Make aResolverAttributeDefinitionDependency.- Parameters:
attributeId- attributeId- Returns:
- the dependency
-
makeDataConnectorDependency
@Nonnull public static net.shibboleth.idp.attribute.resolver.ResolverDataConnectorDependency makeDataConnectorDependency(@Nonnull String connectorId, @Nullable String attributeId) Make aResolverDataConnectorDependency.- Parameters:
connectorId- connectorIdattributeId- attributeId- Returns:
- the dependency
-