Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into ecs-guide-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz authored Nov 14, 2023
2 parents c678bb2 + 679fad1 commit 82fb5f9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Install packages
run: |
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Changed
- Added 'SecretBrinary' suport to `AwsSecret` block - [#274](https://github.com/PrefectHQ/prefect-aws/pull/274)

### Fixed

### Deprecated

### Removed

## 0.4.2

Released November 6th, 2023.

### Fixed

- Fixed use_ssl default for s3 client.

## 0.4.1

Released October 13th, 2023.
Expand Down
2 changes: 1 addition & 1 deletion prefect_aws/deployments/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def get_s3_client(
aws_client_parameters = credentials.get("aws_client_parameters", client_parameters)
api_version = aws_client_parameters.get("api_version", None)
endpoint_url = aws_client_parameters.get("endpoint_url", None)
use_ssl = aws_client_parameters.get("use_ssl", None)
use_ssl = aws_client_parameters.get("use_ssl", True)
verify = aws_client_parameters.get("verify", None)
config_params = aws_client_parameters.get("config", {})
config = Config(**config_params)
Expand Down
5 changes: 4 additions & 1 deletion prefect_aws/secrets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ async def read_secret(
response = await run_sync_in_worker_thread(
client.get_secret_value, SecretId=self.secret_name, **read_kwargs
)
secret = response["SecretBinary"]
if "SecretBinary" in response:
secret = response["SecretBinary"]
elif "SecretString" in response:
secret = response["SecretString"]
arn = response["ARN"]
self.logger.info(f"The secret {arn!r} data was successfully read.")
return secret
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ boto3>=1.24.53
botocore>=1.27.53
mypy_boto3_s3>=1.24.94
mypy_boto3_secretsmanager>=1.26.49
prefect>=2.10.11
prefect>=2.13.5
tenacity>=8.0.0
4 changes: 2 additions & 2 deletions tests/deploments/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def test_s3_session_with_params():
assert {
"api_version": "v1",
"endpoint_url": None,
"use_ssl": None,
"use_ssl": True,
"verify": None,
}.items() <= all_calls[1].kwargs.items()
assert all_calls[1].kwargs.get("config").connect_timeout == 300
Expand All @@ -244,7 +244,7 @@ def test_s3_session_with_params():
assert {
"api_version": None,
"endpoint_url": None,
"use_ssl": None,
"use_ssl": True,
"verify": None,
}.items() <= all_calls[3].kwargs.items()
assert all_calls[3].kwargs.get("config").connect_timeout == 60
Expand Down
7 changes: 7 additions & 0 deletions tests/test_secrets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,10 @@ def test_delete_secret_recovery_window(self, aws_secret: AwsSecret):
ValueError, match="Recovery window must be between 7 and 30 days"
):
aws_secret.delete_secret(recovery_window_in_days=42)

async def test_read_secret(self, secret_under_test, aws_credentials):
secret = AwsSecret(
aws_credentials=aws_credentials,
secret_name=secret_under_test["secret_name"],
)
assert await secret.read_secret() == secret_under_test["expected_value"]

0 comments on commit 82fb5f9

Please sign in to comment.