-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: GraphQL connector template #202
Merged
markfarkas-camunda
merged 20 commits into
main
from
153-create-template-for-graphql-deploy
Feb 10, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d437444
feat: GraphQL connector template
markfarkas-camunda 856f06e
fix(graphql): update license headers
markfarkas-camunda 4c4a942
feat(graphql): implement GraphQL GET method without variables
markfarkas-camunda 949d43e
feat(graphql): implement POST method and variable handling
markfarkas-camunda d9afadf
fix(graphql): additional character escape, and cleanup
markfarkas-camunda 3400db7
feat(graphql): modify application.properties, code restructure
markfarkas-camunda 6a111bd
fix(graphql): make input variable names graphql specific
markfarkas-camunda 1ce9f74
fix(graphql): swap url and method in the element template
markfarkas-camunda 7a6ea75
chore(graphql): add connectors-common-library to unify http behavior
markfarkas-camunda 2cb7f8e
chore(graphql): set post as default value for method
markfarkas-camunda e6545ca
Merge branch 'main' into 153-create-template-for-graphql-deploy
markfarkas-camunda 59a6015
feat(graphql): use connectors-common-library in http-json connector, …
markfarkas-camunda 706618b
feat(graphql): add proxy behavior
markfarkas-camunda cf5d61a
chore(graphql): bundle pom cleanup
markfarkas-camunda 8768ae5
chore(graphql): add README
markfarkas-camunda ae158c9
chore(graphql): fix README format
markfarkas-camunda 7a853aa
Merge branch 'main' into 153-create-template-for-graphql-deploy
markfarkas-camunda 5b8dbab
chore(graphql): update links to point to internal documentation
markfarkas-camunda 32238f2
fix(graphql): common library licensing, null safety
markfarkas-camunda 518a5ba
fix(graphql): fix code style
markfarkas-camunda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.camunda.connector</groupId> | ||
<artifactId>connector-function-parent</artifactId> | ||
<version>0.16.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<name>connectors-common-library</name> | ||
<description>Common library for connectors</description> | ||
<artifactId>connectors-common-library</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<license.inlineheader>Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
under one or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information regarding copyright | ||
ownership. Camunda licenses this file to you under the Apache License, | ||
Version 2.0; you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License.</license.inlineheader> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.danilopianini</groupId> | ||
<artifactId>gson-extras</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.http-client</groupId> | ||
<artifactId>google-http-client-gson</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.http-client</groupId> | ||
<artifactId>google-http-client-apache-v2</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.auth</groupId> | ||
<artifactId>google-auth-library-oauth2-http</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpcore</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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
162 changes: 162 additions & 0 deletions
162
...nectors-common-library/src/main/java/io/camunda/connector/common/model/CommonRequest.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,162 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. Camunda licenses this file to you under the Apache License, | ||
* Version 2.0; you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.camunda.connector.common.model; | ||
|
||
import io.camunda.connector.api.annotation.Secret; | ||
import io.camunda.connector.common.auth.Authentication; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Pattern; | ||
|
||
public class CommonRequest { | ||
|
||
@NotBlank | ||
@Pattern(regexp = "^(http://|https://|secrets).*$") | ||
@Secret | ||
private String url; | ||
|
||
@NotBlank @Secret private String method; | ||
|
||
@Valid @Secret private Authentication authentication; | ||
|
||
@Pattern(regexp = "^([0-9]*$)|(secrets.*$)") | ||
@Secret | ||
private String connectionTimeoutInSeconds; | ||
|
||
@Secret private Map<String, String> headers; | ||
|
||
@Secret private Object body; | ||
|
||
@Secret private Map<String, String> queryParameters; | ||
|
||
public Object getBody() { | ||
return body; | ||
} | ||
|
||
public void setBody(final Object body) { | ||
this.body = body; | ||
} | ||
|
||
public boolean hasHeaders() { | ||
return headers != null; | ||
} | ||
|
||
public boolean hasBody() { | ||
return body != null; | ||
} | ||
|
||
public Map<String, String> getHeaders() { | ||
return headers; | ||
} | ||
|
||
public void setHeaders(final Map<String, String> headers) { | ||
this.headers = headers; | ||
} | ||
|
||
public boolean hasQueryParameters() { | ||
return queryParameters != null; | ||
} | ||
|
||
public Map<String, String> getQueryParameters() { | ||
return queryParameters; | ||
} | ||
|
||
public void setQueryParameters(Map<String, String> queryParameters) { | ||
this.queryParameters = queryParameters; | ||
} | ||
|
||
public boolean hasAuthentication() { | ||
return authentication != null; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public Authentication getAuthentication() { | ||
return authentication; | ||
} | ||
|
||
public void setAuthentication(Authentication authentication) { | ||
this.authentication = authentication; | ||
} | ||
|
||
public String getMethod() { | ||
return method; | ||
} | ||
|
||
public void setMethod(String method) { | ||
this.method = method; | ||
} | ||
|
||
public String getConnectionTimeoutInSeconds() { | ||
return connectionTimeoutInSeconds; | ||
} | ||
|
||
public void setConnectionTimeoutInSeconds(String connectionTimeoutInSeconds) { | ||
this.connectionTimeoutInSeconds = connectionTimeoutInSeconds; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
CommonRequest that = (CommonRequest) o; | ||
return url.equals(that.url) | ||
&& method.equals(that.method) | ||
&& Objects.equals(authentication, that.authentication) | ||
&& Objects.equals(connectionTimeoutInSeconds, that.connectionTimeoutInSeconds) | ||
&& Objects.equals(headers, that.headers) | ||
&& Objects.equals(body, that.body) | ||
&& Objects.equals(queryParameters, that.queryParameters); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
url, method, authentication, connectionTimeoutInSeconds, headers, body, queryParameters); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CommonRequest{" | ||
+ "url='" | ||
+ url | ||
+ '\'' | ||
+ ", method='" | ||
+ method | ||
+ '\'' | ||
+ ", authentication=" | ||
+ authentication | ||
+ ", connectionTimeoutInSeconds='" | ||
+ connectionTimeoutInSeconds | ||
+ '\'' | ||
+ ", headers=" | ||
+ headers | ||
+ ", body=" | ||
+ body | ||
+ ", queryParameters=" | ||
+ queryParameters | ||
+ '}'; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, should be this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, disregard this comment. I think, it's okay to keep it as Apache 2.0 since it's a common lib.