summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/host-http
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-02-26 04:41:26 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-02-26 04:41:26 +0000
commit750e2e19dddb236c49d458ff27c2ab50b1848a63 (patch)
tree95acb6f1b3b9d9e0b38c1dbd96227c70a039fd6f /branches/sca-java-1.x/modules/host-http
parentccdb9264ce71a776d4bb1cbf66a4e3f5012b48fd (diff)
Adding support for enabling and configuring authentication for embedded http server using policy
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@748014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/host-http')
-rw-r--r--branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/SecurityContext.java17
-rw-r--r--branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/UserContext.java68
2 files changed, 85 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/SecurityContext.java b/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/SecurityContext.java
index 05140d6e29..f290bb3e59 100644
--- a/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/SecurityContext.java
+++ b/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/SecurityContext.java
@@ -19,6 +19,8 @@
package org.apache.tuscany.sca.host.http;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Properties;
/**
@@ -29,6 +31,9 @@ public class SecurityContext {
private boolean isSSLEnabled = false;
private Properties sslProperties;
+ private boolean isAuthenticationEnabled = false;
+ private List<UserContext> users = new ArrayList<UserContext>();
+
public boolean isSSLEnabled() {
return isSSLEnabled;
}
@@ -44,4 +49,16 @@ public class SecurityContext {
public void setSSLProperties(Properties sslProperties) {
this.sslProperties = sslProperties;
}
+
+ public boolean isAuthenticationEnabled() {
+ return this.isAuthenticationEnabled;
+ }
+
+ public void setAuthenticationEnabled(boolean value) {
+ this.isAuthenticationEnabled = value;
+ }
+
+ public List<UserContext> getUsers() {
+ return this.users;
+ }
}
diff --git a/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/UserContext.java b/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/UserContext.java
new file mode 100644
index 0000000000..4a19eda81d
--- /dev/null
+++ b/branches/sca-java-1.x/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/UserContext.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.tuscany.sca.host.http;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Model class used to define list of users and it's roles
+ *
+ * These info is used to configure authentication/authorization
+ * in embedded http servers
+ *
+ * @version $Rev$ $Date$
+ */
+public class UserContext {
+ private String username;
+ private String password;
+ private List<String> roles = new ArrayList<String>();
+
+
+ public UserContext() {
+
+ }
+
+ public UserContext(String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ public String getUsername() {
+ return this.username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return this.password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public List<String> getRoles() {
+ return this.roles;
+ }
+
+}