This repository has been archived by the owner on Mar 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from junkerm/develop
v0.2.3
- Loading branch information
Showing
69 changed files
with
42,697 additions
and
41,837 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
Binary file added
BIN
+686 KB
bundles/cnf/localrepo/com.sun.jersey.jersey-server/com.sun.jersey.jersey-server-1.19.0.jar
Binary file not shown.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
d4e95238dbdcf0608ad506462b622dbd2114f4950853eb4fb6414b724bfa6a34 | ||
e69e11017af52961825c2fc277d656b9e167524fcd1644cd2800c540dcc68976 |
Binary file added
BIN
+45.3 KB
bundles/cnf/localrepo/javax.ws.rs.jsr311-api/javax.ws.rs.jsr311-api-1.1.1.jar
Binary file not shown.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<repository increment="0" name="Release" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0"> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<repository increment="0" name="Release" xmlns="http://www.osgi.org/xmlns/repository/v1.0.0"> | ||
</repository> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
262a924c4164db96f2409bfbe8d20793eb0c91a51c3dcd7c2160cde2bac8a492 | ||
b699f269b1871b7ef42e54b5ceb7529989f9474ffa4217c696e5ad333ac8936c |
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
126 changes: 63 additions & 63 deletions
126
bundles/specmate-emfrest/src/com/specmate/emfrest/authentication/Login.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 |
---|---|---|
@@ -1,63 +1,63 @@ | ||
package com.specmate.emfrest.authentication; | ||
|
||
import javax.ws.rs.core.Response; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.osgi.service.log.LogService; | ||
|
||
import com.specmate.auth.api.IAuthenticationService; | ||
import com.specmate.common.RestResult; | ||
import com.specmate.common.SpecmateException; | ||
import com.specmate.emfrest.api.IRestService; | ||
import com.specmate.emfrest.api.RestServiceBase; | ||
import com.specmate.usermodel.User; | ||
import com.specmate.usermodel.UserSession; | ||
|
||
@Component(service = IRestService.class) | ||
public class Login extends RestServiceBase { | ||
public static final String SERVICE_NAME = "login"; | ||
|
||
private IAuthenticationService authService; | ||
private LogService logService; | ||
|
||
@Override | ||
public String getServiceName() { | ||
return SERVICE_NAME; | ||
} | ||
|
||
@Override | ||
public boolean canPost(Object object2, Object object) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public RestResult<?> post(Object object, Object object2, String token) throws SpecmateException { | ||
if (object2 instanceof User) { | ||
User user = (User) object2; | ||
try { | ||
UserSession session = authService.authenticate(user.getUserName(), user.getPassWord(), | ||
user.getProjectName()); | ||
logService.log(LogService.LOG_INFO, | ||
"Session " + session.getId() + " for user " + user.getUserName() + " created."); | ||
return new RestResult<>(Response.Status.OK, session); | ||
|
||
} catch (SpecmateException e) { | ||
logService.log(LogService.LOG_INFO, e.getMessage()); | ||
return new RestResult<>(Response.Status.FORBIDDEN); | ||
} | ||
} else { | ||
throw new SpecmateException("Invalid login data."); | ||
} | ||
} | ||
|
||
@Reference | ||
public void setAuthService(IAuthenticationService authService) { | ||
this.authService = authService; | ||
} | ||
|
||
@Reference | ||
public void setLogService(LogService logService) { | ||
this.logService = logService; | ||
} | ||
} | ||
package com.specmate.emfrest.authentication; | ||
|
||
import javax.ws.rs.core.Response; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.osgi.service.log.LogService; | ||
|
||
import com.specmate.auth.api.IAuthenticationService; | ||
import com.specmate.common.SpecmateException; | ||
import com.specmate.emfrest.api.IRestService; | ||
import com.specmate.emfrest.api.RestServiceBase; | ||
import com.specmate.rest.RestResult; | ||
import com.specmate.usermodel.User; | ||
import com.specmate.usermodel.UserSession; | ||
|
||
@Component(service = IRestService.class) | ||
public class Login extends RestServiceBase { | ||
public static final String SERVICE_NAME = "login"; | ||
|
||
private IAuthenticationService authService; | ||
private LogService logService; | ||
|
||
@Override | ||
public String getServiceName() { | ||
return SERVICE_NAME; | ||
} | ||
|
||
@Override | ||
public boolean canPost(Object object2, Object object) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public RestResult<?> post(Object object, Object object2, String token) throws SpecmateException { | ||
if (object2 instanceof User) { | ||
User user = (User) object2; | ||
try { | ||
UserSession session = authService.authenticate(user.getUserName(), user.getPassWord(), | ||
user.getProjectName()); | ||
logService.log(LogService.LOG_INFO, | ||
"Session " + session.getId() + " for user " + user.getUserName() + " created."); | ||
return new RestResult<>(Response.Status.OK, session); | ||
|
||
} catch (SpecmateException e) { | ||
logService.log(LogService.LOG_INFO, e.getMessage()); | ||
return new RestResult<>(Response.Status.FORBIDDEN); | ||
} | ||
} else { | ||
throw new SpecmateException("Invalid login data."); | ||
} | ||
} | ||
|
||
@Reference | ||
public void setAuthService(IAuthenticationService authService) { | ||
this.authService = authService; | ||
} | ||
|
||
@Reference | ||
public void setLogService(LogService logService) { | ||
this.logService = logService; | ||
} | ||
} |
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
Oops, something went wrong.