[java-identity-provider] 45/51: IDP-1409 Remove PrincipalAuthenticationMethod Attribute Definition
Rod Widdowson
rdw at steadingsoftware.com
Wed Feb 6 08:43:16 EST 2019
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=356f627f5a809cc2269eccd3681b6637046a8f36
commit 356f627f5a809cc2269eccd3681b6637046a8f36
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Jan 30 17:29:00 2019 +0000
IDP-1409 Remove PrincipalAuthenticationMethod Attribute Definition
https://issues.shibboleth.net/jira/browse/IDP-1409
---
...palAuthenticationMethodAttributeDefinition.java | 61 ---------------------
...uthenticationMethodAttributeDefinitionTest.java | 63 ----------------------
2 files changed, 124 deletions(-)
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinition.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinition.java
deleted file mode 100644
index 6aab024..0000000
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.resolver.ad.impl;
-
-import java.util.Collections;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import net.shibboleth.idp.attribute.IdPAttribute;
-import net.shibboleth.idp.attribute.StringAttributeValue;
-import net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition;
-import net.shibboleth.idp.attribute.resolver.ResolutionException;
-import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
-import net.shibboleth.idp.attribute.resolver.context.AttributeResolverWorkContext;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * An attribute definition which returns an attribute with a single value - the AuthenticationMethod.
- */
-public class PrincipalAuthenticationMethodAttributeDefinition extends AbstractAttributeDefinition {
-
- /** Log. */
- private final Logger log = LoggerFactory.getLogger(PrincipalAuthenticationMethodAttributeDefinition.class);
-
- /** {@inheritDoc} */
- @SuppressWarnings("deprecation")
- @Override @Nullable protected IdPAttribute doAttributeDefinitionResolve(
- @Nonnull final AttributeResolutionContext resolutionContext,
- @Nonnull final AttributeResolverWorkContext workContext) throws ResolutionException {
-
- final String method = StringSupport.trimOrNull(resolutionContext.getPrincipalAuthenticationMethod());
-
- if (null == method) {
- log.info("{} null or empty method was returned", getLogPrefix());
- return null;
- }
-
- final IdPAttribute attribute = new IdPAttribute(getId());
- attribute.setValues(Collections.singletonList(new StringAttributeValue(method)));
- return attribute;
- }
-}
\ No newline at end of file
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinitionTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinitionTest.java
deleted file mode 100644
index 5538f7d..0000000
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/PrincipalAuthenticationMethodAttributeDefinitionTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.attribute.resolver.ad.impl;
-
-import net.shibboleth.idp.attribute.IdPAttribute;
-import net.shibboleth.idp.attribute.StringAttributeValue;
-import net.shibboleth.idp.attribute.resolver.ResolutionException;
-import net.shibboleth.idp.attribute.resolver.ad.impl.PrincipalAuthenticationMethodAttributeDefinition;
-import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
-import net.shibboleth.idp.saml.impl.TestSources;
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * Test for {@link PrincipalAuthenticationMethodAttributeDefinition}
- */
-public class PrincipalAuthenticationMethodAttributeDefinitionTest {
-
- @Test
- public void emptyMethod() throws ComponentInitializationException, ResolutionException {
- PrincipalAuthenticationMethodAttributeDefinition defn = new PrincipalAuthenticationMethodAttributeDefinition();
- defn.setId("id");
- defn.initialize();
- Assert.assertNull(defn.resolve(TestSources.createResolutionContext("princ", "issuer", "recipient")));
- }
-
- @SuppressWarnings("deprecation")
- @Test
- public void usual() throws ComponentInitializationException, ResolutionException {
- PrincipalAuthenticationMethodAttributeDefinition defn = new PrincipalAuthenticationMethodAttributeDefinition();
- defn.setId("id");
- defn.initialize();
- AttributeResolutionContext arc = TestSources.createResolutionContext("princ", "issuer", "recipient");
- arc.setPrincipalAuthenticationMethod("Method");
-
- arc.setPrincipalAuthenticationMethod("Method");
- IdPAttribute result = defn.resolve(arc);
-
- Assert.assertEquals(result.getValues().size(), 1);
-
- StringAttributeValue value = (StringAttributeValue) result.getValues().iterator().next();
- Assert.assertEquals(value.getValue(), "Method");
- }
-
-
-}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list