Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for loading FLOWER_OAUTH2_SECRET as a secret #1249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion flower/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,15 @@ def extract_settings():
settings[name] = prepend_url(settings[name], options.url_prefix)

if options.auth:
oauth2_secret_file = os.environ.get("FLOWER_OAUTH2_SECRET_FILE", "")
oauth2_secret = (
options.oauth2_secret or os.environ.get("FLOWER_OAUTH2_SECRET")
if not oauth2_secret_file
else open(oauth2_secret_file, "r").readline()
)
settings['oauth'] = {
'key': options.oauth2_key or os.environ.get('FLOWER_OAUTH2_KEY'),
'secret': options.oauth2_secret or os.environ.get('FLOWER_OAUTH2_SECRET'),
'secret': oauth2_secret,
'redirect_uri': options.oauth2_redirect_uri or os.environ.get('FLOWER_OAUTH2_REDIRECT_URI'),
}

Expand Down