-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take into account the module silverpeas-core-web is splitted in two: - silverpeas-core-rs - and silverpeas-core-web Take into account in the Jenkinsfile build descriptor the property core.version in the pom.xml is valued with a string and no more through a reference to the project version. Indeed, when some Silverpeas components are a dependency of an external project with its own versionning, the project.version property is then the one of the external project and not the one of Silverpeas-Components: it is a dynamic property.
- Loading branch information
Showing
64 changed files
with
368 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...c/integration-test/java/org/silverpeas/components/gallery/stub/SessionManagementStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/* | ||
* Copyright (C) 2000 - 2021 Silverpeas | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* As a special exception to the terms and conditions of version 3.0 of | ||
* the GPL, you may redistribute this Program in connection with Free/Lib | ||
* Open Source Software ("FLOSS") applications as described in Silverpeas | ||
* FLOSS exception. You should have received a copy of the text describin | ||
* the FLOSS exception, and it is also available here: | ||
* "https://www.silverpeas.org/legal/floss_exception.html" | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public Licen | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package org.silverpeas.components.gallery.stub; | ||
|
||
import org.silverpeas.core.admin.user.model.User; | ||
import org.silverpeas.core.admin.user.model.UserDetail; | ||
import org.silverpeas.core.annotation.Service; | ||
import org.silverpeas.core.security.session.SessionInfo; | ||
import org.silverpeas.core.security.session.SessionManagement; | ||
import org.silverpeas.core.security.session.SessionValidationContext; | ||
|
||
import javax.enterprise.inject.Alternative; | ||
import javax.inject.Singleton; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpSession; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.UUID; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.ConcurrentMap; | ||
|
||
@Service | ||
@Singleton | ||
public class SessionManagementStub implements SessionManagement { | ||
|
||
private final ConcurrentMap<String, SessionInfo> userDataSessions = new ConcurrentHashMap<>(100); | ||
|
||
@Override | ||
public Collection<SessionInfo> getConnectedUsersList() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public Collection<SessionInfo> getDistinctConnectedUsersList(final User user) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public int getNbConnectedUsersList(final User user) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public SessionInfo getSessionInfo(final String sessionId) { | ||
SessionInfo session = userDataSessions.get(sessionId); | ||
if (session == null) { | ||
if (UserDetail.getCurrentRequester() != null && UserDetail.getCurrentRequester() | ||
.isAnonymous()) { | ||
session = SessionInfo.AnonymousSession; | ||
} else { | ||
session = SessionInfo.NoneSession; | ||
} | ||
} | ||
return session; | ||
} | ||
|
||
@Override | ||
public boolean isUserConnected(final UserDetail userDetail) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public long getNextSessionTimeOut(final String s) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public SessionInfo validateSession(final String sessionKey) { | ||
return validateSession(SessionValidationContext.withSessionKey(sessionKey)); | ||
} | ||
|
||
@Override | ||
public SessionInfo validateSession(final SessionValidationContext context) { | ||
String sessionKey = context.getSessionKey(); | ||
return getSessionInfo(sessionKey); | ||
} | ||
|
||
@Override | ||
public SessionInfo openSession(final UserDetail user) { | ||
SessionInfo session = new SessionInfo(UUID.randomUUID() | ||
.toString(), user); | ||
return openSession(session); | ||
} | ||
|
||
private SessionInfo openSession(final SessionInfo session) { | ||
userDataSessions.put(session.getSessionId(), session); | ||
return session; | ||
} | ||
|
||
@Override | ||
public SessionInfo openSession(final UserDetail user, final HttpServletRequest request) { | ||
HttpSession httpSession = request.getSession(); | ||
SessionInfo session = new SessionInfo(httpSession.getId(), user); | ||
return openSession(session); | ||
} | ||
|
||
@Override | ||
public SessionInfo openAnonymousSession(final HttpServletRequest httpServletRequest) { | ||
return SessionInfo.AnonymousSession; | ||
} | ||
|
||
@Override | ||
public void closeSession(final String sessionId) { | ||
SessionInfo si = userDataSessions.get(sessionId); | ||
if (si != null) { | ||
userDataSessions.remove(si.getSessionId()); | ||
si.onClosed(); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.