-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fixes #67: Migrate to Jersey 2 This updates the Jersey dependency from 1.x to 2.x. This commit requires OF-2352 / igniterealtime/Openfire#1945 which means that this PR will _not_ work with 4.7.0 beta (but hopefully will with 4.7.0 non-beta). * fixes #1: Migrate to Swagger This commit introduces an automatically generated Swagger-based REST client on /plugins/restapi/docs/index.html Note that this can't be used 'offline'. We still need to replace the static documentation (in readme.html) with something that's generated during compilation/packaging (issue #71) * Add Swagger annotations to document endpoints By adding certain annotations, the documentation as generated by Swagger becomes enriched. * Add JsonProperty matching XmlElementWrapper name * Add JsonProperty annotation for a user's groupnames Co-authored-by: Dan Caseley <[email protected]>
- Loading branch information
1 parent
eeae470
commit 5ced36b
Showing
55 changed files
with
1,246 additions
and
454 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
27 changes: 12 additions & 15 deletions
27
src/java/org/jivesoftware/openfire/plugin/rest/CORSFilter.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,26 +1,23 @@ | ||
package org.jivesoftware.openfire.plugin.rest; | ||
|
||
import com.sun.jersey.spi.container.ContainerRequest; | ||
import com.sun.jersey.spi.container.ContainerResponse; | ||
import com.sun.jersey.spi.container.ContainerResponseFilter; | ||
import javax.annotation.Priority; | ||
import javax.ws.rs.Priorities; | ||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.container.ContainerResponseContext; | ||
import javax.ws.rs.container.ContainerResponseFilter; | ||
import java.io.IOException; | ||
|
||
/** | ||
* The Class CORSFilter. | ||
*/ | ||
@Priority(Priorities.HEADER_DECORATOR) | ||
public class CORSFilter implements ContainerResponseFilter { | ||
|
||
/* (non-Javadoc) | ||
* @see com.sun.jersey.spi.container.ContainerResponseFilter#filter(com.sun.jersey.spi.container.ContainerRequest, com.sun.jersey.spi.container.ContainerResponse) | ||
*/ | ||
@Override | ||
public ContainerResponse filter(ContainerRequest request, ContainerResponse response) { | ||
response.getHttpHeaders().add("Access-Control-Allow-Origin", "*"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Headers", | ||
"origin, content-type, accept, authorization"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Credentials", "true"); | ||
response.getHttpHeaders().add("Access-Control-Allow-Methods", | ||
"GET, POST, PUT, DELETE, OPTIONS, HEAD"); | ||
|
||
return response; | ||
public void filter(ContainerRequestContext requestContext, ContainerResponseContext response) throws IOException { | ||
response.getHeaders().add("Access-Control-Allow-Origin", "*"); | ||
response.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); | ||
response.getHeaders().add("Access-Control-Allow-Credentials", "true"); | ||
response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD"); | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
src/java/org/jivesoftware/openfire/plugin/rest/entity/GroupEntities.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
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
4 changes: 2 additions & 2 deletions
4
src/java/org/jivesoftware/openfire/plugin/rest/entity/MUCRoomEntities.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
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
5 changes: 2 additions & 3 deletions
5
src/java/org/jivesoftware/openfire/plugin/rest/entity/OccupantEntities.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
Oops, something went wrong.