Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Kubernetes / directory with mounted file style secrets (
streamlit#9078) ## Describe your changes Add Kubernetes/directory style secret support that will allow Streamlit secrets to be used with [Snowpark Container Services secret format](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/additional-considerations-services-jobs#using-snowflake-secrets-to-pass-credentials-to-a-container) which is based on [Kubernetes Secret](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume) In this format the secrets are expected to be placed under a directory (such as `/.streamlit/.secrets`) in the following ways: - user_pass_secret (folder) - username (file), content: myuser - password (file), content: mypassword - my_plain_secret (folder) - regular_secret (file), content: mysecret If there are multiple files in a folder they will be available as: ``` > st.secrets['user_pass_secret']['username'] myuser ``` if there's a single file in a folder it will be folded into the folder name such as: ``` > st.secrets['my_plain_secrets'] mysecret ``` Another feature added is the ability to customize the error messages by environment to have different messages when running inside Snowflake environment ## GitHub Issue Link (if applicable) ## Testing Plan - Explanation of why no additional tests are needed - Unit Tests (JS and/or Python) - E2E Tests - Any manual testing needed? --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.