Skip to content

Commit 1eda083

Browse files
committed
release: 1.0.0
0 parents  commit 1eda083

File tree

14 files changed

+2080
-0
lines changed

14 files changed

+2080
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.vscode/
2+
3+
target/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Digital Loop
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GCP Oauth2 Access Token Provider
2+
3+
Fortunately Apache NiFi already ships with a couple of processors which provide connections to Google APIs. But since there are dozens of Google APIs and they are also subject to changes from time to time, it's to expect that NiFi cannot offer a specialized processor for all of them out of the box. In our case we were missing a processor for the APIs of [Search Console](https://developers.google.com/webmaster-tools/v1/api_reference_index) and [Business Profile](https://developers.google.com/my-business/ref_overview).
4+
5+
This is why we created this custom controller service which adds an alternative oauth2 access token provider besides the [StandardOauth2AccessTokenProvider](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-oauth2-provider-nar/1.20.0/org.apache.nifi.oauth2.StandardOauth2AccessTokenProvider/index.html). It provides the access token generated by the [GCPCredentialsControllerService](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-gcp-nar/1.19.1/org.apache.nifi.processors.gcp.credentials.service.GCPCredentialsControllerService/index.html) service for the [InvokeHTTP](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.17.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html) processor. This way it can be used to generate requests towards any Google API with https support.
6+
7+
## Installation
8+
1. Download the latest .nar file from the [release page](https://github.com/Digital-Loop/nifi-gcp-oauth2-access-token/releases).
9+
2. Copy it to the `lib` directory of your Apache NiFi deployment.
10+
11+
## Manual Build
12+
```
13+
mvn clean install
14+
cp nifi-gcp-oauth2-provider-nar/target/nifi-gcp-oauth2-provider-nar-1.0.0.nar $NIFI_HOME/lib
15+
```
16+
17+
## Usage
18+
1. Create and configure a [GCPCredentialsControllerService](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-gcp-nar/1.19.1/org.apache.nifi.processors.gcp.credentials.service.GCPCredentialsControllerService/index.html) controller service.
19+
2. Create a GCPOauth2AccessTokenProvider controller service (provided by this module).
20+
3. You can add one or multiple [scopes](https://developers.google.com/identity/protocols/oauth2/scopes) if required (the required scopes are mentioned in the corresponding Google API documentation).
21+
4. You can delegate to another account if you want to [impersonate](https://cloud.google.com/iam/docs/service-account-overview#impersonation) it.
22+
5. Create an [InvokeHTTP](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.17.0/org.apache.nifi.processors.standard.InvokeHTTP/index.html) processor and select your GCPOauth2AccessTokenProvider for the field "Request OAuth2 Access Token Provider".
23+
6. Configure http method, http url and headers as explained by the corresponding API documentation (the flow file content is used as the request body).
24+
25+
## Examples
26+
1. [Search Console API](./examples/google-search-console/README.md)
27+
2. [Business Profile API](./examples/google-business-profile/README.md)

0 commit comments

Comments
 (0)