Updated Branches: refs/heads/master c4b93e11f -> 5dbc37202
TAP5-1822: LinkSecurity should be public, not internal, as it is used with the public Link interface Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5dbc3720 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5dbc3720 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5dbc3720 Branch: refs/heads/master Commit: 5dbc37202ab56c0a150e7c693b9f9694f21b023c Parents: c4b93e1 Author: Howard M. Lewis Ship <[email protected]> Authored: Thu Jul 25 12:15:37 2013 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Thu Jul 25 12:15:37 2013 -0700 ---------------------------------------------------------------------- 54_RELEASE_NOTES.txt | 6 ++ .../main/java/org/apache/tapestry5/Link.java | 4 +- .../java/org/apache/tapestry5/LinkSecurity.java | 61 +++++++++++++++++++ .../tapestry5/internal/services/LinkImpl.java | 3 +- .../internal/services/LinkSecurity.java | 63 -------------------- .../services/RequestSecurityManager.java | 3 +- .../services/RequestSecurityManagerImpl.java | 3 +- .../ComponentEventLinkEncoderImplTest.java | 3 +- .../internal/services/LinkImplTest.java | 3 +- .../RequestSecurityManagerImplTest.java | 3 +- 10 files changed, 82 insertions(+), 70 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/54_RELEASE_NOTES.txt ---------------------------------------------------------------------- diff --git a/54_RELEASE_NOTES.txt b/54_RELEASE_NOTES.txt index e6eac18..6255469 100644 --- a/54_RELEASE_NOTES.txt +++ b/54_RELEASE_NOTES.txt @@ -246,6 +246,12 @@ until the end of the request. A new configuration symbol can be used to turn thi The interface for AssetPathConstructor was changed incompatibly, to allow for individual asset checksums. +## Link and LinkSecurity + +The enum type LinkSecurity was an internal class in 5.3 despite being used in methods of the public Link interface. +It has been moved to package org.apache.tapestry5; this represents a minor incompatible change to the Link interface +(which is rarely, if ever, implemented outside of the framework). + ## StreamableResource Extended StreamableResource has been modified, adding a new `getChecksum()` method; this interface is rarely, if ever, http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/Link.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/Link.java b/tapestry-core/src/main/java/org/apache/tapestry5/Link.java index 9596335..f61475c 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/Link.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/Link.java @@ -15,7 +15,7 @@ package org.apache.tapestry5; import org.apache.commons.codec.net.URLCodec; -import org.apache.tapestry5.internal.services.LinkSecurity; +import org.apache.tapestry5.ioc.annotations.IncompatibleChange; import org.apache.tapestry5.services.BaseURLSource; import org.apache.tapestry5.services.ContextPathEncoder; import org.apache.tapestry5.services.Request; @@ -152,6 +152,7 @@ public interface Link * @param newSecurity new security value, not null, typically {@link LinkSecurity#FORCE_SECURE} or {@link LinkSecurity#FORCE_INSECURE} * @since 5.3 */ + @IncompatibleChange(release = "5.4", details = "LinkSecurity class moved from internal package to org.apache.tapestry5.") void setSecurity(LinkSecurity newSecurity); /** @@ -159,6 +160,7 @@ public interface Link * * @since 5.3 */ + @IncompatibleChange(release = "5.4", details = "LinkSecurity class moved from internal package to org.apache.tapestry5.") LinkSecurity getSecurity(); /** http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/LinkSecurity.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/LinkSecurity.java b/tapestry-core/src/main/java/org/apache/tapestry5/LinkSecurity.java new file mode 100644 index 0000000..34ff445 --- /dev/null +++ b/tapestry-core/src/main/java/org/apache/tapestry5/LinkSecurity.java @@ -0,0 +1,61 @@ +// Copyright 2010-2013 The Apache Software Foundation +// +// Licensed 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 org.apache.tapestry5; + +/** + * Identifies how a {@link Link} should handle security. + * + * @since 5.2.2 + */ +public enum LinkSecurity +{ + /** The request was insecure, but the targeted page was secure, so the URI should be absolute and secure. */ + FORCE_SECURE, + + /** The request was was secure but the targeted page is not, so the URI should be absolute and insecure. */ + FORCE_INSECURE, + + /** + * The request is insecure, which matches the targeted page security, so there's no explicit need for an absolute + * URI. + */ + INSECURE, + + /** + * The request is secure, which matches the targeted page security, so there's no explicit need for an absolute + * URI. + */ + SECURE; + + /** Promotes to either {@link #FORCE_SECURE} or {@link #FORCE_INSECURE}. */ + public LinkSecurity promote() + { + switch (this) + { + case SECURE: + case FORCE_SECURE: + return FORCE_SECURE; + + default: + return FORCE_INSECURE; + } + } + + /** Does this value indicate forcing an absolute URI (one that includes scheme and hostname)? */ + public boolean isAbsolute() + { + return this == FORCE_SECURE || this == FORCE_INSECURE; + } +} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkImpl.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkImpl.java index 4a5075e..5333d75 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkImpl.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkImpl.java @@ -1,4 +1,4 @@ -// Copyright 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2009-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package org.apache.tapestry5.internal.services; import org.apache.tapestry5.Link; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.ioc.internal.util.InternalUtils; import org.apache.tapestry5.services.BaseURLSource; import org.apache.tapestry5.services.ContextPathEncoder; http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSecurity.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSecurity.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSecurity.java deleted file mode 100644 index 1f1eb3a..0000000 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/LinkSecurity.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2010, 2011 The Apache Software Foundation -// -// Licensed 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 org.apache.tapestry5.internal.services; - -import org.apache.tapestry5.Link; - -/** - * Identifies how a {@link Link} should handle security. - * - * @since 5.2.2 - */ -public enum LinkSecurity -{ - /** The request was insecure, but the targeted page was secure, so the URI should be absolute and secure. */ - FORCE_SECURE, - - /** The request was was secure but the targeted page is not, so the URI should be absolute and insecure. */ - FORCE_INSECURE, - - /** - * The request is insecure, which matches the targeted page security, so there's no explicit need for an absolute - * URI. - */ - INSECURE, - - /** - * The request is secure, which matches the targeted page security, so there's no explicit need for an absolute - * URI. - */ - SECURE; - - /** Promotes to either {@link #FORCE_SECURE} or {@link #FORCE_INSECURE}. */ - public LinkSecurity promote() - { - switch (this) - { - case SECURE: - case FORCE_SECURE: - return FORCE_SECURE; - - default: - return FORCE_INSECURE; - } - } - - /** Does this value indicate forcing an absolute URI (one that includes scheme and hostname)? */ - public boolean isAbsolute() - { - return this == FORCE_SECURE || this == FORCE_INSECURE; - } -} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManager.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManager.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManager.java index 8481c11..7321b40 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManager.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManager.java @@ -1,4 +1,4 @@ -// Copyright 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2008-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ package org.apache.tapestry5.internal.services; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.services.ComponentEventRequestParameters; import org.apache.tapestry5.services.PageRenderRequestParameters; http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImpl.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImpl.java index 4bbb0e8..dd0ada6 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImpl.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImpl.java @@ -1,4 +1,4 @@ -// Copyright 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2008-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package org.apache.tapestry5.internal.services; import org.apache.tapestry5.Link; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.MetaDataConstants; import org.apache.tapestry5.SymbolConstants; import org.apache.tapestry5.ioc.annotations.Symbol; http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventLinkEncoderImplTest.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventLinkEncoderImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventLinkEncoderImplTest.java index f05f555..a2b24df 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventLinkEncoderImplTest.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentEventLinkEncoderImplTest.java @@ -1,4 +1,4 @@ -// Copyright 2009, 2010, 2011, 2012 The Apache Software Foundation +// Copyright 2009-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package org.apache.tapestry5.internal.services; import org.apache.tapestry5.Link; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.MetaDataConstants; import org.apache.tapestry5.TapestryConstants; import org.apache.tapestry5.internal.EmptyEventContext; http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/LinkImplTest.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/LinkImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/LinkImplTest.java index 5d861d6..6cefbfb 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/LinkImplTest.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/LinkImplTest.java @@ -1,4 +1,4 @@ -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2006-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package org.apache.tapestry5.internal.services; import org.apache.tapestry5.Link; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.internal.test.InternalBaseTestCase; import org.apache.tapestry5.services.BaseURLSource; import org.apache.tapestry5.services.ContextPathEncoder; http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5dbc3720/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImplTest.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImplTest.java index ca8e91a..0157537 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImplTest.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RequestSecurityManagerImplTest.java @@ -1,4 +1,4 @@ -// Copyright 2008, 2009, 2010, 2011 The Apache Software Foundation +// Copyright 2008-2013 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ package org.apache.tapestry5.internal.services; import org.apache.tapestry5.Link; +import org.apache.tapestry5.LinkSecurity; import org.apache.tapestry5.MetaDataConstants; import org.apache.tapestry5.internal.EmptyEventContext; import org.apache.tapestry5.internal.test.InternalBaseTestCase;
