Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Add Cookie root domain env variable to Dashboard #633

Merged
merged 1 commit into from
May 11, 2020

Conversation

Waterdrips
Copy link
Contributor

Description

Somewhere along the line the cookie_root_domain was missed from the
dashboard config. This only needs to be set when using OAuth, to remove
a users token from their cookie. This was not set and therefore caused
us to try and set the cookie domain to "undefined"

Signed-off-by: Alistair Hey alistair@heyal.co.uk
Fixes #632

How Has This Been Tested?

This has been tested by adding the env to the Dashboard deployment and
hitting logout on an OAuth enabled installation. This now sets the
correct cookie domain and removes the existing token

How are existing users impacted? What migration steps/scripts do we need?

This is a bugfix, users will need to edit their dashboard deployment to add this environment variable

kubectl edit deploy -n openfaas-fn system-dashboard

and add the following to the environment variables section:
(example where your openfaas root domain is "example.com"

        - name: cookie_root_domain
          value: .system.example.com

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

This will also need amending in ofc-bootstrap to propagate this change

Somewhere along the line the cookie_root_domain was missed from the
dashboard config. This only needs to be set when using OAuth, to remove
a users token from their cookie. This was not set and therefore caused
us to try and set the cookie domain to "undefined"

This has been tested by adding the env to the Dashboard deployment and
hitting logout on an OAuth enabled installation. This now sets the
correct cookie domain and removes the existing token

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
@Waterdrips Waterdrips mentioned this pull request Apr 26, 2020
5 tasks
query_pretty_url: 'true'
# Cookie root domain, set is using OAuth, used to remove a user's cookie
cookie_root_domain: 'system.o6s.io'
Copy link
Member

Choose a reason for hiding this comment

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

This is templated, so wouldn't this need to be changed in ofc-bootstrap rather than here?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, it will need changing there. The ones in that yaml looked like "example" settings so I added there for future reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexellis
Copy link
Member

Happy to merge, but wouldn't this need to be changed in ofc-bootstrap?

@alexellis alexellis merged commit 86de83c into openfaas:master May 11, 2020
@Waterdrips Waterdrips deleted the fix-cookie-root-domain branch July 16, 2020 06:40
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.

Bug - Logout button not removing a user's cookie
2 participants