summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-09 05:57:27 (EST)
committerCarsten Drossel2009-01-09 05:57:27 (EST)
commita4205f07567a4b89599ac1e740499adce83d0770 (patch)
tree3323f5285f020c7a86fb43b948e63eaa3ad8005f
parentff2675548145c33dd69e028e1f934d8406ceb2e9 (diff)
downloadorg.eclipse.riena-a4205f07567a4b89599ac1e740499adce83d0770.zip
org.eclipse.riena-a4205f07567a4b89599ac1e740499adce83d0770.tar.gz
org.eclipse.riena-a4205f07567a4b89599ac1e740499adce83d0770.tar.bz2
removed unused classes
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/AuthenticationException.java39
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/PolicyProvider.java32
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java143
3 files changed, 0 insertions, 214 deletions
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/AuthenticationException.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/AuthenticationException.java
deleted file mode 100644
index 4315590..0000000
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/AuthenticationException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 compeople AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * compeople AG - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.riena.security.common.authentication;
-
-/**
- * Checked Exception which indicates an non-fatal error situation caused by the
- * authentication module.
- *
- */
-public class AuthenticationException extends Exception {
-
- private static final long serialVersionUID = 8380874620101404873L;
-
- /**
- * constructor.
- */
- public AuthenticationException() {
- super();
- }
-
- /**
- * constructor.
- *
- * @param message
- * the detail message
- */
- public AuthenticationException(String message) {
- super(message);
- }
-}
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/PolicyProvider.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/PolicyProvider.java
deleted file mode 100644
index 4fd8b9e..0000000
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/PolicyProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 compeople AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * compeople AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.riena.security.common.authorization;
-
-import java.io.FilePermission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-
-import javax.security.auth.Subject;
-
-public class PolicyProvider {
-
- public PolicyProvider() {
- super();
- }
-
- public PermissionCollection getPermissions(Subject subject) {
- System.out.println("PolicyProvider: getPermissions"); //$NON-NLS-1$
- Permissions permissions = new Permissions();
- permissions.add(new FilePermission("foo.txt", "read")); //$NON-NLS-1$ //$NON-NLS-2$
- return permissions;
- }
-
-}
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java
deleted file mode 100644
index 7cefd44..0000000
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 compeople AG and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * compeople AG - initial API and implementation
- *******************************************************************************/
-package org.eclipse.riena.security.common.authorization;
-
-import java.security.CodeSource;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
-import java.security.Principal;
-import java.security.ProtectionDomain;
-import java.util.Enumeration;
-
-import org.eclipse.equinox.log.Logger;
-import org.eclipse.riena.core.injector.Inject;
-import org.eclipse.riena.internal.security.common.Activator;
-import org.osgi.service.log.LogService;
-
-import sun.security.provider.PolicyFile;
-
-/**
- *
- */
-public class RienaPolicy extends Policy {
-
- private static Policy defaultPolicy;
- private IPermissionCache permCache;
- private static final Logger LOGGER = Activator.getDefault().getLogger(RienaPolicy.class);
-
- public RienaPolicy() {
- super();
- Inject.service(IPermissionCache.class.getName()).useRanking().into(this).andStart(
- Activator.getDefault().getContext());
- }
-
- public void bind(IPermissionCache permCache) {
- this.permCache = permCache;
- }
-
- public void unbind(IPermissionCache permCache) {
- if (permCache == this.permCache) {
- this.permCache = null;
- }
- }
-
- /**
- *
- */
- public static void init() {
- RienaPolicy rp = new RienaPolicy();
- Policy.setPolicy(rp);
- defaultPolicy = new PolicyFile();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.security.Policy#getPermissions(java.security.CodeSource)
- */
- @Override
- public PermissionCollection getPermissions(CodeSource codesource) {
- LOGGER.log(LogService.LOG_DEBUG, "rienapolicy: codesource: getPermissions codesource=" //$NON-NLS-1$
- + codesource.getLocation());
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.security.Policy#refresh()
- */
- @Override
- public void refresh() {
- LOGGER.log(LogService.LOG_DEBUG, "rienapolicy: refresh"); //$NON-NLS-1$
- }
-
- @Override
- public PermissionCollection getPermissions(ProtectionDomain domain) {
- LOGGER.log(LogService.LOG_DEBUG, "rienapolicy: domain: getPermissions domain=" //$NON-NLS-1$
- + domain.getCodeSource().getLocation());
- return super.getPermissions(domain);
- }
-
- @Override
- public boolean implies(ProtectionDomain domain, Permission permission) {
- // System.out.print("(Y)");
- if (/* permission instanceof AuthPermission && */domain.getCodeSource().getLocation().toString().contains(
- "/org.eclipse.riena.security.common/")) { //$NON-NLS-1$
- return true;
- }
-
- // this branch is entered if there is no principal set
- if (domain.getPrincipals() == null || domain.getPrincipals().length == 0) {
- boolean result = defaultPolicy.implies(domain, permission);
- if (!result) {
- LOGGER.log(LogService.LOG_WARNING, "no right to do " + permission + " for " //$NON-NLS-1$ //$NON-NLS-2$
- + domain.getCodeSource().getLocation() + " no principal"); //$NON-NLS-1$
- }
- return result;
- }
-
- // this branch is entered if there is at least one principal
- LOGGER.log(LogService.LOG_DEBUG, "rienapolicy: implies "); //$NON-NLS-1$
- for (Principal p : domain.getPrincipals()) {
- LOGGER.log(LogService.LOG_DEBUG, p.toString());
- }
- LOGGER.log(LogService.LOG_DEBUG, " " + permission); //$NON-NLS-1$
- boolean result;
- if (permCache == null) {
- result = defaultPolicy.implies(domain, permission);
- } else {
- Permissions perms = new Permissions();
- for (Principal principal : domain.getPrincipals()) {
- Permissions permsForOnePrincipal = permCache.getPermissions(principal);
- Enumeration<Permission> enumPerms = permsForOnePrincipal.elements();
- while (enumPerms.hasMoreElements()) {
- Permission perm = enumPerms.nextElement();
- perms.add(perm);
- }
-
- }
-
- if (perms != null) {
- result = perms.implies(permission);
- } else {
- result = false;
- }
- }
- if (!result) {
- LOGGER.log(LogService.LOG_ERROR, "no right to do " + permission + " for " //$NON-NLS-1$ //$NON-NLS-2$
- + domain.getCodeSource().getLocation() + " with principal"); //$NON-NLS-1$
- }
- return result;
- }
-}