-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jira Source Configuration and Filter Changes and add license headers (#…
…5306) * jira yaml changes and tests, authentication and hosts Signed-off-by: Maxwell Brown <[email protected]> * filter config file changes Signed-off-by: Maxwell Brown <[email protected]> * jira filter config changes and implementation Signed-off-by: Maxwell Brown <[email protected]> * filter change test corrections Signed-off-by: Maxwell Brown <[email protected]> * project name -> key for now Signed-off-by: Maxwell Brown <[email protected]> * removed unfishished function Signed-off-by: Maxwell Brown <[email protected]> * address pr comments Signed-off-by: Maxwell Brown <[email protected]> * Add license headers to all jira source files Signed-off-by: Maxwell Brown <[email protected]> --------- Signed-off-by: Maxwell Brown <[email protected]>
- Loading branch information
1 parent
791e355
commit bad172c
Showing
53 changed files
with
1,042 additions
and
201 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.../jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraClient.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
10 changes: 10 additions & 0 deletions
10
...ira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraItemInfo.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
10 changes: 10 additions & 0 deletions
10
...ira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraIterator.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
10 changes: 10 additions & 0 deletions
10
.../jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraSource.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
45 changes: 45 additions & 0 deletions
45
...va/org/opensearch/dataprepper/plugins/source/jira/configuration/AuthenticationConfig.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,45 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.source.jira.configuration; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.AssertTrue; | ||
import lombok.Getter; | ||
|
||
import static org.opensearch.dataprepper.plugins.source.jira.utils.Constants.BASIC; | ||
import static org.opensearch.dataprepper.plugins.source.jira.utils.Constants.OAUTH2; | ||
|
||
@Getter | ||
public class AuthenticationConfig { | ||
@JsonProperty("basic") | ||
@Valid | ||
private BasicConfig basicConfig; | ||
|
||
@JsonProperty("oauth2") | ||
@Valid | ||
private Oauth2Config oauth2Config; | ||
|
||
@AssertTrue(message = "Authentication config should have either basic or oauth2") | ||
private boolean isValidAuthenticationConfig() { | ||
boolean hasBasic = basicConfig != null; | ||
boolean hasOauth = oauth2Config != null; | ||
return hasBasic ^ hasOauth; | ||
} | ||
|
||
public String getAuthType() { | ||
if (basicConfig != null) { | ||
return BASIC; | ||
} else { | ||
return OAUTH2; | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...c/main/java/org/opensearch/dataprepper/plugins/source/jira/configuration/BasicConfig.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,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.source.jira.configuration; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import jakarta.validation.constraints.AssertTrue; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class BasicConfig { | ||
@JsonProperty("username") | ||
private String username; | ||
|
||
@JsonProperty("password") | ||
private String password; | ||
|
||
@AssertTrue(message = "Username and Password are both required for Basic Auth") | ||
private boolean isBasicConfigValid() { | ||
return username != null && password != null; | ||
} | ||
} |
Oops, something went wrong.