diff --git a/charmcraft/extensions/app.py b/charmcraft/extensions/app.py index 6e58bf854..7421f6447 100644 --- a/charmcraft/extensions/app.py +++ b/charmcraft/extensions/app.py @@ -241,6 +241,13 @@ class FlaskFramework(_AppBase): "type": "string", "description": "The secret key used for securely signing the session cookie and for any other security related needs by your Flask application. This configuration will set the FLASK_SECRET_KEY environment variable. Run `app.config.from_prefixed_env()` in your Flask application in order to receive this configuration.", }, + "flask-secret-key-id": { + "type": "secret", + "description": "This configuration is similar to `flask-secret-key`, but instead accepts a Juju user secret ID. " + 'The secret should contain a single key, "value", which maps to the actual Flask secret key. ' + "To create the secret, run the following command: `juju add-secret my-flask-secret-key value= && juju grant-secret my-flask-secret-key flask-k8s`, " + "and use the output secret ID to configure this option.", + }, "flask-session-cookie-secure": { "type": "boolean", "description": "Set the secure attribute in the Flask application cookies. This configuration will set the FLASK_SESSION_COOKIE_SECURE environment variable. Run `app.config.from_prefixed_env()` in your Flask application in order to receive this configuration.", @@ -277,6 +284,13 @@ class DjangoFramework(_AppBase): "type": "string", "description": "The secret key used for securely signing the session cookie and for any other security related needs by your Django application. This configuration will set the DJANGO_SECRET_KEY environment variable.", }, + "django-secret-key-id": { + "type": "secret", + "description": "This configuration is similar to `django-secret-key`, but instead accepts a Juju user secret ID. " + 'The secret should contain a single key, "value", which maps to the actual Django secret key. ' + "To create the secret, run the following command: `juju add-secret my-django-secret-key value= && juju grant-secret my-django-secret-key django-k8s`, " + "and use the output secret ID to configure this option.", + }, "django-allowed-hosts": { "type": "string", "description": "A comma-separated list of host/domain names that this Django site can serve. This configuration will set the DJANGO_ALLOWED_HOSTS environment variable with its content being a JSON encoded list.", @@ -314,6 +328,13 @@ class GoFramework(_AppBase): "type": "string", "description": "Long secret you can use for sessions, csrf or any other thing where you need a random secret shared by all units", }, + "app-secret-key-id": { + "type": "secret", + "description": "This configuration is similar to `app-secret-key`, but instead accepts a Juju user secret ID. " + 'The secret should contain a single key, "value", which maps to the actual application secret key. ' + "To create the secret, run the following command: `juju add-secret my-app-secret-key value= && juju grant-secret my-app-secret-key go-app`, " + "and use the output secret ID to configure this option.", + }, } @staticmethod @@ -367,6 +388,13 @@ class FastAPIFramework(_AppBase): "type": "string", "description": "Long secret you can use for sessions, csrf or any other thing where you need a random secret shared by all units", }, + "app-secret-key-id": { + "type": "secret", + "description": "This configuration is similar to `app-secret-key`, but instead accepts a Juju user secret ID. " + 'The secret should contain a single key, "value", which maps to the actual application secret key. ' + "To create the secret, run the following command: `juju add-secret my-app-secret-key value= && juju grant-secret my-app-secret-key fastapi-app`, " + "and use the output secret ID to configure this option.", + }, } @staticmethod