]> source.dussan.org Git - archiva.git/commitdiff
starting to use the plexus-security bits now, the store-model.xml file will eventuall...
authorJesse McConnell <jmcconnell@apache.org>
Thu, 7 Sep 2006 16:05:47 +0000 (16:05 +0000)
committerJesse McConnell <jmcconnell@apache.org>
Thu, 7 Sep 2006 16:05:47 +0000 (16:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@441128 13f79535-47bb-0310-9956-ffa450edef68

archiva-webapp/pom.xml
archiva-webapp/rbac-store-model.xml [new file with mode: 0644]
archiva-webapp/src/main/resources/META-INF/plexus/application.xml
archiva-webapp/src/main/resources/xwork.xml
archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp [new file with mode: 0644]
archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp [new file with mode: 0644]
archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp [new file with mode: 0644]

index 26c5f59d437fdcf306538e10fefbfe3223e0e643..5a900b8a8b67989079d020470e1f8da03bf95b03 100644 (file)
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
     </dependency>
+    <!-- Plexus Security Dependencies -->
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-system</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-ui-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-ui-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authentication-provider-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-user-management-provider-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-store-memory</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-api</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.security</groupId>
+      <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git a/archiva-webapp/rbac-store-model.xml b/archiva-webapp/rbac-store-model.xml
new file mode 100644 (file)
index 0000000..5923107
--- /dev/null
@@ -0,0 +1 @@
+<model/>
index 4ce70d6970b33fb03a17b3c765614f20fdc49286..c17d9b2be0cc30ef11bf8ccfd6fe0140a4b4ee02 100644 (file)
         </levels>
       </configuration>
     </component>
+
+
+    <!-- plexus security components -->
+    <component>
+      <role>org.codehaus.plexus.security.system.SecuritySystem</role>
+      <implementation>org.codehaus.plexus.security.system.DefaultSecuritySystem</implementation>
+      <role-hint>default</role-hint>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.security.authentication.Authenticator</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+          <role-hint>rbac</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.security.user.UserManager</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+      <role-hint>rbac</role-hint>
+      <implementation>org.codehaus.plexus.security.authorization.rbac.RbacAuthorizer</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.security.authorization.rbac.store.RbacStore</role>
+          <role-hint>memory</role-hint>
+        </requirement>
+      </requirements>
+    </component>
+
+
   </components>
 
   <!-- Override default configuration of components -->
index c90d005bf74044b1bd24b4a4103f994b6f2b83b4..382b15631440f9a4e8ef03f453119529258f33e9 100644 (file)
       </result>
       <result name="notFound" type="httpheader">404</result>
     </action>
+
+    <!-- plexus security actions -->
+    <action name="login" class="session" method="login">
+      <result name="input">/WEB-INF/jsp/login.jsp</result>
+      <result name="success" type="redirect-action">browse</result>
+    </action>
+
+    <action name="logout" class="session" method="logout">
+      <result>/WEB-INF/jsp/logout.jsp</result>
+    </action>
+
+    <action name="register" class="registerUser" method="createUser">
+      <result name="input">/WEB-INF/jsp/register.jsp</result>
+      <result name="success" type="redirect-action">login</result>
+    </action>
   </package>
 
   <!-- Configuration for the admin package. -->
index 5a9dff1a125c9cd0dd444d003f694ec1656b695c..20476d74468ae5da2e015593708a0e9bc66ea4b8 100644 (file)
 
 <div id="breadcrumbs">
   <div class="xleft">
-    <%-- TODO: login --%>
+    <ww:url id="loginUrl" action="login" namespace="/"/>
+    <ww:url id="logoutUrl" action="logout" namespace="/"/>
+    <ww:url id="registerUrl" action="register" namespace="/"/>
+    <ww:if test="${sessionScope.authStatus != true}">
+      <ww:a href="%{loginUrl}">Login</ww:a> or <ww:a href="%{registerUrl}">Register</ww:a> 
+    </ww:if>
+    <ww:else>
+      Welcome, <b>${sessionScope.user.username}</b> - <ww:a href="%{logoutUrl}">Logout</ww:a>
+    </ww:else>
   </div>
 
   <div class="xright">
diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/login.jsp
new file mode 100644 (file)
index 0000000..911cfff
--- /dev/null
@@ -0,0 +1,57 @@
+<%--
+  ~ Copyright 2005-2006 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Login Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Login</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    <ww:form action="login">
+      <table>
+        <tr>
+          <td>Username:</td>
+          <td><ww:textfield name="username"/></td>
+        </tr>
+        <tr>
+          <td>Password:</td>
+          <td><ww:password name="password"/></td>
+        </tr>
+        <tr>
+          <td><ww:submit name="Login"/></td>
+          <td></td>
+        </tr>
+      </table>
+    </ww:form>
+    <p>
+      <ww:url id="registerUrl" action="register" namespace="/"/>
+
+      New user? - <ww:a href="%{registerUrl}">Register!</ww:a>
+    </p>
+  </div>
+</div>
+
+</body>
+</html>
diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/logout.jsp
new file mode 100644 (file)
index 0000000..59e0a8a
--- /dev/null
@@ -0,0 +1,37 @@
+<%--
+  ~ Copyright 2005-2006 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Logout Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Logout</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    You have been successfully logged out!
+  </div>
+</div>
+
+</body>
+</html>
diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/register.jsp
new file mode 100644 (file)
index 0000000..0147c26
--- /dev/null
@@ -0,0 +1,60 @@
+<%--
+  ~ Copyright 2005-2006 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+
+<html>
+<head>
+  <title>Registration Page</title>
+  <ww:head/>
+</head>
+
+<body>
+
+<h1>Registration</h1>
+
+<div id="contentArea">
+  <div id="nameColumn">
+    <ww:form action="register">
+      <table>
+        <tr>
+          <td>Username:</td>
+          <td><ww:textfield name="username"/></td>
+        </tr>
+        <tr>
+          <td>Password:</td>
+          <td><ww:password name="password"/></td>
+        </tr>
+        <tr>
+          <td>Full Name:</td>
+          <td><ww:textfield name="fullName"/></td>
+        </tr>
+        <tr>
+          <td>Email Address:</td>
+          <td><ww:textfield name="email"/></td>
+        </tr>
+        <tr>
+          <td><ww:submit name="Register"/></td>
+          <td></td>
+        </tr>
+      </table>
+    </ww:form>
+  </div>
+</div>
+
+</body>
+</html>