You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/12/17 05:42:33 UTC
[camel] branch master updated: Support service account
authentication (#4783)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new bdc89d2 Support service account authentication (#4783)
bdc89d2 is described below
commit bdc89d29499e7dc5e8a3c933afb333c46a226626
Author: Jakob Merljak <jm...@users.noreply.github.com>
AuthorDate: Thu Dec 17 06:42:09 2020 +0100
Support service account authentication (#4783)
* Support Google service account authentication
* Commit changes to generated files
---
.../docs/google-calendar-stream-component.adoc | 5 ++-
.../GoogleCalendarStreamComponentConfigurer.java | 15 +++++++
.../GoogleCalendarStreamEndpointConfigurer.java | 15 +++++++
.../GoogleCalendarStreamEndpointUriFactory.java | 5 ++-
.../calendar/stream/google-calendar-stream.json | 6 +++
.../docs/google-calendar-stream-component.adoc | 5 ++-
.../stream/GoogleCalendarStreamComponent.java | 7 ++--
.../stream/GoogleCalendarStreamConfiguration.java | 39 +++++++++++++++++
...oogleCalendarStreamComponentBuilderFactory.java | 49 ++++++++++++++++++++++
...GoogleCalendarStreamEndpointBuilderFactory.java | 46 ++++++++++++++++++++
.../pages/google-calendar-stream-component.adoc | 5 ++-
11 files changed, 190 insertions(+), 7 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-calendar-stream-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-calendar-stream-component.adoc
index 56f8194..e0233a9 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-calendar-stream-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-calendar-stream-component.adoc
@@ -54,7 +54,7 @@ google-calendar-stream://index?[options]
// component options: START
-The Google Calendar Stream component supports 15 options, which are listed below.
+The Google Calendar Stream component supports 18 options, which are listed below.
@@ -68,9 +68,12 @@ The Google Calendar Stream component supports 15 options, which are listed below
| *configuration* (consumer) | The configuration | | GoogleCalendarStreamConfiguration
| *considerLastUpdate* (consumer) | Take into account the lastUpdate of the last event polled as start date for the next poll | false | boolean
| *consumeFromNow* (consumer) | Consume events in the selected calendar from now on | true | boolean
+| *emailAddress* (consumer) | The emailAddress of the Google Service Account. | | String
| *maxResults* (consumer) | Max results to be returned | 10 | int
+| *p12FileName* (consumer) | The name of the p12 file which has the private key to use with the Google Service Account. | | String
| *query* (consumer) | The query to execute on calendar | | String
| *scopes* (consumer) | Specifies the level of permissions you want a calendar application to have to a user account. See \https://developers.google.com/calendar/auth for more info. | | List
+| *user* (consumer) | The email address of the user the application is trying to impersonate in the service account flow. | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *clientFactory* (advanced) | The client Factory | | GoogleCalendarClientFactory
| *accessToken* (security) | OAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage. | | String
diff --git a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponentConfigurer.java b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponentConfigurer.java
index b6549d1..f9664cb 100644
--- a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponentConfigurer.java
+++ b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponentConfigurer.java
@@ -49,12 +49,17 @@ public class GoogleCalendarStreamComponentConfigurer extends PropertyConfigurerS
case "considerLastUpdate": getOrCreateConfiguration(target).setConsiderLastUpdate(property(camelContext, boolean.class, value)); return true;
case "consumefromnow":
case "consumeFromNow": getOrCreateConfiguration(target).setConsumeFromNow(property(camelContext, boolean.class, value)); return true;
+ case "emailaddress":
+ case "emailAddress": getOrCreateConfiguration(target).setEmailAddress(property(camelContext, java.lang.String.class, value)); return true;
case "maxresults":
case "maxResults": getOrCreateConfiguration(target).setMaxResults(property(camelContext, int.class, value)); return true;
+ case "p12filename":
+ case "p12FileName": getOrCreateConfiguration(target).setP12FileName(property(camelContext, java.lang.String.class, value)); return true;
case "query": getOrCreateConfiguration(target).setQuery(property(camelContext, java.lang.String.class, value)); return true;
case "refreshtoken":
case "refreshToken": getOrCreateConfiguration(target).setRefreshToken(property(camelContext, java.lang.String.class, value)); return true;
case "scopes": getOrCreateConfiguration(target).setScopes(property(camelContext, java.util.List.class, value)); return true;
+ case "user": getOrCreateConfiguration(target).setUser(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
}
@@ -83,12 +88,17 @@ public class GoogleCalendarStreamComponentConfigurer extends PropertyConfigurerS
case "considerLastUpdate": return boolean.class;
case "consumefromnow":
case "consumeFromNow": return boolean.class;
+ case "emailaddress":
+ case "emailAddress": return java.lang.String.class;
case "maxresults":
case "maxResults": return int.class;
+ case "p12filename":
+ case "p12FileName": return java.lang.String.class;
case "query": return java.lang.String.class;
case "refreshtoken":
case "refreshToken": return java.lang.String.class;
case "scopes": return java.util.List.class;
+ case "user": return java.lang.String.class;
default: return null;
}
}
@@ -118,12 +128,17 @@ public class GoogleCalendarStreamComponentConfigurer extends PropertyConfigurerS
case "considerLastUpdate": return getOrCreateConfiguration(target).isConsiderLastUpdate();
case "consumefromnow":
case "consumeFromNow": return getOrCreateConfiguration(target).isConsumeFromNow();
+ case "emailaddress":
+ case "emailAddress": return getOrCreateConfiguration(target).getEmailAddress();
case "maxresults":
case "maxResults": return getOrCreateConfiguration(target).getMaxResults();
+ case "p12filename":
+ case "p12FileName": return getOrCreateConfiguration(target).getP12FileName();
case "query": return getOrCreateConfiguration(target).getQuery();
case "refreshtoken":
case "refreshToken": return getOrCreateConfiguration(target).getRefreshToken();
case "scopes": return getOrCreateConfiguration(target).getScopes();
+ case "user": return getOrCreateConfiguration(target).getUser();
default: return null;
}
}
diff --git a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointConfigurer.java b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointConfigurer.java
index a266baf..678efed 100644
--- a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointConfigurer.java
+++ b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointConfigurer.java
@@ -44,6 +44,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "consumefromnow":
case "consumeFromNow": target.getConfiguration().setConsumeFromNow(property(camelContext, boolean.class, value)); return true;
case "delay": target.setDelay(property(camelContext, long.class, value)); return true;
+ case "emailaddress":
+ case "emailAddress": target.getConfiguration().setEmailAddress(property(camelContext, java.lang.String.class, value)); return true;
case "exceptionhandler":
case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
case "exchangepattern":
@@ -53,6 +55,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "initialDelay": target.setInitialDelay(property(camelContext, long.class, value)); return true;
case "maxresults":
case "maxResults": target.getConfiguration().setMaxResults(property(camelContext, int.class, value)); return true;
+ case "p12filename":
+ case "p12FileName": target.getConfiguration().setP12FileName(property(camelContext, java.lang.String.class, value)); return true;
case "pollstrategy":
case "pollStrategy": target.setPollStrategy(property(camelContext, org.apache.camel.spi.PollingConsumerPollStrategy.class, value)); return true;
case "query": target.getConfiguration().setQuery(property(camelContext, java.lang.String.class, value)); return true;
@@ -77,6 +81,7 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "timeUnit": target.setTimeUnit(property(camelContext, java.util.concurrent.TimeUnit.class, value)); return true;
case "usefixeddelay":
case "useFixedDelay": target.setUseFixedDelay(property(camelContext, boolean.class, value)); return true;
+ case "user": target.getConfiguration().setUser(property(camelContext, java.lang.String.class, value)); return true;
default: return false;
}
}
@@ -107,6 +112,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "consumefromnow":
case "consumeFromNow": return boolean.class;
case "delay": return long.class;
+ case "emailaddress":
+ case "emailAddress": return java.lang.String.class;
case "exceptionhandler":
case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
case "exchangepattern":
@@ -116,6 +123,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "initialDelay": return long.class;
case "maxresults":
case "maxResults": return int.class;
+ case "p12filename":
+ case "p12FileName": return java.lang.String.class;
case "pollstrategy":
case "pollStrategy": return org.apache.camel.spi.PollingConsumerPollStrategy.class;
case "query": return java.lang.String.class;
@@ -140,6 +149,7 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "timeUnit": return java.util.concurrent.TimeUnit.class;
case "usefixeddelay":
case "useFixedDelay": return boolean.class;
+ case "user": return java.lang.String.class;
default: return null;
}
}
@@ -171,6 +181,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "consumefromnow":
case "consumeFromNow": return target.getConfiguration().isConsumeFromNow();
case "delay": return target.getDelay();
+ case "emailaddress":
+ case "emailAddress": return target.getConfiguration().getEmailAddress();
case "exceptionhandler":
case "exceptionHandler": return target.getExceptionHandler();
case "exchangepattern":
@@ -180,6 +192,8 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "initialDelay": return target.getInitialDelay();
case "maxresults":
case "maxResults": return target.getConfiguration().getMaxResults();
+ case "p12filename":
+ case "p12FileName": return target.getConfiguration().getP12FileName();
case "pollstrategy":
case "pollStrategy": return target.getPollStrategy();
case "query": return target.getConfiguration().getQuery();
@@ -204,6 +218,7 @@ public class GoogleCalendarStreamEndpointConfigurer extends PropertyConfigurerSu
case "timeUnit": return target.getTimeUnit();
case "usefixeddelay":
case "useFixedDelay": return target.isUseFixedDelay();
+ case "user": return target.getConfiguration().getUser();
default: return null;
}
}
diff --git a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointUriFactory.java b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointUriFactory.java
index fcc9404..67b59d7 100644
--- a/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointUriFactory.java
+++ b/components/camel-google-calendar/src/generated/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamEndpointUriFactory.java
@@ -20,7 +20,7 @@ public class GoogleCalendarStreamEndpointUriFactory extends org.apache.camel.sup
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(39);
+ Set<String> props = new HashSet<>(42);
props.add("backoffMultiplier");
props.add("synchronous");
props.add("destination");
@@ -29,6 +29,7 @@ public class GoogleCalendarStreamEndpointUriFactory extends org.apache.camel.sup
props.add("content");
props.add("setting");
props.add("scheduler");
+ props.add("emailAddress");
props.add("bridgeErrorHandler");
props.add("useFixedDelay");
props.add("runLoggingLevel");
@@ -43,6 +44,7 @@ public class GoogleCalendarStreamEndpointUriFactory extends org.apache.camel.sup
props.add("repeatCount");
props.add("timeUnit");
props.add("eventId");
+ props.add("p12FileName");
props.add("clientId");
props.add("considerLastUpdate");
props.add("query");
@@ -58,6 +60,7 @@ public class GoogleCalendarStreamEndpointUriFactory extends org.apache.camel.sup
props.add("pollStrategy");
props.add("startScheduler");
props.add("scopes");
+ props.add("user");
props.add("exceptionHandler");
props.add("refreshToken");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
diff --git a/components/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json b/components/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
index 18d57a0..f123d42 100644
--- a/components/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
+++ b/components/camel-google-calendar/src/generated/resources/org/apache/camel/component/google/calendar/stream/google-calendar-stream.json
@@ -29,9 +29,12 @@
"configuration": { "kind": "property", "displayName": "Configuration", "group": "consumer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration" },
"considerLastUpdate": { "kind": "property", "displayName": "Consider Last Update", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Take into account the lastUpdate of the last event polled as star [...]
"consumeFromNow": { "kind": "property", "displayName": "Consume From Now", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Consume events in the selected calendar from now on" },
+ "emailAddress": { "kind": "property", "displayName": "Email Address", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The emailAddress of the Google Service Account." },
"maxResults": { "kind": "property", "displayName": "Max Results", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Max results to be returned" },
+ "p12FileName": { "kind": "property", "displayName": "P12 File Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The name of the p12 file which has the private key to use with the Google Service Account." },
"query": { "kind": "property", "displayName": "Query", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The query to execute on calendar" },
"scopes": { "kind": "property", "displayName": "Scopes", "group": "consumer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Specifies the level of permissions you want a calendar application to have to a user accoun [...]
+ "user": { "kind": "property", "displayName": "User", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The email address of the user the application is trying to impersonate in the service account flow." },
"autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
"clientFactory": { "kind": "property", "displayName": "Client Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.google.calendar.GoogleCalendarClientFactory", "deprecated": false, "autowired": false, "secret": false, "description": "The client Factory" },
"accessToken": { "kind": "property", "displayName": "Access Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "OAuth 2 access token. This typically expires after an hour so refreshToken is recommende [...]
@@ -46,10 +49,13 @@
"clientId": { "kind": "parameter", "displayName": "Client Id", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Client ID of the calendar application" },
"considerLastUpdate": { "kind": "parameter", "displayName": "Consider Last Update", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Take into account the lastUpdate of the last event polled as sta [...]
"consumeFromNow": { "kind": "parameter", "displayName": "Consume From Now", "group": "consumer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Consume events in the selected calendar from now on" },
+ "emailAddress": { "kind": "parameter", "displayName": "Email Address", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The emailAddress of the Google Service Account." },
"maxResults": { "kind": "parameter", "displayName": "Max Results", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Max results to be returned" },
+ "p12FileName": { "kind": "parameter", "displayName": "P12 File Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The name of the p12 file which has the private key to use with the Google Service Account." },
"query": { "kind": "parameter", "displayName": "Query", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The query to execute on calendar" },
"scopes": { "kind": "parameter", "displayName": "Scopes", "group": "consumer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "Specifies the level of permissions you want a calendar application to have to a user accou [...]
"sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
+ "user": { "kind": "parameter", "displayName": "User", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration", "configurationField": "configuration", "description": "The email address of the user the application is trying to impersonate in the service account flow." },
"exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
"exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
"pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation [...]
diff --git a/components/camel-google-calendar/src/main/docs/google-calendar-stream-component.adoc b/components/camel-google-calendar/src/main/docs/google-calendar-stream-component.adoc
index 56f8194..e0233a9 100644
--- a/components/camel-google-calendar/src/main/docs/google-calendar-stream-component.adoc
+++ b/components/camel-google-calendar/src/main/docs/google-calendar-stream-component.adoc
@@ -54,7 +54,7 @@ google-calendar-stream://index?[options]
// component options: START
-The Google Calendar Stream component supports 15 options, which are listed below.
+The Google Calendar Stream component supports 18 options, which are listed below.
@@ -68,9 +68,12 @@ The Google Calendar Stream component supports 15 options, which are listed below
| *configuration* (consumer) | The configuration | | GoogleCalendarStreamConfiguration
| *considerLastUpdate* (consumer) | Take into account the lastUpdate of the last event polled as start date for the next poll | false | boolean
| *consumeFromNow* (consumer) | Consume events in the selected calendar from now on | true | boolean
+| *emailAddress* (consumer) | The emailAddress of the Google Service Account. | | String
| *maxResults* (consumer) | Max results to be returned | 10 | int
+| *p12FileName* (consumer) | The name of the p12 file which has the private key to use with the Google Service Account. | | String
| *query* (consumer) | The query to execute on calendar | | String
| *scopes* (consumer) | Specifies the level of permissions you want a calendar application to have to a user account. See \https://developers.google.com/calendar/auth for more info. | | List
+| *user* (consumer) | The email address of the user the application is trying to impersonate in the service account flow. | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *clientFactory* (advanced) | The client Factory | | GoogleCalendarClientFactory
| *accessToken* (security) | OAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage. | | String
diff --git a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponent.java b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponent.java
index 118972e..e0696ea 100644
--- a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponent.java
+++ b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamComponent.java
@@ -49,10 +49,11 @@ public class GoogleCalendarStreamComponent extends DefaultComponent {
public Calendar getClient(GoogleCalendarStreamConfiguration endpointConfiguration) {
if (client == null) {
- client = getClientFactory().makeClient(endpointConfiguration.getClientId(), endpointConfiguration.getClientSecret(),
- endpointConfiguration.getScopes(),
+ client = getClientFactory().makeClient(endpointConfiguration.getClientId(),
+ endpointConfiguration.getClientSecret(), endpointConfiguration.getScopes(),
endpointConfiguration.getApplicationName(), endpointConfiguration.getRefreshToken(),
- endpointConfiguration.getAccessToken(), null, null, "me");
+ endpointConfiguration.getAccessToken(), endpointConfiguration.getEmailAddress(),
+ endpointConfiguration.getP12FileName(), endpointConfiguration.getUser());
}
return client;
}
diff --git a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConfiguration.java b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConfiguration.java
index 2471572..6372531 100644
--- a/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConfiguration.java
+++ b/components/camel-google-calendar/src/main/java/org/apache/camel/component/google/calendar/stream/GoogleCalendarStreamConfiguration.java
@@ -40,6 +40,8 @@ public class GoogleCalendarStreamConfiguration implements Cloneable {
private List<String> scopes = DEFAULT_SCOPES;
@UriParam
private String clientId;
+ @UriParam
+ private String emailAddress;
@UriParam(label = "security", secret = true)
private String clientSecret;
@UriParam(label = "security", secret = true)
@@ -49,6 +51,10 @@ public class GoogleCalendarStreamConfiguration implements Cloneable {
@UriParam
private String applicationName;
@UriParam
+ private String p12FileName;
+ @UriParam
+ private String user;
+ @UriParam
private String query;
@UriParam(defaultValue = "10")
private int maxResults = 10;
@@ -70,6 +76,17 @@ public class GoogleCalendarStreamConfiguration implements Cloneable {
this.clientId = clientId;
}
+ public String getEmailAddress() {
+ return emailAddress;
+ }
+
+ /**
+ * The emailAddress of the Google Service Account.
+ */
+ public void setEmailAddress(String emailAddress) {
+ this.emailAddress = emailAddress;
+ }
+
public String getClientSecret() {
return clientSecret;
}
@@ -138,6 +155,28 @@ public class GoogleCalendarStreamConfiguration implements Cloneable {
this.index = index;
}
+ public String getP12FileName() {
+ return p12FileName;
+ }
+
+ /**
+ * The name of the p12 file which has the private key to use with the Google Service Account.
+ */
+ public void setP12FileName(String p12FileName) {
+ this.p12FileName = p12FileName;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ /**
+ * The email address of the user the application is trying to impersonate in the service account flow.
+ */
+ public void setUser(String user) {
+ this.user = user;
+ }
+
public String getQuery() {
return query;
}
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleCalendarStreamComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleCalendarStreamComponentBuilderFactory.java
index e0a1620..49a5d35 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleCalendarStreamComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleCalendarStreamComponentBuilderFactory.java
@@ -169,6 +169,21 @@ public interface GoogleCalendarStreamComponentBuilderFactory {
return this;
}
/**
+ * The emailAddress of the Google Service Account.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param emailAddress the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamComponentBuilder emailAddress(
+ java.lang.String emailAddress) {
+ doSetProperty("emailAddress", emailAddress);
+ return this;
+ }
+ /**
* Max results to be returned.
*
* The option is a: <code>int</code> type.
@@ -184,6 +199,22 @@ public interface GoogleCalendarStreamComponentBuilderFactory {
return this;
}
/**
+ * The name of the p12 file which has the private key to use with the
+ * Google Service Account.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param p12FileName the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamComponentBuilder p12FileName(
+ java.lang.String p12FileName) {
+ doSetProperty("p12FileName", p12FileName);
+ return this;
+ }
+ /**
* The query to execute on calendar.
*
* The option is a: <code>java.lang.String</code> type.
@@ -217,6 +248,21 @@ public interface GoogleCalendarStreamComponentBuilderFactory {
return this;
}
/**
+ * The email address of the user the application is trying to
+ * impersonate in the service account flow.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param user the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamComponentBuilder user(java.lang.String user) {
+ doSetProperty("user", user);
+ return this;
+ }
+ /**
* Whether autowiring is enabled. This is used for automatic autowiring
* options (the option must be marked as autowired) by looking up in the
* registry to find if there is a single instance of matching type,
@@ -332,9 +378,12 @@ public interface GoogleCalendarStreamComponentBuilderFactory {
case "configuration": ((GoogleCalendarStreamComponent) component).setConfiguration((org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration) value); return true;
case "considerLastUpdate": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setConsiderLastUpdate((boolean) value); return true;
case "consumeFromNow": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setConsumeFromNow((boolean) value); return true;
+ case "emailAddress": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setEmailAddress((java.lang.String) value); return true;
case "maxResults": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setMaxResults((int) value); return true;
+ case "p12FileName": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setP12FileName((java.lang.String) value); return true;
case "query": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setQuery((java.lang.String) value); return true;
case "scopes": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setScopes((java.util.List) value); return true;
+ case "user": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setUser((java.lang.String) value); return true;
case "autowiredEnabled": ((GoogleCalendarStreamComponent) component).setAutowiredEnabled((boolean) value); return true;
case "clientFactory": ((GoogleCalendarStreamComponent) component).setClientFactory((org.apache.camel.component.google.calendar.GoogleCalendarClientFactory) value); return true;
case "accessToken": getOrCreateConfiguration((GoogleCalendarStreamComponent) component).setAccessToken((java.lang.String) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarStreamEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarStreamEndpointBuilderFactory.java
index 00d6e41..7207e42 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarStreamEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCalendarStreamEndpointBuilderFactory.java
@@ -206,6 +206,21 @@ public interface GoogleCalendarStreamEndpointBuilderFactory {
return this;
}
/**
+ * The emailAddress of the Google Service Account.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param emailAddress the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamEndpointBuilder emailAddress(
+ String emailAddress) {
+ doSetProperty("emailAddress", emailAddress);
+ return this;
+ }
+ /**
* Max results to be returned.
*
* The option is a: <code>int</code> type.
@@ -236,6 +251,22 @@ public interface GoogleCalendarStreamEndpointBuilderFactory {
return this;
}
/**
+ * The name of the p12 file which has the private key to use with the
+ * Google Service Account.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param p12FileName the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamEndpointBuilder p12FileName(
+ String p12FileName) {
+ doSetProperty("p12FileName", p12FileName);
+ return this;
+ }
+ /**
* The query to execute on calendar.
*
* The option is a: <code>java.lang.String</code> type.
@@ -319,6 +350,21 @@ public interface GoogleCalendarStreamEndpointBuilderFactory {
return this;
}
/**
+ * The email address of the user the application is trying to
+ * impersonate in the service account flow.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: consumer
+ *
+ * @param user the value to set
+ * @return the dsl builder
+ */
+ default GoogleCalendarStreamEndpointBuilder user(String user) {
+ doSetProperty("user", user);
+ return this;
+ }
+ /**
* The number of subsequent error polls (failed due some error) that
* should happen before the backoffMultipler should kick-in.
*
diff --git a/docs/components/modules/ROOT/pages/google-calendar-stream-component.adoc b/docs/components/modules/ROOT/pages/google-calendar-stream-component.adoc
index 426b351..a0dd632 100644
--- a/docs/components/modules/ROOT/pages/google-calendar-stream-component.adoc
+++ b/docs/components/modules/ROOT/pages/google-calendar-stream-component.adoc
@@ -56,7 +56,7 @@ google-calendar-stream://index?[options]
// component options: START
-The Google Calendar Stream component supports 15 options, which are listed below.
+The Google Calendar Stream component supports 18 options, which are listed below.
@@ -70,9 +70,12 @@ The Google Calendar Stream component supports 15 options, which are listed below
| *configuration* (consumer) | The configuration | | GoogleCalendarStreamConfiguration
| *considerLastUpdate* (consumer) | Take into account the lastUpdate of the last event polled as start date for the next poll | false | boolean
| *consumeFromNow* (consumer) | Consume events in the selected calendar from now on | true | boolean
+| *emailAddress* (consumer) | The emailAddress of the Google Service Account. | | String
| *maxResults* (consumer) | Max results to be returned | 10 | int
+| *p12FileName* (consumer) | The name of the p12 file which has the private key to use with the Google Service Account. | | String
| *query* (consumer) | The query to execute on calendar | | String
| *scopes* (consumer) | Specifies the level of permissions you want a calendar application to have to a user account. See \https://developers.google.com/calendar/auth for more info. | | List
+| *user* (consumer) | The email address of the user the application is trying to impersonate in the service account flow. | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *clientFactory* (advanced) | The client Factory | | GoogleCalendarClientFactory
| *accessToken* (security) | OAuth 2 access token. This typically expires after an hour so refreshToken is recommended for long term usage. | | String