-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request changes, added rest api key feature
- Loading branch information
1 parent
37ba14f
commit 7670c97
Showing
13 changed files
with
88 additions
and
24 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
Binary file modified
BIN
-1.05 KB
(100%)
talentlink-connector/lib/generated/rest/jaxRsClient_d8e4652e-41d5-4023-90c5-5c822b8600e2.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
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
14 changes: 14 additions & 0 deletions
14
talentlink-connector/src/com/axonivy/connector/talentlink/features/RestApiFeature.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,14 @@ | ||
package com.axonivy.connector.talentlink.features; | ||
|
||
import javax.ws.rs.core.FeatureContext; | ||
|
||
import ch.ivyteam.ivy.rest.client.mapper.JsonFeature; | ||
|
||
public class RestApiFeature extends JsonFeature{ | ||
|
||
@Override | ||
public boolean configure(FeatureContext context) { | ||
context.register(TalentlinkQueryStringFilter.class); | ||
return true; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...-connector/src/com/axonivy/connector/talentlink/features/TalentlinkQueryStringFilter.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,27 @@ | ||
package com.axonivy.connector.talentlink.features; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.util.regex.Matcher; | ||
|
||
import javax.ws.rs.client.ClientRequestContext; | ||
import javax.ws.rs.client.ClientRequestFilter; | ||
import javax.ws.rs.core.UriBuilder; | ||
|
||
import ch.ivyteam.ivy.environment.Ivy; | ||
|
||
public class TalentlinkQueryStringFilter implements ClientRequestFilter{ | ||
|
||
private final static String api_key = Ivy.var().get("talentlink-connector.apikey"); | ||
|
||
@Override | ||
public void filter(ClientRequestContext requestContext) throws IOException { | ||
URI uri = requestContext.getUri(); | ||
|
||
UriBuilder uriBuilder = UriBuilder.fromUri(uri); | ||
|
||
requestContext.setUri(uriBuilder.queryParam("api_key", api_key).build()); | ||
} | ||
|
||
|
||
} |