Skip to content
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

NIFI-14029 - BitBucket Registry Client #9547

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pvillard31
Copy link
Contributor

Summary

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

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 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants