Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Prefect integrations for working with Bitbucket repositories.
Requires an installation of Python 3.9+.
We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.
Install prefect-bitbucket
with pip
:
pip install prefect-bitbucket
Then, register to view the block on Prefect Cloud:
prefect block register -m prefect_bitbucket
Note, to use the load
method on Blocks, you must already have a block document saved through code or saved through the UI.
from prefect import flow
from prefect_bitbucket.credentials import BitBucketCredentials
@flow
def use_stored_bitbucket_creds_flow():
bitbucket_credentials_block = BitBucketCredentials.load("BLOCK_NAME")
return bitbucket_credentials_block
use_stored_bitbucket_creds_flow()
from prefect import flow
from prefect_bitbucket.credentials import BitBucketCredentials
@flow
def create_new_bitbucket_creds_flow():
bitbucket_credentials_block = BitBucketCredentials(
token="my-token",
username="my-username"
)
create_new_bitbucket_creds_flow()
from prefect_bitbucket import BitBucketRepository
public_repo = "https://bitbucket.org/my-workspace/my-repository.git"
# Creates a public BitBucket repository BitBucketRepository block
public_bitbucket_block = BitBucketRepository(
repository=public_repo
)
# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
public_bitbucket_block.save("my-bitbucket-block")
from prefect_bitbucket import BitBucketRepository
public_repo = "https://bitbucket.org/my-workspace/my-repository.git"
# Creates a public BitBucket repository BitBucketRepository block
branch_bitbucket_block = BitBucketRepository(
reference="my-branch-or-tag", # e.g "master"
repository=public_repo
)
# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
branch_bitbucket_block.save("my-bitbucket-branch-block")
from prefect_bitbucket import BitBucketCredentials, BitBucketRepository
# For a private repo, we need credentials to access it
bitbucket_credentials_block = BitBucketCredentials(
token="my-token",
username="my-username" # optional
)
# Saves the BitBucketCredentials block to your Prefect workspace (in the Blocks tab)
bitbucket_credentials_block.save(name="my-bitbucket-credentials-block")
# Creates a private BitBucket repository BitBucketRepository block
private_repo = "https://bitbucket.org/my-workspace/my-repository.git"
private_bitbucket_block = BitBucketRepository(
repository=private_repo,
bitbucket_credentials=bitbucket_credentials_block
)
# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
private_bitbucket_block.save(name="my-private-bitbucket-block")
from prefect_bitbucket import BitBucketCredentials, BitBucketRepository
# Loads a preexisting BitBucketCredentials block
BitBucketCredentials.load("my-bitbucket-credentials-block")
# Creates a private BitBucket repository BitBucketRepository block
private_repo = "https://bitbucket.org/my-workspace/my-repository.git"
private_bitbucket_block = BitBucketRepository(
repository=private_repo,
bitbucket_credentials=bitbucket_credentials_block
)
# Saves the BitBucketRepository block to your Prefect workspace (in the Blocks tab)
private_bitbucket_block.save(name="my-private-bitbucket-block")
!!! info "Differences between Bitbucket Server and Bitbucket Cloud"
For Bitbucket Cloud, only set the `token` to authenticate. For Bitbucket Server, set both the `token` and the `username`.
FAQs
Prefect integrations for working with Bitbucket repositories.
We found that prefect-bitbucket demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.