[2/3] cxf git commit: Improving bean validation annotations support for @MatrixPatam and @BeanParam fields
Improving bean validation annotations support for @MatrixPatam and @BeanParam fields Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8a765e0b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8a765e0b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8a765e0b Branch: refs/heads/master Commit: 8a765e0b49200ccc5bab5a5290e826b15528899f Parents: 4eede5f Author: Francesco ChicchiriccòAuthored: Fri Dec 4 10:16:11 2015 +0100 Committer: Francesco Chicchiriccò Committed: Fri Dec 4 10:16:35 2015 +0100 -- .../cxf/jaxrs/swagger/JaxRs2Extension.java | 85 +--- 1 file changed, 37 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8a765e0b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java -- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java index b89a5e9..87e0cf2 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java @@ -46,8 +46,8 @@ import io.swagger.converter.ModelConverters; import io.swagger.jaxrs.ext.AbstractSwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtensions; +import io.swagger.models.parameters.AbstractSerializableParameter; import io.swagger.models.parameters.Parameter; -import io.swagger.models.properties.AbstractNumericProperty; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; import io.swagger.models.properties.RefProperty; @@ -80,6 +80,7 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { if (schema != null) { mp.setProperty(schema); } +applyBeanValidatorAnnotations(mp, annotations); parameters.add(mp); } else if (annotation instanceof BeanParam) { // Use Jackson's logic for processing Beans @@ -163,72 +164,60 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { /** * This is essentially a duplicate of {@link io.swagger.jackson.ModelResolver.applyBeanValidatorAnnotations}. * - * @param property + * @param parameter * @param annotations */ -private void applyBeanValidatorAnnotations(final Parameter property, final List annotations) { +private void applyBeanValidatorAnnotations(final Parameter parameter, final List annotations) { Map annos = new HashMap<>(); if (annotations != null) { for (Annotation annotation : annotations) { annos.put(annotation.annotationType().getName(), annotation); } } + if (annos.containsKey(NotNull.class.getName())) { -property.setRequired(true); -} -if (annos.containsKey(Min.class.getName()) && property instanceof AbstractNumericProperty) { -Min min = (Min) annos.get(Min.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(min.value())); -} -if (annos.containsKey(Max.class.getName()) && property instanceof AbstractNumericProperty) { -Max max = (Max) annos.get(Max.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMaximum(new Double(max.value())); +parameter.setRequired(true); } -if (annos.containsKey(Size.class.getName())) { -Size size = (Size) annos.get(Size.class.getName()); -if (property instanceof AbstractNumericProperty) { -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(size.min())); -ap.setMaximum(new Double(size.max())); -} else if (property instanceof StringProperty) { -StringProperty sp = (StringProperty) property; -sp.minLength(size.min()); -sp.maxLength(size.max()); -} else if (property instanceof ArrayProperty) { -ArrayProperty sp = (ArrayProperty) property; -sp.setMinItems(size.min()); -sp.setMaxItems(size.max()); + +if (parameter instanceof AbstractSerializableParameter) { +AbstractSerializableParameter serializable = (AbstractSerializableParameter) parameter; + +if
[1/3] cxf git commit: [CXF-6695] Improving bean validation annotations support for @MatrixPatam and @BeanParam fields
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 98f176f5b -> d2a2a2494 refs/heads/3.1.x-fixes 3df27048c -> 8a9952073 refs/heads/master 4eede5fc4 -> 8a765e0b4 [CXF-6695] Improving bean validation annotations support for @MatrixPatam and @BeanParam fields Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8a995207 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8a995207 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8a995207 Branch: refs/heads/3.1.x-fixes Commit: 8a9952073cf5edffd848c43d63ac173a2c7455a5 Parents: 3df2704 Author: Francesco ChicchiriccòAuthored: Fri Dec 4 10:16:11 2015 +0100 Committer: Francesco Chicchiriccò Committed: Fri Dec 4 10:16:11 2015 +0100 -- .../cxf/jaxrs/swagger/JaxRs2Extension.java | 85 +--- 1 file changed, 37 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8a995207/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java -- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java index b89a5e9..87e0cf2 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java @@ -46,8 +46,8 @@ import io.swagger.converter.ModelConverters; import io.swagger.jaxrs.ext.AbstractSwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtensions; +import io.swagger.models.parameters.AbstractSerializableParameter; import io.swagger.models.parameters.Parameter; -import io.swagger.models.properties.AbstractNumericProperty; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; import io.swagger.models.properties.RefProperty; @@ -80,6 +80,7 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { if (schema != null) { mp.setProperty(schema); } +applyBeanValidatorAnnotations(mp, annotations); parameters.add(mp); } else if (annotation instanceof BeanParam) { // Use Jackson's logic for processing Beans @@ -163,72 +164,60 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { /** * This is essentially a duplicate of {@link io.swagger.jackson.ModelResolver.applyBeanValidatorAnnotations}. * - * @param property + * @param parameter * @param annotations */ -private void applyBeanValidatorAnnotations(final Parameter property, final List annotations) { +private void applyBeanValidatorAnnotations(final Parameter parameter, final List annotations) { Map annos = new HashMap<>(); if (annotations != null) { for (Annotation annotation : annotations) { annos.put(annotation.annotationType().getName(), annotation); } } + if (annos.containsKey(NotNull.class.getName())) { -property.setRequired(true); -} -if (annos.containsKey(Min.class.getName()) && property instanceof AbstractNumericProperty) { -Min min = (Min) annos.get(Min.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(min.value())); -} -if (annos.containsKey(Max.class.getName()) && property instanceof AbstractNumericProperty) { -Max max = (Max) annos.get(Max.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMaximum(new Double(max.value())); +parameter.setRequired(true); } -if (annos.containsKey(Size.class.getName())) { -Size size = (Size) annos.get(Size.class.getName()); -if (property instanceof AbstractNumericProperty) { -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(size.min())); -ap.setMaximum(new Double(size.max())); -} else if (property instanceof StringProperty) { -StringProperty sp = (StringProperty) property; -sp.minLength(size.min()); -sp.maxLength(size.max()); -} else if (property instanceof ArrayProperty) { -ArrayProperty sp = (ArrayProperty) property; -sp.setMinItems(size.min()); -sp.setMaxItems(size.max()); + +if (parameter
[3/3] cxf git commit: [CXF-6695] Improving bean validation annotations support for @MatrixPatam and @BeanParam fields
[CXF-6695] Improving bean validation annotations support for @MatrixPatam and @BeanParam fields Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d2a2a249 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d2a2a249 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d2a2a249 Branch: refs/heads/3.0.x-fixes Commit: d2a2a2494799becde52f50e3edfb80bfc79b4dda Parents: 98f176f Author: Francesco ChicchiriccòAuthored: Fri Dec 4 10:27:24 2015 +0100 Committer: Francesco Chicchiriccò Committed: Fri Dec 4 10:27:24 2015 +0100 -- .../cxf/jaxrs/swagger/JaxRs2Extension.java | 85 +--- 1 file changed, 37 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/d2a2a249/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java -- diff --git a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java index bba367f..fc76cfc 100644 --- a/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java +++ b/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/swagger/JaxRs2Extension.java @@ -46,8 +46,8 @@ import io.swagger.converter.ModelConverters; import io.swagger.jaxrs.ext.AbstractSwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtension; import io.swagger.jaxrs.ext.SwaggerExtensions; +import io.swagger.models.parameters.AbstractSerializableParameter; import io.swagger.models.parameters.Parameter; -import io.swagger.models.properties.AbstractNumericProperty; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; import io.swagger.models.properties.RefProperty; @@ -80,6 +80,7 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { if (schema != null) { mp.setProperty(schema); } +applyBeanValidatorAnnotations(mp, annotations); parameters.add(mp); } else if (annotation instanceof BeanParam) { // Use Jackson's logic for processing Beans @@ -163,72 +164,60 @@ public class JaxRs2Extension extends AbstractSwaggerExtension { /** * This is essentially a duplicate of {@link io.swagger.jackson.ModelResolver.applyBeanValidatorAnnotations}. * - * @param property + * @param parameter * @param annotations */ -private void applyBeanValidatorAnnotations(final Parameter property, final List annotations) { +private void applyBeanValidatorAnnotations(final Parameter parameter, final List annotations) { Map annos = new HashMap (); if (annotations != null) { for (Annotation annotation : annotations) { annos.put(annotation.annotationType().getName(), annotation); } } + if (annos.containsKey(NotNull.class.getName())) { -property.setRequired(true); -} -if (annos.containsKey(Min.class.getName()) && property instanceof AbstractNumericProperty) { -Min min = (Min) annos.get(Min.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(min.value())); -} -if (annos.containsKey(Max.class.getName()) && property instanceof AbstractNumericProperty) { -Max max = (Max) annos.get(Max.class.getName()); -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMaximum(new Double(max.value())); +parameter.setRequired(true); } -if (annos.containsKey(Size.class.getName())) { -Size size = (Size) annos.get(Size.class.getName()); -if (property instanceof AbstractNumericProperty) { -AbstractNumericProperty ap = (AbstractNumericProperty) property; -ap.setMinimum(new Double(size.min())); -ap.setMaximum(new Double(size.max())); -} else if (property instanceof StringProperty) { -StringProperty sp = (StringProperty) property; -sp.minLength(size.min()); -sp.maxLength(size.max()); -} else if (property instanceof ArrayProperty) { -ArrayProperty sp = (ArrayProperty) property; -sp.setMinItems(size.min()); -sp.setMaxItems(size.max()); + +if (parameter instanceof AbstractSerializableParameter) { +AbstractSerializableParameter serializable = (AbstractSerializableParameter) parameter; + +
cxf git commit: Bearer token type must be upper-case (was lower case in early drafts), as well spotted by Jan
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 9f20e99ff -> 48ecb0fce Bearer token type must be upper-case (was lower case in early drafts), as well spotted by Jan Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/48ecb0fc Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/48ecb0fc Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/48ecb0fc Branch: refs/heads/3.1.x-fixes Commit: 48ecb0fced1dd2e3a68f1f0785e1ced275895aee Parents: 9f20e99 Author: Sergey BeryozkinAuthored: Fri Dec 4 15:39:23 2015 + Committer: Sergey Beryozkin Committed: Fri Dec 4 15:50:13 2015 + -- .../apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java | 4 ++-- .../org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java | 2 +- .../cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/48ecb0fc/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java index 9d19af9..e00ce0b 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java @@ -409,11 +409,11 @@ public final class OAuthClientUtils { throws OAuthServiceException { // this should all be handled by token specific serializers String tokenType = token.getTokenType().toLowerCase(); -if (OAuthConstants.BEARER_TOKEN_TYPE.equals(tokenType)) { +if (OAuthConstants.BEARER_TOKEN_TYPE.equalsIgnoreCase(tokenType)) { sb.append(OAuthConstants.BEARER_AUTHORIZATION_SCHEME); sb.append(" "); sb.append(token.getTokenKey()); -} else if (OAuthConstants.HAWK_TOKEN_TYPE.equals(tokenType)) { +} else if (OAuthConstants.HAWK_TOKEN_TYPE.equalsIgnoreCase(tokenType)) { if (httpProps == null) { throw new IllegalArgumentException("MAC scheme requires HTTP Request properties"); } http://git-wip-us.apache.org/repos/asf/cxf/blob/48ecb0fc/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java index 8a5d457..8a98eff 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java @@ -55,7 +55,7 @@ public final class OAuthConstants { public static final String DIRECT_TOKEN_GRANT = "urn:ietf:params:oauth:grant-type:direct-token-grant"; // Well-known token types -public static final String BEARER_TOKEN_TYPE = "bearer"; +public static final String BEARER_TOKEN_TYPE = "Bearer"; public static final String HAWK_TOKEN_TYPE = "hawk"; // https://tools.ietf.org/html/rfc7636 http://git-wip-us.apache.org/repos/asf/cxf/blob/48ecb0fc/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java index 988d329..7d04c7d 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java +++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java @@ -86,7 +86,7 @@ public class OAuthJSONProviderTest extends Assert { new MetadataMap (), new ByteArrayInputStream(response.getBytes())); assertEquals("1234", token.getTokenKey()); -assertEquals(expectedTokenType, token.getTokenType()); +
cxf git commit: Bearer token type must be upper-case (was lower case in early drafts), as well spotted by Jan
Repository: cxf Updated Branches: refs/heads/master f94e1dd9b -> 0b9ce1c16 Bearer token type must be upper-case (was lower case in early drafts), as well spotted by Jan Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0b9ce1c1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0b9ce1c1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0b9ce1c1 Branch: refs/heads/master Commit: 0b9ce1c16e77a43aaa188553a601105545e59b0b Parents: f94e1dd Author: Sergey BeryozkinAuthored: Fri Dec 4 15:39:23 2015 + Committer: Sergey Beryozkin Committed: Fri Dec 4 15:39:23 2015 + -- .../apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java | 4 ++-- .../org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java | 2 +- .../cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java index 9d19af9..e00ce0b 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java @@ -409,11 +409,11 @@ public final class OAuthClientUtils { throws OAuthServiceException { // this should all be handled by token specific serializers String tokenType = token.getTokenType().toLowerCase(); -if (OAuthConstants.BEARER_TOKEN_TYPE.equals(tokenType)) { +if (OAuthConstants.BEARER_TOKEN_TYPE.equalsIgnoreCase(tokenType)) { sb.append(OAuthConstants.BEARER_AUTHORIZATION_SCHEME); sb.append(" "); sb.append(token.getTokenKey()); -} else if (OAuthConstants.HAWK_TOKEN_TYPE.equals(tokenType)) { +} else if (OAuthConstants.HAWK_TOKEN_TYPE.equalsIgnoreCase(tokenType)) { if (httpProps == null) { throw new IllegalArgumentException("MAC scheme requires HTTP Request properties"); } http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java index 8a5d457..8a98eff 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java @@ -55,7 +55,7 @@ public final class OAuthConstants { public static final String DIRECT_TOKEN_GRANT = "urn:ietf:params:oauth:grant-type:direct-token-grant"; // Well-known token types -public static final String BEARER_TOKEN_TYPE = "bearer"; +public static final String BEARER_TOKEN_TYPE = "Bearer"; public static final String HAWK_TOKEN_TYPE = "hawk"; // https://tools.ietf.org/html/rfc7636 http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java index 988d329..7d04c7d 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java +++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java @@ -86,7 +86,7 @@ public class OAuthJSONProviderTest extends Assert { new MetadataMap (), new ByteArrayInputStream(response.getBytes())); assertEquals("1234", token.getTokenKey()); -assertEquals(expectedTokenType, token.getTokenType()); +
cxf git commit: Some trivial fixes
Repository: cxf Updated Branches: refs/heads/master 8a765e0b4 -> 9f8ff0cc0 Some trivial fixes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9f8ff0cc Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9f8ff0cc Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9f8ff0cc Branch: refs/heads/master Commit: 9f8ff0cc036d16782dd39ab377afebaa5a0995b0 Parents: 8a765e0 Author: Colm O hEigeartaighAuthored: Fri Dec 4 12:38:49 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 12:38:49 2015 + -- .../cxf/rs/security/oauth2/filters/OAuthRequestFilter.java | 2 +- .../security/oauth2/services/AuthorizationCodeGrantService.java | 4 ++-- .../java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/9f8ff0cc/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java index d1a479c..ae34c58 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java @@ -110,7 +110,7 @@ public class OAuthRequestFilter extends AbstractAccessTokenValidator } } -if (permissions.size() > 0 && matchingPermissions.isEmpty() +if (!permissions.isEmpty() && matchingPermissions.isEmpty() || allPermissionsMatch && (matchingPermissions.size() != permissions.size()) || !requiredScopes.isEmpty() && requiredScopes.size() != matchingPermissions.size()) { String message = "Client has no valid permissions"; http://git-wip-us.apache.org/repos/asf/cxf/blob/9f8ff0cc/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java index 79559c7..b95eae7 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java @@ -53,7 +53,7 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; */ @Path("/authorize") public class AuthorizationCodeGrantService extends RedirectionBasedGrantService { -private static final Integer RECOMMENDED_CODE_EXPIRY_TIME_MINS = 10; +private static final long RECOMMENDED_CODE_EXPIRY_TIME_SECS = 10L * 60L; private boolean canSupportPublicClients; private boolean canSupportEmptyRedirectForPrivateClients; private OOBResponseDeliverer oobDeliverer; @@ -122,7 +122,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService } catch (OAuthServiceException ex) { return createErrorResponse(state.getState(), state.getRedirectUri(), OAuthConstants.ACCESS_DENIED); } -if (grant.getExpiresIn() / 60 > RECOMMENDED_CODE_EXPIRY_TIME_MINS) { +if (grant.getExpiresIn() > RECOMMENDED_CODE_EXPIRY_TIME_SECS) { LOG.warning("Code expiry time exceeds 10 minutes"); } String grantCode = processCodeGrant(client, grant.getCode(), grant.getSubject()); http://git-wip-us.apache.org/repos/asf/cxf/blob/9f8ff0cc/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java index 65a01fa..5e8ed8a 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java @@ -182,12 +182,12 @@ public
[1/2] cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes d2a2a2494 -> 90789cc21 Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/90789cc2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/90789cc2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/90789cc2 Branch: refs/heads/3.0.x-fixes Commit: 90789cc21ac50388c0670e66fd61f9aa161e8da0 Parents: 8e39d46 Author: Colm O hEigeartaighAuthored: Fri Dec 4 12:46:00 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 12:46:00 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/90789cc2/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 16b12ad..9091f53 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -735,6 +735,7 @@ M 9edf90a691627ac9ccbda2ec887f8bb4c7f9d1a2 M 9f18da888e37f203b1aa9a3240ed7b6aab3a4ef9 M 9fc3be7e5afe6d2a06a4be37fada1ac14f9c4f86 M a088c793efd923a52f68044b02221f8b47569ef9 +M a1a16ca1719aef85aa038e6538d451808852bc97 M a2c4be5e99472fc23b1740fc594e5d4c64961ca4 M a3bf2a80bafa95ec2ccdd2b28ead26c13866acd7 M a400eaa95b977c292162e69434b98ebbf578febd
cxf git commit: Moving Permission functionality into OAuthPermission
Repository: cxf Updated Branches: refs/heads/master 9f8ff0cc0 -> f94e1dd9b Moving Permission functionality into OAuthPermission Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f94e1dd9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f94e1dd9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f94e1dd9 Branch: refs/heads/master Commit: f94e1dd9b2a8d27ec5a27bfb7c026e3ae2350e39 Parents: 9f8ff0c Author: Colm O hEigeartaighAuthored: Fri Dec 4 14:35:00 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 14:35:00 2015 + -- .../oauth2/common/OAuthAuthorizationData.java | 10 +- .../security/oauth2/common/OAuthPermission.java | 73 - .../rs/security/oauth2/common/Permission.java | 106 --- 3 files changed, 76 insertions(+), 113 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/f94e1dd9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java index 05dc72c..d71b228 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthAuthorizationData.java @@ -48,7 +48,7 @@ public class OAuthAuthorizationData extends OAuthRedirectionState implements Ser private Map extraApplicationProperties = new HashMap (); private boolean implicitFlow; -private List permissions; +private List permissions; public OAuthAuthorizationData() { } @@ -74,15 +74,15 @@ public class OAuthAuthorizationData extends OAuthRedirectionState implements Ser * requested by the client application * @return the list of scopes */ -public List getPermissions() { +public List getPermissions() { return permissions; } /** - * Gets the list of scopes translated to {@link Permission} instances - * @return the list of scopses + * Gets the list of scopes translated to {@link OAuthPermission} instances + * @return the list of scopes **/ -public void setPermissions(List permissions) { +public void setPermissions(List permissions) { this.permissions = permissions; } http://git-wip-us.apache.org/repos/asf/cxf/blob/f94e1dd9/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 0aaf300..1be8106 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -18,6 +18,7 @@ */ package org.apache.cxf.rs.security.oauth2.common; +import java.io.Serializable; import java.util.LinkedList; import java.util.List; @@ -31,17 +32,22 @@ import javax.xml.bind.annotation.XmlRootElement; * a limited set of HTTP verbs and request URIs */ @XmlRootElement -public class OAuthPermission extends Permission { +public class OAuthPermission implements Serializable { private static final long serialVersionUID = -6486616235830491290L; private List httpVerbs = new LinkedList(); private List uris = new LinkedList(); +private String permission; +private String description; +private boolean isDefault; +private boolean invisibleToClient; public OAuthPermission() { } public OAuthPermission(String permission, String description) { -super(permission, description); +this.description = description; +this.permission = permission; } /** @@ -77,4 +83,67 @@ public class OAuthPermission extends Permission { return uris; } +/** + * Gets the permission description + * @return the description + */ +public String getDescription() { +return description; +} + +/** + * Sets the permission description + * @param description + */ +public void
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes a1a16ca17 -> 9f20e99ff Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9f20e99f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9f20e99f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9f20e99f Branch: refs/heads/3.1.x-fixes Commit: 9f20e99ffb13906a83c6a39bb16ceb3708c36f46 Parents: a1a16ca Author: Colm O hEigeartaighAuthored: Fri Dec 4 14:36:40 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 14:36:40 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/9f20e99f/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index e195f7c..28a0a76 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -10,4 +10,5 @@ B a7362dfaf2141cb4f303f81bbb94c6df81be75cb B ced98c6e937bd93f92dac9043fa0406c696bfd84 B f0e08b7bea2660542e18294d490e68c7b14aaa4b B f1b56150d6520e73d2ade2296c3b2f13839e63e5 +B f94e1dd9b2a8d27ec5a27bfb7c026e3ae2350e39 B fb30f8bffc85fcc3208fcc0e1eda4b54a89b5d37
cxf git commit: Some trivial fixes
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 8a9952073 -> a1a16ca17 Some trivial fixes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a1a16ca1 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a1a16ca1 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a1a16ca1 Branch: refs/heads/3.1.x-fixes Commit: a1a16ca1719aef85aa038e6538d451808852bc97 Parents: 8a99520 Author: Colm O hEigeartaighAuthored: Fri Dec 4 12:38:49 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 12:45:43 2015 + -- .../cxf/rs/security/oauth2/filters/OAuthRequestFilter.java | 2 +- .../security/oauth2/services/AuthorizationCodeGrantService.java | 4 ++-- .../java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/a1a16ca1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java index d1a479c..ae34c58 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java @@ -110,7 +110,7 @@ public class OAuthRequestFilter extends AbstractAccessTokenValidator } } -if (permissions.size() > 0 && matchingPermissions.isEmpty() +if (!permissions.isEmpty() && matchingPermissions.isEmpty() || allPermissionsMatch && (matchingPermissions.size() != permissions.size()) || !requiredScopes.isEmpty() && requiredScopes.size() != matchingPermissions.size()) { String message = "Client has no valid permissions"; http://git-wip-us.apache.org/repos/asf/cxf/blob/a1a16ca1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java index 79559c7..b95eae7 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java @@ -53,7 +53,7 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; */ @Path("/authorize") public class AuthorizationCodeGrantService extends RedirectionBasedGrantService { -private static final Integer RECOMMENDED_CODE_EXPIRY_TIME_MINS = 10; +private static final long RECOMMENDED_CODE_EXPIRY_TIME_SECS = 10L * 60L; private boolean canSupportPublicClients; private boolean canSupportEmptyRedirectForPrivateClients; private OOBResponseDeliverer oobDeliverer; @@ -122,7 +122,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService } catch (OAuthServiceException ex) { return createErrorResponse(state.getState(), state.getRedirectUri(), OAuthConstants.ACCESS_DENIED); } -if (grant.getExpiresIn() / 60 > RECOMMENDED_CODE_EXPIRY_TIME_MINS) { +if (grant.getExpiresIn() > RECOMMENDED_CODE_EXPIRY_TIME_SECS) { LOG.warning("Code expiry time exceeds 10 minutes"); } String grantCode = processCodeGrant(client, grant.getCode(), grant.getSubject()); http://git-wip-us.apache.org/repos/asf/cxf/blob/a1a16ca1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java index 65a01fa..5e8ed8a 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java @@ -182,12 +182,12 @@
[2/2] cxf git commit: Some trivial fixes
Some trivial fixes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8e39d464 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8e39d464 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8e39d464 Branch: refs/heads/3.0.x-fixes Commit: 8e39d46404adf69d694fa8faceb045436146c706 Parents: d2a2a24 Author: Colm O hEigeartaighAuthored: Fri Dec 4 12:38:49 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 12:46:00 2015 + -- .../cxf/rs/security/oauth2/filters/OAuthRequestFilter.java | 2 +- .../security/oauth2/services/AuthorizationCodeGrantService.java | 4 ++-- .../java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8e39d464/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java index c11cbc2..1a397c5 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/OAuthRequestFilter.java @@ -108,7 +108,7 @@ public class OAuthRequestFilter extends AbstractAccessTokenValidator } } -if (permissions.size() > 0 && matchingPermissions.isEmpty() +if (!permissions.isEmpty() && matchingPermissions.isEmpty() || allPermissionsMatch && (matchingPermissions.size() != permissions.size()) || !requiredScopes.isEmpty() && requiredScopes.size() != matchingPermissions.size()) { String message = "Client has no valid permissions"; http://git-wip-us.apache.org/repos/asf/cxf/blob/8e39d464/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java index ab56e06..8e7c966 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java @@ -52,7 +52,7 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants; */ @Path("/authorize") public class AuthorizationCodeGrantService extends RedirectionBasedGrantService { -private static final Integer RECOMMENDED_CODE_EXPIRY_TIME_MINS = 10; +private static final long RECOMMENDED_CODE_EXPIRY_TIME_SECS = 10L * 60L; private boolean canSupportPublicClients; private boolean canSupportEmptyRedirectForPrivateClients; private OOBResponseDeliverer oobDeliverer; @@ -113,7 +113,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService } catch (OAuthServiceException ex) { return createErrorResponse(params, redirectUri, OAuthConstants.ACCESS_DENIED); } -if (grant.getExpiresIn() / 60 > RECOMMENDED_CODE_EXPIRY_TIME_MINS) { +if (grant.getExpiresIn() > RECOMMENDED_CODE_EXPIRY_TIME_SECS) { LOG.warning("Code expiry time exceeds 10 minutes"); } String grantCode = processCodeGrant(client, grant.getCode(), grant.getSubject()); http://git-wip-us.apache.org/repos/asf/cxf/blob/8e39d464/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java index d4c5dcd..59d1da7 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthUtils.java @@ -165,12 +165,12 @@ public final class OAuthUtils { } public static long getIssuedAt() { -return
cxf-fediz git commit: Marking refreshToken scope as invisible to the client app
Repository: cxf-fediz Updated Branches: refs/heads/master 29530b63f -> e711dc8ff Marking refreshToken scope as invisible to the client app Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/e711dc8f Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/e711dc8f Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/e711dc8f Branch: refs/heads/master Commit: e711dc8ff78c5eaa721aa02192687a05ddd6c3d6 Parents: 29530b6 Author: Sergey BeryozkinAuthored: Fri Dec 4 12:59:20 2015 + Committer: Sergey Beryozkin Committed: Fri Dec 4 12:59:20 2015 + -- .../org/apache/cxf/fediz/service/oidc/OAuthDataManager.java | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e711dc8f/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java -- diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java index c4011d8..08db670 100644 --- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java +++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/OAuthDataManager.java @@ -54,6 +54,7 @@ public class OAuthDataManager extends DefaultEHCacheCodeDataProvider { OPENID_PERMISSION.setDefault(true); REFRESH_TOKEN_PERMISSION = new OAuthPermission(OAuthConstants.REFRESH_TOKEN_SCOPE, "Refresh access tokens"); +REFRESH_TOKEN_PERMISSION.setInvisibleToClient(true); } private Map permissionMap = new HashMap (); @@ -114,7 +115,9 @@ public class OAuthDataManager extends DefaultEHCacheCodeDataProvider { OAuthPermission permission = new OAuthPermission(entry.getKey(), entry.getValue()); if (OidcUtils.OPENID_SCOPE.equals(entry.getKey())) { permission.setDefault(true); -} +} else if (OAuthConstants.REFRESH_TOKEN_SCOPE.equals(entry.getKey())) { +permission.setInvisibleToClient(true); +} permissionMap.put(entry.getKey(), permission); } }
[5/5] cxf git commit: Fixing backmerge
Fixing backmerge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/85a45a8b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/85a45a8b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/85a45a8b Branch: refs/heads/3.1.x-fixes Commit: 85a45a8bc4da81aee75438cc0c59c8a1efda91cb Parents: 770ea4c Author: Colm O hEigeartaighAuthored: Fri Dec 4 17:11:01 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:11:01 2015 + -- .../security/oauth2/common/OAuthPermission.java | 97 +--- .../rs/security/oauth2/common/Permission.java | 39 2 files changed, 43 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/85a45a8b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 88a2ad6..0421581 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -77,75 +77,9 @@ public class OAuthPermission extends Permission { return uris; } -<<< HEAD -=== -/** - * Gets the permission description - * @return the description - */ -public String getDescription() { -return description; -} - -/** - * Sets the permission description - * @param description - */ -public void setDescription(String description) { -this.description = description; -} - -/** - * Get the permission value such as "read_calendar" - * @return the value - */ -public String getPermission() { -return permission; -} - -/** - * Sets the permission value such as "read_calendar" - * @param permission the permission value - */ -public void setPermission(String permission) { -this.permission = permission; -} - -/** - * Indicates if this permission has been allocated by default or not. - * Authorization View handlers may use this property to optimize the way the user selects the - * scopes. - * For example, assume that read', 'add' and 'update' scopes are supported and the - * 'read' scope is always allocated. This can be presented at the UI level as follows: - * the read-only check-box control will represent a 'read' scope and a user will be able to - * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. - * @param isDefault true if the permission has been allocated by default - */ -public void setDefault(boolean value) { -this.isDefault = value; -} - -public boolean isDefault() { -return isDefault; -} - -public boolean isInvisibleToClient() { -return invisibleToClient; -} - -/** - * Set the visibility status; by default all the scopes approved by a user can - * be optionally reported to the client in access token responses. Some scopes may need - * to stay 'invisible' to client. - * @param invisibleToClient - */ -public void setInvisibleToClient(boolean invisibleToClient) { -this.invisibleToClient = invisibleToClient; -} - @Override public boolean equals(Object object) { -if (!(object instanceof OAuthPermission)) { +if (!(object instanceof OAuthPermission) || !super.equals(object)) { return false; } @@ -155,22 +89,8 @@ public class OAuthPermission extends Permission { || this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) { return false; } -if (this.uris != null && that.uris == null -|| this.uris == null && that.uris != null -|| this.uris != null && !this.uris.equals(that.uris)) { -return false; -} -if (this.permission != null && that.permission == null -|| this.permission == null && that.permission != null -|| this.permission != null && !this.permission.equals(that.permission)) { -return false; -} -if (this.description != null && that.description == null -|| this.description == null && that.description != null -|| this.description != null && !this.description.equals(that.description)) { -return false; -} -
[2/5] cxf git commit: Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works
Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works Conflicts: rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b7d33366 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b7d33366 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b7d33366 Branch: refs/heads/3.1.x-fixes Commit: b7d33366f3311dc33c7da389f98fced6fd470c93 Parents: 4efd6b4 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:34:03 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:04:10 2015 + -- .../security/oauth2/common/OAuthPermission.java | 124 +++ .../services/AbstractImplicitGrantService.java | 2 +- 2 files changed, 125 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/b7d33366/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 0aaf300..f23e2ad 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -77,4 +77,128 @@ public class OAuthPermission extends Permission { return uris; } +<<< HEAD +=== +/** + * Gets the permission description + * @return the description + */ +public String getDescription() { +return description; +} + +/** + * Sets the permission description + * @param description + */ +public void setDescription(String description) { +this.description = description; +} + +/** + * Get the permission value such as "read_calendar" + * @return the value + */ +public String getPermission() { +return permission; +} + +/** + * Sets the permission value such as "read_calendar" + * @param permission the permission value + */ +public void setPermission(String permission) { +this.permission = permission; +} + +/** + * Indicates if this permission has been allocated by default or not. + * Authorization View handlers may use this property to optimize the way the user selects the + * scopes. + * For example, assume that read', 'add' and 'update' scopes are supported and the + * 'read' scope is always allocated. This can be presented at the UI level as follows: + * the read-only check-box control will represent a 'read' scope and a user will be able to + * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. + * @param isDefault true if the permission has been allocated by default + */ +public void setDefault(boolean value) { +this.isDefault = value; +} + +public boolean isDefault() { +return isDefault; +} + +public boolean isInvisibleToClient() { +return invisibleToClient; +} + +/** + * Set the visibility status; by default all the scopes approved by a user can + * be optionally reported to the client in access token responses. Some scopes may need + * to stay 'invisible' to client. + * @param invisibleToClient + */ +public void setInvisibleToClient(boolean invisibleToClient) { +this.invisibleToClient = invisibleToClient; +} + +@Override +public boolean equals(Object object) { +if (!(object instanceof OAuthPermission)) { +return false; +} + +OAuthPermission that = (OAuthPermission)object; +if (this.httpVerbs != null && that.httpVerbs == null +|| this.httpVerbs == null && that.httpVerbs != null +|| this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) { +return false; +} +if (this.uris != null && that.uris == null +|| this.uris == null && that.uris != null +|| this.uris != null && !this.uris.equals(that.uris)) { +return false; +} +if (this.permission != null && that.permission == null +|| this.permission == null && that.permission != null +|| this.permission != null && !this.permission.equals(that.permission)) { +return false; +
[3/5] cxf git commit: PMD fix
PMD fix Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5c05f1c0 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5c05f1c0 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5c05f1c0 Branch: refs/heads/3.1.x-fixes Commit: 5c05f1c06e9b2d71eb2e85128ef4e2d9978ec17f Parents: b7d3336 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:38:21 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:04:12 2015 + -- .../apache/cxf/rs/security/oauth2/common/OAuthPermission.java | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/5c05f1c0/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index f23e2ad..88a2ad6 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -170,10 +170,7 @@ public class OAuthPermission extends Permission { || this.description != null && !this.description.equals(that.description)) { return false; } -if (this.invisibleToClient != that.invisibleToClient) { -return false; -} -if (this.isDefault != that.isDefault) { +if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD return false; }
[4/5] cxf git commit: Recording .gitmergeinfo Changes
Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/770ea4c9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/770ea4c9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/770ea4c9 Branch: refs/heads/3.1.x-fixes Commit: 770ea4c9b218ba34526fce5903feae6959c3366c Parents: 5c05f1c Author: Colm O hEigeartaighAuthored: Fri Dec 4 17:04:12 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:04:12 2015 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/770ea4c9/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 28a0a76..83dc437 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -12,3 +12,4 @@ B f0e08b7bea2660542e18294d490e68c7b14aaa4b B f1b56150d6520e73d2ade2296c3b2f13839e63e5 B f94e1dd9b2a8d27ec5a27bfb7c026e3ae2350e39 B fb30f8bffc85fcc3208fcc0e1eda4b54a89b5d37 +M 8583a24ac541dc373503d7a6c59cd90890acdae3
[1/5] cxf git commit: Make sure the default scopes are returned to the user
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 48ecb0fce -> 85a45a8bc Make sure the default scopes are returned to the user Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4efd6b4c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4efd6b4c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4efd6b4c Branch: refs/heads/3.1.x-fixes Commit: 4efd6b4c188c7e7c94feb6afc943df831da43180 Parents: 48ecb0f Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:13:13 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:04:06 2015 + -- .../oauth2/services/AuthorizationCodeGrantService.java | 6 -- .../security/oauth2/services/ImplicitGrantService.java | 4 +++- .../oauth2/services/RedirectionBasedGrantService.java | 13 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4efd6b4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java index b95eae7..36615e7 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java @@ -68,10 +68,12 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService MultivaluedMap params, String redirectUri, UserSubject subject, + List requestedScopes, List perms, boolean authorizationCanBeSkipped) { OAuthAuthorizationData data = -super.createAuthorizationData(client, params, redirectUri, subject, perms, authorizationCanBeSkipped); +super.createAuthorizationData(client, params, redirectUri, subject, + requestedScopes, perms, authorizationCanBeSkipped); setCodeQualifier(data, params); return data; } @@ -105,7 +107,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService codeReg.setClient(client); codeReg.setRedirectUri(state.getRedirectUri()); codeReg.setRequestedScope(requestedScope); -if (approvedScope != null && approvedScope.isEmpty()) { +if (approvedScope == null || approvedScope.isEmpty()) { // no down-scoping done by a user, all of the requested scopes have been authorized codeReg.setApprovedScope(requestedScope); } else { http://git-wip-us.apache.org/repos/asf/cxf/blob/4efd6b4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java index 057c59d..bec3714 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java @@ -55,10 +55,12 @@ public class ImplicitGrantService extends AbstractImplicitGrantService { MultivaluedMap params, String redirectUri, UserSubject subject, + List requestedScopes, List perms, boolean authorizationCanBeSkipped) { OAuthAuthorizationData data = -super.createAuthorizationData(client, params,
[3/5] cxf git commit: Fixing backmerge
Fixing backmerge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/db428972 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/db428972 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/db428972 Branch: refs/heads/3.0.x-fixes Commit: db428972930f2c7721ae058d0dd69ff7de7656a9 Parents: 596a373 Author: Colm O hEigeartaighAuthored: Fri Dec 4 17:11:01 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:11:44 2015 + -- .../security/oauth2/common/OAuthPermission.java | 97 +--- .../rs/security/oauth2/common/Permission.java | 39 2 files changed, 43 insertions(+), 93 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/db428972/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 88a2ad6..0421581 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -77,75 +77,9 @@ public class OAuthPermission extends Permission { return uris; } -<<< HEAD -=== -/** - * Gets the permission description - * @return the description - */ -public String getDescription() { -return description; -} - -/** - * Sets the permission description - * @param description - */ -public void setDescription(String description) { -this.description = description; -} - -/** - * Get the permission value such as "read_calendar" - * @return the value - */ -public String getPermission() { -return permission; -} - -/** - * Sets the permission value such as "read_calendar" - * @param permission the permission value - */ -public void setPermission(String permission) { -this.permission = permission; -} - -/** - * Indicates if this permission has been allocated by default or not. - * Authorization View handlers may use this property to optimize the way the user selects the - * scopes. - * For example, assume that read', 'add' and 'update' scopes are supported and the - * 'read' scope is always allocated. This can be presented at the UI level as follows: - * the read-only check-box control will represent a 'read' scope and a user will be able to - * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. - * @param isDefault true if the permission has been allocated by default - */ -public void setDefault(boolean value) { -this.isDefault = value; -} - -public boolean isDefault() { -return isDefault; -} - -public boolean isInvisibleToClient() { -return invisibleToClient; -} - -/** - * Set the visibility status; by default all the scopes approved by a user can - * be optionally reported to the client in access token responses. Some scopes may need - * to stay 'invisible' to client. - * @param invisibleToClient - */ -public void setInvisibleToClient(boolean invisibleToClient) { -this.invisibleToClient = invisibleToClient; -} - @Override public boolean equals(Object object) { -if (!(object instanceof OAuthPermission)) { +if (!(object instanceof OAuthPermission) || !super.equals(object)) { return false; } @@ -155,22 +89,8 @@ public class OAuthPermission extends Permission { || this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) { return false; } -if (this.uris != null && that.uris == null -|| this.uris == null && that.uris != null -|| this.uris != null && !this.uris.equals(that.uris)) { -return false; -} -if (this.permission != null && that.permission == null -|| this.permission == null && that.permission != null -|| this.permission != null && !this.permission.equals(that.permission)) { -return false; -} -if (this.description != null && that.description == null -|| this.description == null && that.description != null -|| this.description != null && !this.description.equals(that.description)) { -return false; -} -
[2/5] cxf git commit: PMD fix
PMD fix Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/596a3739 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/596a3739 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/596a3739 Branch: refs/heads/3.0.x-fixes Commit: 596a373908834c80a19e8d5c6c9a32966138186c Parents: dae28f0 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:38:21 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:11:41 2015 + -- .../apache/cxf/rs/security/oauth2/common/OAuthPermission.java | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/596a3739/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index f23e2ad..88a2ad6 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -170,10 +170,7 @@ public class OAuthPermission extends Permission { || this.description != null && !this.description.equals(that.description)) { return false; } -if (this.invisibleToClient != that.invisibleToClient) { -return false; -} -if (this.isDefault != that.isDefault) { +if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD return false; }
[5/5] cxf git commit: Fixing merge
Fixing merge Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/92b2da35 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/92b2da35 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/92b2da35 Branch: refs/heads/3.0.x-fixes Commit: 92b2da3594b7e83afd4b4b3a1b519c5686da2348 Parents: 60535fa Author: Colm O hEigeartaighAuthored: Fri Dec 4 17:12:28 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:12:28 2015 + -- .../services/AbstractImplicitGrantService.java | 19 --- 1 file changed, 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/92b2da35/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java index 636768f..ad09e75 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java @@ -59,7 +59,6 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant ServerAccessToken preAuthorizedToken) { ServerAccessToken token = null; if (preAuthorizedToken == null) { -<<< HEAD AccessTokenRegistration reg = new AccessTokenRegistration(); reg.setClient(client); reg.setGrantType(OAuthConstants.IMPLICIT_GRANT); @@ -70,24 +69,6 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant reg.setApprovedScope(requestedScope); } else { reg.setApprovedScope(approvedScope); -=== -tokenCanBeReturned = canAccessTokenBeReturned(requestedScope, approvedScope); -if (tokenCanBeReturned) { -AccessTokenRegistration reg = new AccessTokenRegistration(); -reg.setClient(client); -reg.setGrantType(super.getSupportedGrantType()); -reg.setSubject(userSubject); -reg.setRequestedScope(requestedScope); -if (approvedScope == null || approvedScope.isEmpty()) { -// no down-scoping done by a user, all of the requested scopes have been authorized -reg.setApprovedScope(requestedScope); -} else { -reg.setApprovedScope(approvedScope); -} -reg.setAudience(state.getAudience()); -reg.setNonce(state.getNonce()); -token = getDataProvider().createAccessToken(reg); ->>> b7d3336... Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works } reg.setAudience(params.getFirst(OAuthConstants.CLIENT_AUDIENCE)); token = getDataProvider().createAccessToken(reg);
[4/5] cxf git commit: Recording .gitmergeinfo Changes
Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/60535fab Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/60535fab Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/60535fab Branch: refs/heads/3.0.x-fixes Commit: 60535faba81c488179631428b4e9057691ab4482 Parents: db42897 Author: Colm O hEigeartaighAuthored: Fri Dec 4 17:11:44 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:11:44 2015 + -- .gitmergeinfo | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/60535fab/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 9091f53..3c89646 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -165,6 +165,7 @@ B 4d49814ba85310599ee76e41742208383f3f6450 B 4da4d2300433e7e115f095becb1149b22ceb31ca B 4e60f32c9c370b99d9574fa54d546badf647db53 B 4eec754b1bbd46e0142412cd37dbaf189c47f905 +B 4efd6b4c188c7e7c94feb6afc943df831da43180 B 4f61ca801deed173c648b2d424ac231663acd704 B 4f70bdf4199a666829cf9c6c62c508d12afbe251 B 4fe7844935f9b4ad797760613d143949f9448905 @@ -259,6 +260,7 @@ B 74a2e6f2b1d9787cc9b5cff4cc84e43cfccbfe94 B 74aea1227832d3000f2f9fe61d7cc3bcb8a60a79 B 75115ee15740b33c5cc09b1f4b79fc4a54e4611c B 75c69b27a7688dfac281d4acdcff3b0acc4c8bee +B 770ea4c9b218ba34526fce5903feae6959c3366c B 7737225402d3a7b2e669ee8ecf54de10af686f20 B 785955e8a26a891296908796abac0b1cf88c94ce B 7923a6209a05d71cfeb752ed2d45c9e6e7116942 @@ -343,6 +345,7 @@ B 9de88cce894ca9ea746abf27943635467e23c153 B 9df377971980a0224f9a03f605c48f075d720446 B 9dfb278c7739b9f4621f43b8146d057e21fafb64 B 9ea935fcbf3869f5fa4fd1e75a0a2309cc780415 +B 9f20e99ffb13906a83c6a39bb16ceb3708c36f46 B 9fc26998d89a9f7d04d3a57a97b4c09c745b076b B 9fce658c4611f790983a3d5cef7312eec8771461 B 9fe4c04a1c875b3e8f402268cd9dfe18431b5cc9 @@ -761,6 +764,7 @@ M b3bf20abb23f186dbdb0e16519d5c02bbaf5a3ce M b3c1804ba33e0c2c7d991b585ba8147eb13ee07b M b4aa01a0de28462f7338d232e2e88be8512882af M b5320827561467de7e04afdba15a6063d26493a3 +M b7d33366f3311dc33c7da389f98fced6fd470c93 M b9e4fcf44fc690c328afbfa166acca26ecb4c16a M bc5e828cd8a25c4c4107c76e1582f807e75c9a77 M bd1d31f195caab56fbe565fbfb63d9170a0c9406
[1/5] cxf git commit: Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 90789cc21 -> 92b2da359 Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works Conflicts: rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java Conflicts: rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/dae28f01 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/dae28f01 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/dae28f01 Branch: refs/heads/3.0.x-fixes Commit: dae28f01e97a63e4915efad30036cce20ffda54f Parents: 90789cc Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:34:03 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 17:11:35 2015 + -- .../security/oauth2/common/OAuthPermission.java | 124 +++ .../services/AbstractImplicitGrantService.java | 19 +++ 2 files changed, 143 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/dae28f01/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 0aaf300..f23e2ad 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -77,4 +77,128 @@ public class OAuthPermission extends Permission { return uris; } +<<< HEAD +=== +/** + * Gets the permission description + * @return the description + */ +public String getDescription() { +return description; +} + +/** + * Sets the permission description + * @param description + */ +public void setDescription(String description) { +this.description = description; +} + +/** + * Get the permission value such as "read_calendar" + * @return the value + */ +public String getPermission() { +return permission; +} + +/** + * Sets the permission value such as "read_calendar" + * @param permission the permission value + */ +public void setPermission(String permission) { +this.permission = permission; +} + +/** + * Indicates if this permission has been allocated by default or not. + * Authorization View handlers may use this property to optimize the way the user selects the + * scopes. + * For example, assume that read', 'add' and 'update' scopes are supported and the + * 'read' scope is always allocated. This can be presented at the UI level as follows: + * the read-only check-box control will represent a 'read' scope and a user will be able to + * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. + * @param isDefault true if the permission has been allocated by default + */ +public void setDefault(boolean value) { +this.isDefault = value; +} + +public boolean isDefault() { +return isDefault; +} + +public boolean isInvisibleToClient() { +return invisibleToClient; +} + +/** + * Set the visibility status; by default all the scopes approved by a user can + * be optionally reported to the client in access token responses. Some scopes may need + * to stay 'invisible' to client. + * @param invisibleToClient + */ +public void setInvisibleToClient(boolean invisibleToClient) { +this.invisibleToClient = invisibleToClient; +} + +@Override +public boolean equals(Object object) { +if (!(object instanceof OAuthPermission)) { +return false; +} + +OAuthPermission that = (OAuthPermission)object; +if (this.httpVerbs != null && that.httpVerbs == null +|| this.httpVerbs == null && that.httpVerbs != null +|| this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) { +return false; +} +if (this.uris != null && that.uris == null +|| this.uris == null && that.uris != null +|| this.uris != null && !this.uris.equals(that.uris)) { +return false; +} +if (this.permission !=
cxf-fediz git commit: Fixing OSGi exports
Repository: cxf-fediz Updated Branches: refs/heads/master e711dc8ff -> f0146fd6a Fixing OSGi exports Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/f0146fd6 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/f0146fd6 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/f0146fd6 Branch: refs/heads/master Commit: f0146fd6aefc1fddeb2b7508a0ec31e368530688 Parents: e711dc8 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:49:05 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:49:05 2015 + -- plugins/cxf/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/f0146fd6/plugins/cxf/pom.xml -- diff --git a/plugins/cxf/pom.xml b/plugins/cxf/pom.xml index 0e221d0..93e687f 100644 --- a/plugins/cxf/pom.xml +++ b/plugins/cxf/pom.xml @@ -118,7 +118,7 @@ !org.apache.cxf.fediz.spring*, -org.apache.cxf.fediz.core.*, +org.apache.cxf.fediz.cxf.*, *;resolution:=optional
[1/2] cxf-fediz git commit: Fixing OSGi exports
Repository: cxf-fediz Updated Branches: refs/heads/1.2.x-fixes c67a89578 -> 1bbdb5e7b Fixing OSGi exports Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/eadac166 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/eadac166 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/eadac166 Branch: refs/heads/1.2.x-fixes Commit: eadac166bcda8e0cefe8b3b4db7abfadde37d792 Parents: c67a895 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:49:05 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:51:30 2015 + -- plugins/cxf/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/eadac166/plugins/cxf/pom.xml -- diff --git a/plugins/cxf/pom.xml b/plugins/cxf/pom.xml index 0a55b49..33b3ee7 100644 --- a/plugins/cxf/pom.xml +++ b/plugins/cxf/pom.xml @@ -118,7 +118,7 @@ !org.apache.cxf.fediz.spring*, -org.apache.cxf.fediz.core.*, +org.apache.cxf.fediz.cxf.*, *;resolution:=optional
[2/2] cxf-fediz git commit: Fixing previous merge
Fixing previous merge Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/1bbdb5e7 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/1bbdb5e7 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/1bbdb5e7 Branch: refs/heads/1.2.x-fixes Commit: 1bbdb5e7b7cc40f6068bb11216c055893e850143 Parents: eadac16 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:50:37 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:51:37 2015 + -- plugins/cxf/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1bbdb5e7/plugins/cxf/pom.xml -- diff --git a/plugins/cxf/pom.xml b/plugins/cxf/pom.xml index 33b3ee7..1435291 100644 --- a/plugins/cxf/pom.xml +++ b/plugins/cxf/pom.xml @@ -114,11 +114,11 @@ The Apache Software Foundation ${project.version} - org.apache.cxf.fediz.spring.*;version="${project.version}" + org.apache.cxf.fediz.cxf.*;version="${project.version}" !org.apache.cxf.fediz.spring*, -org.apache.cxf.fediz.cxf.*, +org.apache.cxf.fediz.core.*, *;resolution:=optional
[2/3] cxf git commit: Make sure the default scopes are returned to the user
Make sure the default scopes are returned to the user Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/796fda4c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/796fda4c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/796fda4c Branch: refs/heads/master Commit: 796fda4c78788994686f2cad961b5bbdf8bcb4ef Parents: 0b9ce1c Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:13:13 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:35:04 2015 + -- .../oauth2/services/AuthorizationCodeGrantService.java | 6 -- .../security/oauth2/services/ImplicitGrantService.java | 4 +++- .../oauth2/services/RedirectionBasedGrantService.java | 13 ++--- 3 files changed, 17 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/796fda4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java index b95eae7..36615e7 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java @@ -68,10 +68,12 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService MultivaluedMap params, String redirectUri, UserSubject subject, + List requestedScopes, List perms, boolean authorizationCanBeSkipped) { OAuthAuthorizationData data = -super.createAuthorizationData(client, params, redirectUri, subject, perms, authorizationCanBeSkipped); +super.createAuthorizationData(client, params, redirectUri, subject, + requestedScopes, perms, authorizationCanBeSkipped); setCodeQualifier(data, params); return data; } @@ -105,7 +107,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService codeReg.setClient(client); codeReg.setRedirectUri(state.getRedirectUri()); codeReg.setRequestedScope(requestedScope); -if (approvedScope != null && approvedScope.isEmpty()) { +if (approvedScope == null || approvedScope.isEmpty()) { // no down-scoping done by a user, all of the requested scopes have been authorized codeReg.setApprovedScope(requestedScope); } else { http://git-wip-us.apache.org/repos/asf/cxf/blob/796fda4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java index 057c59d..bec3714 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java @@ -55,10 +55,12 @@ public class ImplicitGrantService extends AbstractImplicitGrantService { MultivaluedMap params, String redirectUri, UserSubject subject, + List requestedScopes, List perms, boolean authorizationCanBeSkipped) { OAuthAuthorizationData data = -super.createAuthorizationData(client, params, redirectUri, subject, perms, authorizationCanBeSkipped); +
[3/3] cxf git commit: PMD fix
PMD fix Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/aaabd57f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/aaabd57f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/aaabd57f Branch: refs/heads/master Commit: aaabd57fb537feda5c5243168734fe331c995926 Parents: 8583a24 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:38:21 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:38:21 2015 + -- .../apache/cxf/rs/security/oauth2/common/OAuthPermission.java | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/aaabd57f/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 2b31fa8..43aeb64 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -174,10 +174,7 @@ public class OAuthPermission implements Serializable { || this.description != null && !this.description.equals(that.description)) { return false; } -if (this.invisibleToClient != that.invisibleToClient) { -return false; -} -if (this.isDefault != that.isDefault) { +if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD return false; }
cxf-fediz git commit: Fixing previous merge
Repository: cxf-fediz Updated Branches: refs/heads/master f0146fd6a -> 9c6aafe0d Fixing previous merge Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/9c6aafe0 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/9c6aafe0 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/9c6aafe0 Branch: refs/heads/master Commit: 9c6aafe0da396252d8cf4cb1e52abb90a3f85989 Parents: f0146fd Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:50:37 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:50:37 2015 + -- plugins/cxf/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/9c6aafe0/plugins/cxf/pom.xml -- diff --git a/plugins/cxf/pom.xml b/plugins/cxf/pom.xml index 93e687f..120751c 100644 --- a/plugins/cxf/pom.xml +++ b/plugins/cxf/pom.xml @@ -114,11 +114,11 @@ The Apache Software Foundation ${project.version} - org.apache.cxf.fediz.spring.*;version="${project.version}" + org.apache.cxf.fediz.cxf.*;version="${project.version}" !org.apache.cxf.fediz.spring*, -org.apache.cxf.fediz.cxf.*, +org.apache.cxf.fediz.core.*, *;resolution:=optional
[1/3] cxf git commit: Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works
Repository: cxf Updated Branches: refs/heads/master 0b9ce1c16 -> aaabd57fb Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8583a24a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8583a24a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8583a24a Branch: refs/heads/master Commit: 8583a24ac541dc373503d7a6c59cd90890acdae3 Parents: 796fda4 Author: Colm O hEigeartaighAuthored: Fri Dec 4 16:34:03 2015 + Committer: Colm O hEigeartaigh Committed: Fri Dec 4 16:35:04 2015 + -- .../security/oauth2/common/OAuthPermission.java | 58 .../services/AbstractImplicitGrantService.java | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8583a24a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java index 1be8106..2b31fa8 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java @@ -146,4 +146,62 @@ public class OAuthPermission implements Serializable { public void setInvisibleToClient(boolean invisibleToClient) { this.invisibleToClient = invisibleToClient; } + +@Override +public boolean equals(Object object) { +if (!(object instanceof OAuthPermission)) { +return false; +} + +OAuthPermission that = (OAuthPermission)object; +if (this.httpVerbs != null && that.httpVerbs == null +|| this.httpVerbs == null && that.httpVerbs != null +|| this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) { +return false; +} +if (this.uris != null && that.uris == null +|| this.uris == null && that.uris != null +|| this.uris != null && !this.uris.equals(that.uris)) { +return false; +} +if (this.permission != null && that.permission == null +|| this.permission == null && that.permission != null +|| this.permission != null && !this.permission.equals(that.permission)) { +return false; +} +if (this.description != null && that.description == null +|| this.description == null && that.description != null +|| this.description != null && !this.description.equals(that.description)) { +return false; +} +if (this.invisibleToClient != that.invisibleToClient) { +return false; +} +if (this.isDefault != that.isDefault) { +return false; +} + +return true; +} + +@Override +public int hashCode() { +int hashCode = 17; +if (httpVerbs != null) { +hashCode = 31 * hashCode + httpVerbs.hashCode(); +} +if (uris != null) { +hashCode = 31 * hashCode + uris.hashCode(); +} +if (permission != null) { +hashCode = 31 * hashCode + permission.hashCode(); +} +if (description != null) { +hashCode = 31 * hashCode + description.hashCode(); +} +hashCode = 31 * hashCode + Boolean.hashCode(invisibleToClient); +hashCode = 31 * hashCode + Boolean.hashCode(isDefault); + +return hashCode; +} } http://git-wip-us.apache.org/repos/asf/cxf/blob/8583a24a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java -- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java index 139c05b..cee77da 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java @@ -71,7 +71,7 @@ public abstract