I used the minimal spring war -
http://www.java2s.com/Code/JavaDownload/webapp-minimal.zip
as an exploded war archive with the following extension to the web.xml (even
though it is a spring war it doesn't need any spring installed to the karaf
[?] )

      <security-constraint>
            <web-resource-collection>
                  <web-resource-name>SecureConnection</web-resource-name>
                  <url-pattern>/*</url-pattern>
                  <http-method>GET</http-method>
                  <http-method>POST</http-method>
            </web-resource-collection>
            <auth-constraint>
                <role-name>admin</role-name>
            </auth-constraint>
            <!--user-data-constraint>
                  <transport-guarantee>CONFIDENTIAL</transport-guarantee>
            </user-data-constraint-->
      </security-constraint>
    <!-- -->
      <security-role>
        <role-name>admin</role-name>
      </security-role>

    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Test Realm</realm-name>
    </login-config>

And as a jetty.xml file I used the one attached

everything was tested with Karaf 2.1.0 :)

I changed the features xml to the following:

<feature name="http" version="2.1.0">
        <config name="org.ops4j.pax.web">
            org.osgi.service.http.port=8181
            org.ops4j.pax.web.config.file=${karaf.base}/etc/jetty.xml
        </config>

<bundle>mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2</bundle>

<bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/3.1.0</bundle>

<bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm.tree/3.1.0</bundle>

<bundle>mvn:org.objectweb.asm/com.springsource.org.objectweb.asm.commons/3.1.0</bundle>

<bundle>mvn:org.eclipse.jetty.aggregate/jetty-all-server/7.1.6.v20100715</bundle>
        <bundle>mvn:org.ops4j.pax.web/pax-web-api/0.8.0-SNAPSHOT</bundle>
        <bundle>mvn:org.ops4j.pax.web/pax-web-spi/0.8.0-SNAPSHOT</bundle>

<bundle>mvn:org.ops4j.pax.web/pax-web-runtime/0.8.0-SNAPSHOT</bundle>
        <bundle>mvn:org.ops4j.pax.web/pax-web-jetty/0.8.0-SNAPSHOT</bundle>
    </feature>

I also added comments to the code where I think the security configuration
should take place. Just search for PAXWEB-210

BTW. I don't know what happened last night when I tried to push my changes,
I did a pull before that push and merged the changed files, after that I
wanted to commit my local changes because of the comments I made. After that
the github showed this strange image [?]

http://github.com/ops4j/org.ops4j.pax.web/network

must look like a total SuperDAU (german for something like BDU - brain dead
user)

2010/10/1 Guillaume Nodet <gno...@gmail.com>

> Do you have a sample webapp and test you're working with to reproduce
> this problem? I'll have a look at it.
>
> On Friday, October 1, 2010, Achim Nierbeck <bcanh...@googlemail.com>
> wrote:
> > Hey guys, can pls somebody take a look at the code in the
> webSecureContext Branch.
> > I'm somehow stuck right now. Since changing from jetty 6 to jetty 7 the
> thing I was manly working on the
> > setting of the securityHandler and the security constraint settings,
> doesn't work anymore.
> > To me it looks like that the configuration which was done before starting
> the servlet-context in jetty 6 is now
> > partially done after the starting of the servlet-context.
> >
> > Am 30.09.2010 21:31, schrieb Achim Nierbeck:
> >
> > Good thing I'm not the only one learning how to use git :)
> >
> > Am 30.09.2010 21:29, schrieb Toni Menzel:
> >
> > No its not your fault. We are fleshing out processes here while
> > building something that can be a documentation for the things you need
> > to use ops4j with github.
> > Unfortunately we are at a very early stage, and you hit a very good
> > point i personally was not aware of:
> > Setting "git config --global core.autocrlf input" when importing
> > projects from svn.
> >
> > Thats why we now have to fix the repos. Will take it tomorrow.
> >
> > We are learning.
> >
> > On Thu, Sep 30, 2010 at 9:10 PM, Achim Nierbeck<bcanh...@googlemail.com>
>  wrote:
> >
> > Guess thats my fault then, tried to use tortoise-git like I would use the
> > tortoise-svn client.
> > I use windows right now, that's why I usually like the eclipse clients
> (at
> > least for cvs and svn) helps with all those whitespace eol issues I guess
> :(
> >
> > Am 30.09.2010 19:17, schrieb Niclas Hedhman:
> >
> > End-of-line or other whitespace setup issue??
> >
> > On Fri, Oct 1, 2010 at 12:46 AM, Toni Menzel<t...@okidokiteam.com>
>  wrote:
> >
> >
> > well thats really interesting to hear. Though i heard JGit/EGit for
> > Eclipse is a pretty good combo.
> > I wonder why you had so many manual merges as git is usually quite
> > good at doing that automatically.
> > I don't know anything about tortoise-git but i suggest you lean the
> > basic git command lines so your process (and possible workflow issues)
> > are more explicit.
> > You can be happy you get less manual merges in git than in subversion,
> > much less.
> > So, the question is if you really hit hard conflicting merges or it
> > was just a not so clever command use from tortoise-git.
> >
> >
> > On Thu, Sep 30, 2010 at 6:01 PM, Achim Nierbeck<bcanh...@googlemail.com>
> >   wrote:
> >
> >
> > Hi, for me the merge of the branch was not as easy as expected, somehow
> > tortoise-git showed me conflicts on almost every file and even worse on
> > almost every file it showed me the full file as in conflict :(
> > No much fun there, but probably a better client would help. BTW, the
> > eclipse
> > client doesn't help much either on this, but helped a lot on comparing
> > the
> > merged stuff with the original
> >
> > 2010/9/30 Toni Menzel<t...@okidokiteam.com>
> >
> >
> > Yes, also take a note on some discussions from here:
> >
> >
> >
> http://github.com/ops4j/org.ops4j.pax.web/commit/327e4fd3917ecdf0e7ecdfb13e8e7176979c22c9#commitcomment-159100
> >
> > I would agree on keeping those comment tight and brief, so the main
> > discussion go to the list.
> >
> >
> > On Thu, Sep 30, 2010 at 5:17 PM, Niclas Hedhman<nic...@hedhman.org>
> > wrote:
> >
> >
> > Yes, now the interesting workflow bits are starting... I'm curious.
> >
> > Cheers
> > Niclas
> >
> > On Thu, Sep 30, 2010 at 10:49 PM, Guillaume Nodet<gno...@gmail.com>
> > wrote:
> >
> >
> > Achim has merged the work i've done on jetty7 into the
> > websecureContext
> > branch.
> > I propose we merge that back into master and continue the work there.
> > Thoughts?
> >
> > On Sun, Sep 26, 2010 at 21:07, Guillaume Nodet<gno...@gmail.com>
> > wrote:
> >
> >
> > It would be interesting to merge with my work on jetty7 then,
> > because
> > all
> > jetty7 jars are native osgi bundles.
> > That would make things easier ....
> >
> > On Sun, Sep 26, 2010 at 21:05, Achim Nierbeck
> > <bcanh...@googlemail.com>
> > wrote:
> >
> >
> > You are right about this, it was just the use case I was looking
> > for
> > when
> > I added the issue in the first place.
> > I did some research about JAAS inside Jetty already, as far as I
> > understood, you need the j
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>

<<328.png>>

<<361.gif>>

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd";>

<Configure class="org.eclipse.jetty.server.Server">

    <!-- =========================================================== -->
    <!-- Set connectors                                              -->
    <!-- =========================================================== -->
    <!-- One of each type!                                           -->
    <!-- =========================================================== -->

    <!-- Use this connector for many frequently idle connections
         and for threadless continuations.
    -->
    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8080"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
	    <Set name="lowResourcesConnections">20000</Set>
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>
	
	<!-- =========================================================== -->
    <!-- Configure Authentication Realms                             -->
    <!-- Realms may be configured for the entire server here, or     -->
    <!-- they can be configured for a specific web app in a context  -->
    <!-- configuration (see $(jetty.home)/contexts/test.xml for an   -->
    <!-- example).                                                   -->
    <!-- =========================================================== -->
    <Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.security.HashLoginService">
          <Set name="name">Test Realm</Set>
          <Set name="config"><Property name="jetty.home" default="."/>/etc/realm.properties</Set>
          <Set name="refreshInterval">0</Set>
        </New>
      </Arg>
    </Call>


</Configure>
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to