Skip to content

Fix pass api key#11

Closed
Jun Aishima (JunAishima) wants to merge 27 commits intoNSLS2:mainfrom
JunAishima:fix-pass-api-key
Closed

Fix pass api key#11
Jun Aishima (JunAishima) wants to merge 27 commits intoNSLS2:mainfrom
JunAishima:fix-pass-api-key

Conversation

@JunAishima
Copy link
Copy Markdown
Contributor

@JunAishima Jun Aishima (JunAishima) commented Apr 3, 2026

I noticed yesterday that the Tiled API key which is passed around the functions is visible on Prefect Cloud when the workflow is run in production.

This fix will ensure the Tiled API key is only read from the environment file right where it is used so that it is not passed around.

The Tiled API key used in the end_of_run_workflow() function is currently only used when testing, either CI or local interactive testing. In these cases, Prefect Cloud will not store the parameters used to call the functions, so the API key will never get exposed.

Note that this PR also includes the dotenv change.

 * already included in lock file, so no update necessary
 * read TILED_API_KEY in from env.secrets
 * corresponding changes in prefect3_worker role
 * include possibility of calling with API key value to
   better enable local testing of workflows
 * publish-ghcr and the deploy file had the local branch
   name to use for testing. change those to main for prod
 * enable running on hosts without access to our filesystems, such
   as Github action-based CI
 * remove dry_run from reading functions
 * make get_run() function and use it where
   Tiled clients are required
 * remove redundant utils module
 * no need to import it from end_of_run_workflow()
@JunAishima
Copy link
Copy Markdown
Contributor Author

closing as the key change is now incorporated in #7

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.

1 participant