Re: Using SecureLinkTag with non-actions

2002-11-07 Thread Rick Mann
on 11/5/02 7:00 PM, Ditlinger, Steve at [EMAIL PROTECTED] wrote:

 As for specifying a forward to be secure or non-secure: changing the
 protocol requires a redirect, so every forward where the protocol changes
 would require a redirect, which would be OK assuming the developer
 recognizes that going in.  I think you can accomplish the same thing right
 now by using the sslext:pageScheme tag.

Well, what's important is to reduce the number of different places where
something is specified (anything, but in this case, the desired scheme,
http/https).

One of my main desires in the sslext:link tag is to be able to use them
throughout my JSPs without worrying about what the resource is (or might be
in the future), and without worrying about the hostname.

If the tag handler could look up in some file, preferrably the struts-config
file, what the resource needs are (http vs. https), then it could render an
appropriate tag for what the current request's scheme is.

Since there's no way to ask a JSP directly (I have a thought on this, below)
for parameters, it *could* be done as part of the global forwards tags in
the struts-config file. However, I think the DTD would have to be modified,
either to include a parameter in the tag, or to allow something like this:

forward name=mySecurePage path=login.jsp
set-property property=secure value=true/
/forward

Because the security of a page is so important and pervasive, I think all of
this stuff should be incorporated into Struts, rather than being an
extension, and I'd prefer to see secure added as a property to the tags:

forward name=mySecurePage path=login.jsp secure=true/

Alternatively, a separate set of tags could be added:

secure-resources
resource path=page-one.jsp /
resource path=action-one /  //  an action: action-one.do, let's say
resource path=page-two.jsp /
/secure-resources

In all cases, the sslext:link tag could consult this data to render the
appropriate URL. This way, if the page ever changes, it would not be
necessary to change every reference to it.

Furthermore, a global SSL switch could be employed, allowing one to turn off
SSL for testing and development purposes (when the certs are self-signed,
you get all sorts of warnings, or when you're having trouble getting the SSL
transport set up, as I did).

Regarding putting the information in the JSP: It should be possible to
create a static method or variable in a JSP that can be queried by any other
Java running in the same container. Unfortunately, I don't think this can be
done in a container-independent manner. I don't know if the Servlet Spec
provides for a programmatic way to find the class compiled out of a JSP. I
know that Tomcat munges the .jsp filename into something resembling it, and
so it should be possible to put into a JSP a very small bit of code or data
(unfortunately, I don't think it can be done with a tag, but maybe; can a
tag create a static method in the JSP?) that can be queried by things like
the sslext:link tag.

Anyway, those are my thoughts. What we really need is an HTTP 1.2 (or 2.0)
protocol that knows how to query the server first to see if a requested
resource needs to be requested securely, along with underlying changes to
support state. But that's a much longer discussion!

Thanks for your reply!

-- 
Rick


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: Using SecureLinkTag with non-actions

2002-11-05 Thread Ditlinger, Steve

Rick:

You are not the first to ask for a secure attribute on the link tag.  This
would be most useful for links to outside resources, like yours.  Currently,
the best answer would be to use the regular struts html:link tag for those
links, instead of the sslext:link tag -or- perhaps the sslext:pageScheme
tag is what you want to use.  Place at the top of your page like so:
sslext:pageScheme secure=false /. 

As for specifying a forward to be secure or non-secure: changing the
protocol requires a redirect, so every forward where the protocol changes
would require a redirect, which would be OK assuming the developer
recognizes that going in.  I think you can accomplish the same thing right
now by using the sslext:pageScheme tag.  

Anyway, please let me knoe of anymore issues, suggestions, etc you have.

Steve

 -Original Message-
 From: Rick Mann [mailto:rmann;latencyzero.com]
 Sent: Monday, November 04, 2002 8:19 PM
 To: Struts Users Mailing List
 Subject: Using SecureLinkTag with non-actions
 
 
 Hi. I recently added the SSL Ext stuff to Struts 1.1b2, and 
 it mostly works,
 except for the SecureLinkTag.
 
 I have a .jsp that is not required to be secure. The typical 
 user, however,
 will get to this page as a result of logging in (an HTTP 
 post), and so the
 page will be secure.
 
 I have several links on this page, none of which need to be 
 secure (that is,
 I'd like for them to be http://...; links). Using the 
 SecureLinkTag, I get
 this for links that reference an action, but for links that reference
 another .jsp or .html page, it uses the same scheme as the 
 referring page.
 
 How can I tell ssl-ext that a page or forward is not secure? 
 Is this even
 possible? If not, a poor workaround would be to add a 
 secure property to
 the tag...
 
 TIA
  
 -- 
 Rick
 
 


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Using SecureLinkTag with non-actions

2002-11-04 Thread Rick Mann
Hi. I recently added the SSL Ext stuff to Struts 1.1b2, and it mostly works,
except for the SecureLinkTag.

I have a .jsp that is not required to be secure. The typical user, however,
will get to this page as a result of logging in (an HTTP post), and so the
page will be secure.

I have several links on this page, none of which need to be secure (that is,
I'd like for them to be http://...; links). Using the SecureLinkTag, I get
this for links that reference an action, but for links that reference
another .jsp or .html page, it uses the same scheme as the referring page.

How can I tell ssl-ext that a page or forward is not secure? Is this even
possible? If not, a poor workaround would be to add a secure property to
the tag...

TIA
 
-- 
Rick


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org