Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-08-26 19:33:47 -0400
committerRyan D. Brooks2017-08-30 15:03:51 -0400
commit19a2735faeb9bdceb83af1b2fdc240ca9d17f305 (patch)
tree0c215fd73d6e69952451a011c188c56999d971f3
parentc899c7fc9e7cf51718b251626c3701839931eaeb (diff)
downloadorg.eclipse.osee-19a2735faeb9bdceb83af1b2fdc240ca9d17f305.tar.gz
org.eclipse.osee-19a2735faeb9bdceb83af1b2fdc240ca9d17f305.tar.xz
org.eclipse.osee-19a2735faeb9bdceb83af1b2fdc240ca9d17f305.zip
refactor: Replace server Anonymous service with token
-rw-r--r--plugins/org.eclipse.osee.account.admin/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/AccountAdmin.java2
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseeOAuthContext.java (renamed from plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseeOAuthContext.java)3
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseePrincipal.java124
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/UserTokenAccount.java (renamed from plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/BootstrapAccount.java)28
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/ds/AccountStorage.java2
-rw-r--r--plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/internal/AccountAdminImpl.java14
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java2
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountOps.java9
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java5
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/JaxRsAuthenticatorImpl.java113
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseePrincipal.java40
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/OSGI-INF/jaxrs.anonymous.principal.request.filter.xml1
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/AnonymousPrincipalRequestFilter.java20
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/OseePrincipalContextProvider.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OAuthUtil.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OseeOAuthContextProvider.java4
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/ClientProvider.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/ClientProviderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/SubjectProviderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/endpoints/ClientRegistrationEndpoint.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/CustomSecurityContextImpl.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/OseePrincipalImpl.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsAuthenticator.java6
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsOAuthStorage.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsSessionProvider.java2
-rw-r--r--plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/session/JaxRsSessionProviderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java29
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java2
32 files changed, 187 insertions, 245 deletions
diff --git a/plugins/org.eclipse.osee.account.admin/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.account.admin/META-INF/MANIFEST.MF
index a0f04eff25..8f2ff75201 100644
--- a/plugins/org.eclipse.osee.account.admin/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.account.admin/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Service-Component: OSGI-INF/*.xml
Import-Package: org.eclipse.osee.account.rest.model,
org.eclipse.osee.authentication.admin,
org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.logger
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/AccountAdmin.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/AccountAdmin.java
index c7eba99e30..f2927e6beb 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/AccountAdmin.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/AccountAdmin.java
@@ -45,8 +45,6 @@ public interface AccountAdmin {
ResultSet<AccountSession> getAccountSessionById(ArtifactId accountId);
- ResultSet<Account> getAnonymousAccount();
-
boolean setAccountWebPreference(ArtifactId accountId, String key, String itemId, String newValue);
boolean deleteAccount(ArtifactId accountId);
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseeOAuthContext.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseeOAuthContext.java
index 1394c6e59b..7d98b68350 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseeOAuthContext.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseeOAuthContext.java
@@ -8,9 +8,10 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.type;
+package org.eclipse.osee.account.admin;
import java.util.List;
+import org.eclipse.osee.framework.jdk.core.type.OseePermission;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseePrincipal.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseePrincipal.java
new file mode 100644
index 0000000000..26bdff3f14
--- /dev/null
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/OseePrincipal.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Boeing.
+ * 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:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.account.admin;
+
+import java.security.Principal;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.framework.core.enums.SystemUser;
+import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
+import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.type.SystemRoles;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface OseePrincipal extends Principal, Identity<Long> {
+
+ String getLogin();
+
+ Set<String> getRoles();
+
+ String getDisplayName();
+
+ String getUserName();
+
+ String getEmailAddress();
+
+ boolean isActive();
+
+ boolean isAuthenticated();
+
+ Map<String, String> getProperties();
+
+ String getOseeGuid();
+
+ public static final OseePrincipal Anonymous = createAnonymous();
+
+ public static OseePrincipal createAnonymous() {
+ Set<String> roles = new LinkedHashSet<>();
+ roles.add(SystemRoles.ROLES_ANONYMOUS);
+ Account account = UserTokenAccount.Anonymous;
+ return OseePrincipal.valueOf(SystemUser.Anonymous.getName(), account, true, roles, Collections.emptyMap());
+ }
+
+ public static OseePrincipal valueOf(String login, Account data, boolean authenticated, Set<String> roles, Map<String, String> properties) {
+ final class OseePrincipalImpl extends BaseIdentity<Long> implements OseePrincipal {
+ private final String login;
+ private final Account data;
+ private final boolean authenticated;
+ private final Set<String> roles;
+ private final Map<String, String> properties;
+
+ public OseePrincipalImpl(String login, Account data, boolean authenticated, Set<String> roles, Map<String, String> properties) {
+ super(data.getId());
+ this.login = login;
+ this.data = data;
+ this.authenticated = authenticated;
+ this.roles = roles;
+ this.properties = properties;
+ }
+
+ @Override
+ public String getDisplayName() {
+ return data.getName();
+ }
+
+ @Override
+ public String getUserName() {
+ return data.getUserName();
+ }
+
+ @Override
+ public String getEmailAddress() {
+ return data.getEmail();
+ }
+
+ @Override
+ public boolean isActive() {
+ return data.isActive();
+ }
+
+ @Override
+ public Set<String> getRoles() {
+ return roles;
+ }
+
+ @Override
+ public boolean isAuthenticated() {
+ return authenticated;
+ }
+
+ @Override
+ public String getName() {
+ return getDisplayName();
+ }
+
+ @Override
+ public String getLogin() {
+ return login;
+ }
+
+ @Override
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public String getOseeGuid() {
+ return data.getGuid();
+ }
+ }
+ return new OseePrincipalImpl(login, data, authenticated, roles, properties);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/BootstrapAccount.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/UserTokenAccount.java
index 291291d9f1..e72e8d6f0a 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/BootstrapAccount.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/UserTokenAccount.java
@@ -8,49 +8,52 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.account.admin.internal;
+package org.eclipse.osee.account.admin;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
-import org.eclipse.osee.account.admin.Account;
-import org.eclipse.osee.account.admin.AccountPreferences;
import org.eclipse.osee.account.rest.model.AccountWebPreferences;
+import org.eclipse.osee.framework.core.data.UserToken;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
/**
* @author Roberto E. Escobar
*/
-public class BootstrapAccount extends BaseIdentity<String>implements Account, AccountPreferences {
+public class UserTokenAccount extends BaseIdentity<String> implements Account, AccountPreferences {
+ public static final UserTokenAccount Anonymous = new UserTokenAccount(SystemUser.Anonymous);
- public BootstrapAccount() {
- super(SystemUser.BootStrap.getGuid());
+ private final UserToken user;
+
+ public UserTokenAccount(UserToken user) {
+ super(user.getGuid());
+ this.user = user;
}
@Override
public Long getId() {
- return -1L;
+ return user.getId();
}
@Override
public boolean isActive() {
- return SystemUser.BootStrap.isActive();
+ return user.isActive();
}
@Override
public String getName() {
- return SystemUser.BootStrap.getName();
+ return user.getName();
}
@Override
public String getUserName() {
- return SystemUser.BootStrap.getUserId();
+ return user.getUserId();
}
@Override
public String getEmail() {
- return SystemUser.BootStrap.getEmail();
+ return user.getEmail();
}
@Override
@@ -82,5 +85,4 @@ public class BootstrapAccount extends BaseIdentity<String>implements Account, Ac
public AccountWebPreferences getWebPreferences() {
return null;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/ds/AccountStorage.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/ds/AccountStorage.java
index 612987df75..e1b89a69eb 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/ds/AccountStorage.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/ds/AccountStorage.java
@@ -50,8 +50,6 @@ public interface AccountStorage {
void deleteAccountSessionBySessionToken(String sessionToken);
- ResultSet<Account> getAnonymousAccount();
-
AccountWebPreferences getAccountWebPreferencesById(ArtifactId accountId);
void setAccountWebPreferences(ArtifactId artifactId, String preferences);
diff --git a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/internal/AccountAdminImpl.java b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/internal/AccountAdminImpl.java
index d17357a754..50c7832e32 100644
--- a/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/internal/AccountAdminImpl.java
+++ b/plugins/org.eclipse.osee.account.admin/src/org/eclipse/osee/account/admin/internal/AccountAdminImpl.java
@@ -43,7 +43,6 @@ import org.eclipse.osee.logger.Log;
* @author Roberto E. Escobar
*/
public class AccountAdminImpl implements AccountAdmin {
-
private Log logger;
private AccountStorage storage;
private AuthenticationAdmin authenticationAdmin;
@@ -228,10 +227,10 @@ public class AccountAdminImpl implements AccountAdmin {
private String authenticate(AccountLoginRequest login) {
AuthenticationRequest request = AuthenticationRequestBuilder.newBuilder()//
- .scheme(login.getScheme())//
- .userName(login.getUserName())//
- .password(login.getPassword())//
- .build();
+ .scheme(login.getScheme())//
+ .userName(login.getUserName())//
+ .password(login.getPassword())//
+ .build();
AuthenticatedUser authenticate = authenticationAdmin.authenticate(request);
return authenticate.getEmailAddress();
@@ -250,11 +249,6 @@ public class AccountAdminImpl implements AccountAdmin {
}
@Override
- public ResultSet<Account> getAnonymousAccount() {
- return storage.getAnonymousAccount();
- }
-
- @Override
public ResultSet<Account> getAccountByEmail(String email) {
Conditions.checkNotNull(email, "email");
return getStorage().getAccountByEmail(email);
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
index 239e702823..5baede6095 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountDataUtil.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.account.rest.internal;
import org.eclipse.osee.account.admin.Account;
import org.eclipse.osee.account.admin.AccountPreferences;
import org.eclipse.osee.account.admin.AccountSession;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionGroup;
import org.eclipse.osee.account.rest.model.AccountActiveData;
@@ -23,7 +24,6 @@ import org.eclipse.osee.account.rest.model.AccountSessionData;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountOps.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountOps.java
index 73b3f69940..14c66b8b1c 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountOps.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountOps.java
@@ -176,11 +176,4 @@ public class AccountOps {
public boolean setAccountPreferences(ArtifactId accountId, AccountPreferencesInput input) {
return accountAdmin.setAccountPreferences(accountId, input.getMap());
}
-
- public AccountInfoData getAnonymousAccount() {
- ResultSet<Account> result = accountAdmin.getAnonymousAccount();
- Account account = result.getExactlyOne();
- return AccountDataUtil.asAccountData(account);
- }
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
index 516c4f5e5d..f29b0e9b41 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountsResource.java
@@ -22,11 +22,12 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.eclipse.osee.account.admin.OseePrincipal;
+import org.eclipse.osee.account.admin.UserTokenAccount;
import org.eclipse.osee.account.rest.model.AccountContexts;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
/**
* @author Roberto E. Escobar
@@ -49,7 +50,7 @@ public class AccountsResource {
if (principal != null) {
toReturn = AccountDataUtil.asAccountInfoData(principal);
} else {
- toReturn = accountOps.getAnonymousAccount();
+ toReturn = AccountDataUtil.asAccountData(UserTokenAccount.Anonymous);
}
return toReturn;
}
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/JaxRsAuthenticatorImpl.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/JaxRsAuthenticatorImpl.java
index 4071359354..4da0aeadfc 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/JaxRsAuthenticatorImpl.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/JaxRsAuthenticatorImpl.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.account.admin.Account;
import org.eclipse.osee.account.admin.AccountAdmin;
import org.eclipse.osee.account.admin.CreateAccountRequest;
import org.eclipse.osee.account.admin.CreateAccountRequestBuilder;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.authentication.admin.AuthenticatedUser;
import org.eclipse.osee.authentication.admin.AuthenticationAdmin;
import org.eclipse.osee.authentication.admin.AuthenticationRequest;
@@ -30,9 +31,7 @@ import org.eclipse.osee.authorization.admin.AuthorizationRequest;
import org.eclipse.osee.authorization.admin.AuthorizationRequestBuilder;
import org.eclipse.osee.authorization.admin.AuthorizationUser;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.SystemRoles;
import org.eclipse.osee.jaxrs.server.security.JaxRsAuthenticator;
@@ -45,7 +44,6 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
private AuthenticationAdmin authenticationAdmin;
private AuthorizationAdmin authorizationAdmin;
private AccountAdmin accountAdmin;
-
private volatile boolean automaticAccountCreationAllowed = DEFAULT_JAXRS_AUTH__ALLOW_AUTOMATIC_ACCOUNT_CREATION;
public void setAuthenticationAdmin(AuthenticationAdmin authenticationAdmin) {
@@ -74,29 +72,11 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
}
@Override
- public OseePrincipal getAnonymousPrincipal() {
- ResultSet<Account> result = accountAdmin.getAnonymousAccount();
-
- OseePrincipal anonymous = null;
- Account account = result.getOneOrNull();
- if (account != null) {
- Set<String> roles = new LinkedHashSet<>();
- roles.add(SystemRoles.ROLES_ANONYMOUS);
- // Get additional roles/permissions from authorization service;
-
- // Preferences or other user specific properties
- Map<String, String> properties = Collections.emptyMap();
- anonymous = new OseePrincipalImpl(account.getUserName(), account, true, roles, properties);
- }
- return anonymous;
- }
-
- @Override
public OseePrincipal authenticate(String scheme, String username, String password) {
AuthenticationRequest request = AuthenticationRequestBuilder.newBuilder() //
- .userName(username)//
- .password(password)//
- .build();
+ .userName(username)//
+ .password(password)//
+ .build();
AuthenticatedUser subject = authenticationAdmin.authenticate(request);
Account account = resolveAccount(username, subject, automaticAccountCreationAllowed);
@@ -112,9 +92,9 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
}
// Get additional roles/permissions from authorization service;
AuthorizationRequest authorizationRequest = AuthorizationRequestBuilder.newBuilder()//
- .secure(true) //
- .identifier(account.getId())//
- .build();
+ .secure(true) //
+ .identifier(account.getId())//
+ .build();
Authorization authorize = authorizationAdmin.authorize(authorizationRequest);
AuthorizationUser authUser = (AuthorizationUser) authorize.getPrincipal();
@@ -125,7 +105,7 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
// Preferences or other user specific properties
Map<String, String> properties = Collections.emptyMap();
- return new OseePrincipalImpl(username, account, subject.isAuthenticated(), roles, properties);
+ return OseePrincipal.Anonymous;
}
private Account resolveAccount(String login, AuthenticatedUser subject, boolean accountCreationAllowed) {
@@ -134,11 +114,11 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
if (account == null) {
if (subject.isAuthenticated() && accountCreationAllowed) {
CreateAccountRequest request = CreateAccountRequestBuilder.newBuilder()//
- .active(subject.isActive())//
- .displayName(subject.getDisplayName())//
- .email(subject.getEmailAddress())//
- .userName(subject.getUserName())//
- .build();
+ .active(subject.isActive())//
+ .displayName(subject.getDisplayName())//
+ .email(subject.getEmailAddress())//
+ .userName(subject.getUserName())//
+ .build();
ArtifactId accountId = accountAdmin.createAccount(request);
account = accountAdmin.getAccountById(accountId).getExactlyOne();
} else {
@@ -162,71 +142,4 @@ public class JaxRsAuthenticatorImpl implements JaxRsAuthenticator {
return toReturn;
}
- private static final class OseePrincipalImpl extends BaseIdentity<Long> implements OseePrincipal {
- private final String login;
- private final Account data;
- private final boolean authenticated;
- private final Set<String> roles;
- private final Map<String, String> properties;
-
- public OseePrincipalImpl(String login, Account data, boolean authenticated, Set<String> roles, Map<String, String> properties) {
- super(data.getId());
- this.login = login;
- this.data = data;
- this.authenticated = authenticated;
- this.roles = roles;
- this.properties = properties;
- }
-
- @Override
- public String getDisplayName() {
- return data.getName();
- }
-
- @Override
- public String getUserName() {
- return data.getUserName();
- }
-
- @Override
- public String getEmailAddress() {
- return data.getEmail();
- }
-
- @Override
- public boolean isActive() {
- return data.isActive();
- }
-
- @Override
- public Set<String> getRoles() {
- return roles;
- }
-
- @Override
- public boolean isAuthenticated() {
- return authenticated;
- }
-
- @Override
- public String getName() {
- return getDisplayName();
- }
-
- @Override
- public String getLogin() {
- return login;
- }
-
- @Override
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public String getOseeGuid() {
- return data.getGuid();
- }
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseePrincipal.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseePrincipal.java
deleted file mode 100644
index 68d41821b6..0000000000
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/OseePrincipal.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.jdk.core.type;
-
-import java.security.Principal;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface OseePrincipal extends Principal, Identity<Long> {
-
- String getLogin();
-
- Set<String> getRoles();
-
- String getDisplayName();
-
- String getUserName();
-
- String getEmailAddress();
-
- boolean isActive();
-
- boolean isAuthenticated();
-
- Map<String, String> getProperties();
-
- String getOseeGuid();
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.jaxrs.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.jaxrs.server/META-INF/MANIFEST.MF
index c65d51612b..db790b3cb8 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.jaxrs.server/META-INF/MANIFEST.MF
@@ -63,6 +63,7 @@ Import-Package: com.google.common.cache;version="15.0.0",
org.apache.cxf.transport.http;version="3.0.0",
org.apache.cxf.transport.servlet;version="3.0.0",
org.codehaus.jackson.jaxrs;version="1.9.13",
+ org.eclipse.osee.account.admin,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
diff --git a/plugins/org.eclipse.osee.jaxrs.server/OSGI-INF/jaxrs.anonymous.principal.request.filter.xml b/plugins/org.eclipse.osee.jaxrs.server/OSGI-INF/jaxrs.anonymous.principal.request.filter.xml
index c23ee1debf..3942e0608f 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/OSGI-INF/jaxrs.anonymous.principal.request.filter.xml
+++ b/plugins/org.eclipse.osee.jaxrs.server/OSGI-INF/jaxrs.anonymous.principal.request.filter.xml
@@ -5,5 +5,4 @@
<provide interface="javax.ws.rs.container.ContainerRequestFilter"/>
<provide interface="java.lang.Object"/>
</service>
- <reference bind="setJaxRsAuthenticator" cardinality="1..1" interface="org.eclipse.osee.jaxrs.server.security.JaxRsAuthenticator" name="JaxRsAuthenticator" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/AnonymousPrincipalRequestFilter.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/AnonymousPrincipalRequestFilter.java
index 7da97043f9..49635388d2 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/AnonymousPrincipalRequestFilter.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/AnonymousPrincipalRequestFilter.java
@@ -19,9 +19,8 @@ import javax.ws.rs.ext.Provider;
import org.apache.cxf.jaxrs.ext.MessageContext;
import org.apache.cxf.jaxrs.ext.MessageContextImpl;
import org.apache.cxf.phase.PhaseInterceptorChain;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.OAuthUtil;
-import org.eclipse.osee.jaxrs.server.security.JaxRsAuthenticator;
/**
* @author Roberto E. Escobar
@@ -30,28 +29,19 @@ import org.eclipse.osee.jaxrs.server.security.JaxRsAuthenticator;
@PreMatching
public class AnonymousPrincipalRequestFilter implements ContainerRequestFilter {
- private JaxRsAuthenticator authenticator;
-
- public void setJaxRsAuthenticator(JaxRsAuthenticator authenticator) {
- this.authenticator = authenticator;
- }
-
@Override
public void filter(ContainerRequestContext requestContext) {
SecurityContext sc = requestContext.getSecurityContext();
Principal principal = sc.getUserPrincipal();
if (principal == null) {
- OseePrincipal anonymousPrincipal = authenticator.getAnonymousPrincipal();
- if (anonymousPrincipal != null) {
- org.apache.cxf.security.SecurityContext securityContext = OAuthUtil.newSecurityContext(anonymousPrincipal);
- MessageContext mc = getMessageContext();
- OAuthUtil.saveSecurityContext(mc, securityContext);
- }
+ org.apache.cxf.security.SecurityContext securityContext =
+ OAuthUtil.newSecurityContext(OseePrincipal.Anonymous);
+ MessageContext mc = getMessageContext();
+ OAuthUtil.saveSecurityContext(mc, securityContext);
}
}
public MessageContext getMessageContext() {
return new MessageContextImpl(PhaseInterceptorChain.getCurrentMessage());
}
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/OseePrincipalContextProvider.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/OseePrincipalContextProvider.java
index 4dc283c406..298759dd77 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/OseePrincipalContextProvider.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/OseePrincipalContextProvider.java
@@ -15,7 +15,7 @@ import javax.ws.rs.ext.Provider;
import org.apache.cxf.jaxrs.ext.ContextProvider;
import org.apache.cxf.message.Message;
import org.apache.cxf.security.SecurityContext;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OAuthUtil.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OAuthUtil.java
index 398f760d93..60d831f458 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OAuthUtil.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OAuthUtil.java
@@ -41,8 +41,8 @@ import org.apache.cxf.rs.security.oauth2.utils.AuthorizationUtils;
import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
import org.apache.cxf.security.LoginSecurityContext;
import org.apache.cxf.security.SecurityContext;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.server.internal.JaxRsUtils;
import org.eclipse.osee.jaxrs.server.internal.security.util.CustomSecurityContextImpl;
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OseeOAuthContextProvider.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OseeOAuthContextProvider.java
index 0526d923fc..89c8eb53bf 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OseeOAuthContextProvider.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/OseeOAuthContextProvider.java
@@ -20,10 +20,10 @@ import org.apache.cxf.message.Message;
import org.apache.cxf.rs.security.oauth2.common.OAuthPermission;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
import org.apache.cxf.security.SecurityContext;
+import org.eclipse.osee.account.admin.OseeOAuthContext;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
-import org.eclipse.osee.framework.jdk.core.type.OseeOAuthContext;
import org.eclipse.osee.framework.jdk.core.type.OseePermission;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/ClientProvider.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/ClientProvider.java
index ac35188053..91507869c3 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/ClientProvider.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/ClientProvider.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.jaxrs.server.internal.security.oauth2.provider;
import java.io.InputStream;
import javax.ws.rs.core.UriInfo;
import org.apache.cxf.rs.security.oauth2.common.Client;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.provider.endpoints.ClientFormData;
import com.google.common.io.InputSupplier;
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/ClientProviderImpl.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/ClientProviderImpl.java
index 1c084e1c8a..d3a8698fea 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/ClientProviderImpl.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/ClientProviderImpl.java
@@ -24,7 +24,7 @@ import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
import org.apache.cxf.rs.security.oauth2.utils.OAuthUtils;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.provider.ClientProvider;
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/SubjectProviderImpl.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/SubjectProviderImpl.java
index 253386911b..3585c07f41 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/SubjectProviderImpl.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/adapters/SubjectProviderImpl.java
@@ -29,7 +29,7 @@ import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
import org.apache.cxf.rs.security.oauth2.utils.OAuthUtils;
import org.apache.cxf.security.SecurityContext;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.OAuthUtil;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.provider.SubjectProvider;
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/endpoints/ClientRegistrationEndpoint.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/endpoints/ClientRegistrationEndpoint.java
index 3481e2c3c1..b1267c6c88 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/endpoints/ClientRegistrationEndpoint.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/oauth2/provider/endpoints/ClientRegistrationEndpoint.java
@@ -45,7 +45,7 @@ import org.apache.cxf.rs.security.oauth2.common.Client;
import org.apache.cxf.rs.security.oauth2.common.UserSubject;
import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
import org.apache.cxf.security.SecurityContext;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.jaxrs.server.internal.security.oauth2.OAuthUtil;
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/CustomSecurityContextImpl.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/CustomSecurityContextImpl.java
index 8cfe41ad37..9a369fb7c6 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/CustomSecurityContextImpl.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/CustomSecurityContextImpl.java
@@ -19,7 +19,7 @@ import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import org.apache.cxf.security.SecurityContext;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/OseePrincipalImpl.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/OseePrincipalImpl.java
index 2d272836f5..9c3fc96b50 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/OseePrincipalImpl.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/internal/security/util/OseePrincipalImpl.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.jaxrs.server.internal.security.util;
import java.util.Map;
import java.util.Set;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsAuthenticator.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsAuthenticator.java
index ec5254ffa9..7037c5ff6c 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsAuthenticator.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsAuthenticator.java
@@ -10,15 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.jaxrs.server.security;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
/**
* @author Roberto E. Escobar
*/
public interface JaxRsAuthenticator {
-
OseePrincipal authenticate(String scheme, String username, String password);
-
- OseePrincipal getAnonymousPrincipal();
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsOAuthStorage.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsOAuthStorage.java
index b32ae57778..acc54e8c45 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsOAuthStorage.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsOAuthStorage.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.jaxrs.server.security;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsSessionProvider.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsSessionProvider.java
index 4de3e0be59..88125cda63 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsSessionProvider.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/security/JaxRsSessionProvider.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.jaxrs.server.security;
import javax.servlet.http.HttpSession;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.jaxrs.server.session.SessionData;
/**
diff --git a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/session/JaxRsSessionProviderImpl.java b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/session/JaxRsSessionProviderImpl.java
index e616ea4221..8760ea4516 100644
--- a/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/session/JaxRsSessionProviderImpl.java
+++ b/plugins/org.eclipse.osee.jaxrs.server/src/org/eclipse/osee/jaxrs/server/session/JaxRsSessionProviderImpl.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.jaxrs.server.session;
import java.util.Collections;
import java.util.UUID;
import javax.servlet.http.HttpSession;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.server.security.JaxRsSessionProvider;
import org.eclipse.osee.jdbc.JdbcClient;
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
index 48665d69ad..cc0ce99f56 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
@@ -19,8 +19,8 @@ import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.jaxrs.server.security.JaxRsOAuthStorage;
import org.eclipse.osee.jaxrs.server.security.OAuthClient;
import org.eclipse.osee.jaxrs.server.security.OAuthCodeGrant;
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
index 16fd0fbe83..0777bc2767 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.account.admin.internal;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
import java.io.StringWriter;
import java.util.Collections;
import java.util.Map;
@@ -25,11 +23,9 @@ import org.eclipse.osee.account.rest.model.AccountWebPreferences;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
-import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -42,8 +38,6 @@ public class OrcsAccountStorage extends AbstractOrcsStorage implements AccountSt
private JdbcService jdbcService;
private AccountSessionStorage sessionStore;
- private Account bootstrapAccount;
- private final Supplier<ResultSet<Account>> anonymousAccountSupplier = Suppliers.memoize(getAnonymousSupplier());
public void setJdbcService(JdbcService jdbcService) {
this.jdbcService = jdbcService;
@@ -54,7 +48,6 @@ public class OrcsAccountStorage extends AbstractOrcsStorage implements AccountSt
super.start();
JdbcClient jdbcClient = jdbcService.getClient();
sessionStore = new AccountSessionDatabaseStore(getLogger(), jdbcClient, getFactory());
- bootstrapAccount = new BootstrapAccount();
}
@Override
@@ -203,28 +196,6 @@ public class OrcsAccountStorage extends AbstractOrcsStorage implements AccountSt
}
@Override
- public ResultSet<Account> getAnonymousAccount() {
- ResultSet<Account> toReturn;
- if (isInitialized()) {
- toReturn = anonymousAccountSupplier.get();
- } else {
- toReturn = ResultSets.singleton(bootstrapAccount);
- }
- return toReturn;
- }
-
- private Supplier<ResultSet<Account>> getAnonymousSupplier() {
- return new Supplier<ResultSet<Account>>() {
- @Override
- public ResultSet<Account> get() {
- ResultSet<ArtifactReadable> results =
- newQuery().andIsOfType(CoreArtifactTypes.User).andUuid(SystemUser.Anonymous.getUuid()).getResults();
- return getFactory().newAccountResultSet(results);
- }
- };
- }
-
- @Override
public void setAccountWebPreferences(ArtifactId artifactId, String preferences) {
TransactionBuilder tx = newTransaction("User - Save Web Preferences");
tx.setSoleAttributeFromString(artifactId, CoreAttributeTypes.WebPreferences, preferences);
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
index be356a349c..0a7dc370d2 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientStorage.java
@@ -26,12 +26,12 @@ import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.jaxrs.server.security.OAuthClient;
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
index a32c6d1169..d071692672 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
@@ -11,8 +11,8 @@
package org.eclipse.osee.orcs.account.admin.internal.oauth;
import java.util.List;
+import org.eclipse.osee.account.admin.OseePrincipal;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.jaxrs.server.security.JaxRsOAuthStorage;
import org.eclipse.osee.jaxrs.server.security.OAuthClient;
import org.eclipse.osee.jaxrs.server.security.OAuthCodeGrant;

Back to the top