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

feat: move Google config to installation_config #9482

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

scmmishra
Copy link
Member

This PR has the following changes

  1. Add GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET to installation config
  2. Add Google config to super_admin/features.yml
  3. Replace usage of ENV.fetch with GlobalConfigService.load for fetch client ID and Secret

Copy link

linear bot commented May 16, 2024

@scmmishra scmmishra changed the base branch from feature/cw-3285 to develop May 16, 2024 09:27
@scmmishra scmmishra changed the base branch from develop to feature/cw-3285 May 16, 2024 09:27
@scmmishra scmmishra marked this pull request as ready for review May 16, 2024 09:32
Base automatically changed from feature/cw-3285 to develop May 20, 2024 06:22
provider :google_oauth2, ENV.fetch('GOOGLE_OAUTH_CLIENT_ID', nil), ENV.fetch('GOOGLE_OAUTH_CLIENT_SECRET', nil), {
provider_ignores_state: true
}
client_id = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil)
Copy link
Member Author

Choose a reason for hiding this comment

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

@sojan-official getting the values from GlobalConfigService in this initializer, fails the CI test. You got ideas on how to fix this?

Copy link
Member Author

Choose a reason for hiding this comment

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

P.S. Using this branch to test, #9504
I have removed the yarn step to speed up the CI

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a possible solution here: https://github.com/chatwoot/chatwoot/pull/9504/files#diff-84ed1be2c135a8c628a3fb258e88c059ae24b3cb90abce9b5a5f74e96eb5c7ee

Not sure if it feels right. While the DB exists, the rescue case will not run. That means in production this will run as expected, while bypassing the issue in CI

LMK what you think @sojan-official

Copy link
Member Author

Choose a reason for hiding this comment

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

@pranavrajs @sojan-official here, the OmniAuth::Builder does a lot more than just setting up the client, it also creates a Rack middleware stack by using the use method inherited from Rack::Builder. ref

Removing this seems non-trivial

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
Member Author

Choose a reason for hiding this comment

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

I might have figured this one out, testing on staging

Copy link
Member Author

Choose a reason for hiding this comment

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

@sojan-official this is resolved, PTAL

Copy link
Member Author

Choose a reason for hiding this comment

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

False alarm, still figuring this out

Copy link
Member Author

Choose a reason for hiding this comment

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

omniauth/omniauth#1077

Seems like there's no way to do this, @sojan-official can you give this a shot?

Copy link
Member

Choose a reason for hiding this comment

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

will take this forward

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.

None yet

2 participants