pvillard31 opened a new pull request, #9547:
URL: https://github.com/apache/nifi/pull/9547

   # Summary
   
   [NIFI-14029](https://issues.apache.org/jira/browse/NIFI-14029) - BitBucket 
Registry Client
   
   Adding an implementation of the Registry Client to integrate with BitBucket. 
For reference, APIs are described here:
   
   https://developer.atlassian.com/cloud/bitbucket/rest/intro
   
   In addition to the implementation itself, two bugs are fixed:
   
   - NPE in case the initialization fails for some reason. In this case, we 
already called `clientInitialized.set(true)` and this caused to always have the 
directory exclusion filter being `null`. This is now fixed.
   - NPE in the `deregisterFlow` method. This happens when we start version 
control and for some reason, something fails after the file has been committed. 
In that case, we delete the content in the repo. Because we didn't populate the 
snapshot metadata, this was causing a NPE.
   
   ````
   java.lang.NullPointerException: Cannot invoke 
"org.apache.nifi.registry.flow.RegisteredFlowSnapshotMetadata.setBucketIdentifier(String)"
 because "snapshotMetadata" is null
        at 
org.apache.nifi.registry.flow.git.AbstractGitFlowRegistryClient.updateBucketReferences(AbstractGitFlowRegistryClient.java:548)
        at 
org.apache.nifi.registry.flow.git.AbstractGitFlowRegistryClient.deregisterFlow(AbstractGitFlowRegistryClient.java:255)
   ````
   
   Regarding the implementation itself. Three authentication methods are 
supported:
   
   - Basic Auth with Username and App Password
   - OAuth 2.0 - I tested the Client Credentials Flow with OAuth Consumers. 
Note that the endpoint to configure in the controller service for OAuth is 
`https://bitbucket.org/site/oauth2/access_token`. It is important to also note 
that, when using the Client Credentials flow, the permissions/scopes set at the 
OAuth Consumer level in the BitBucket Admin UI are ignored and it will inherit 
the permissions of the **owner** of the OAuth Consumer. This is quite 
misleading...
   - Access Token - I have not tested this option as this is a paid option of 
BitBucket.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 21
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to