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

Add secret manager block #176

Merged
merged 11 commits into from
Jan 20, 2023
Merged

Add secret manager block #176

merged 11 commits into from
Jan 20, 2023

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Dec 14, 2022

Adds a SecretsManager block, inheriting from the SecretsBlock interface.

Example

Screenshots

image

Checklist

  • References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • Includes tests or only affects documentation.
  • Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.
  • Summarizes PR's changes in CHANGELOG.md

@ahuang11 ahuang11 changed the base branch from main to add_s3_object_storage_block December 14, 2022 04:20
Base automatically changed from add_s3_object_storage_block to main December 28, 2022 19:14
@ahuang11 ahuang11 marked this pull request as ready for review January 19, 2023 01:00
@ahuang11 ahuang11 requested a review from desertaxle as a code owner January 19, 2023 01:00
@ahuang11 ahuang11 requested a review from zzstoatzz January 19, 2023 01:03
prefect_aws/credentials.py Outdated Show resolved Hide resolved
prefect_aws/secrets_manager.py Outdated Show resolved Hide resolved
prefect_aws/secrets_manager.py Outdated Show resolved Hide resolved
prefect_aws/secrets_manager.py Outdated Show resolved Hide resolved
"""
client = self.aws_credentials.get_secrets_manager_client()
try:
response = await run_sync_in_worker_thread(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does run_sync_in_worker_thread work outside of a flow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works:

    call = partial(__fn, *args, **kwargs)
    return await anyio.to_thread.run_sync(
        call, cancellable=True, limiter=get_thread_limiter()
    )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import anyio
def test():
    print("Hello")
await anyio.to_thread.run_sync(test, cancellable=True)

ahuang11 and others added 4 commits January 20, 2023 09:43
Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com>
@ahuang11 ahuang11 requested a review from desertaxle January 20, 2023 17:52
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ahuang11 ahuang11 merged commit a8461d8 into main Jan 20, 2023
@ahuang11 ahuang11 deleted the add_secret_manager_block branch January 20, 2023 19:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants