Skip to content
Draft
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ and this project adheres to

### Added

- Demo OAuth clients for Google (Drive, Sheets, Gmail), Salesforce (production
and sandbox), and Microsoft (SharePoint, Outlook, Calendar, OneDrive, Teams)
are now created during demo setup with configurable credentials via
environment variables

### Changed

### Fixed
Expand Down
46 changes: 46 additions & 0 deletions lib/lightning/config/bootstrap.ex
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ defmodule Lightning.Config.Bootstrap do
"lightning-cluster"
)

setup_demo_oauth_clients()

# ==============================================================================

setup_storage()
Expand Down Expand Up @@ -900,4 +902,48 @@ defmodule Lightning.Config.Bootstrap do
value -> value
end
end

defp setup_demo_oauth_clients do
config :lightning, :demo_oauth_clients,
google_drive: [
client_id: env!("GOOGLE_DRIVE_CLIENT_ID", :string, nil),
client_secret: env!("GOOGLE_DRIVE_CLIENT_SECRET", :string, nil)
],
google_sheets: [
client_id: env!("GOOGLE_SHEETS_CLIENT_ID", :string, nil),
client_secret: env!("GOOGLE_SHEETS_CLIENT_SECRET", :string, nil)
],
gmail: [
client_id: env!("GMAIL_CLIENT_ID", :string, nil),
client_secret: env!("GMAIL_CLIENT_SECRET", :string, nil)
],
salesforce: [
client_id: env!("SALESFORCE_CLIENT_ID", :string, nil),
client_secret: env!("SALESFORCE_CLIENT_SECRET", :string, nil)
],
salesforce_sandbox: [
client_id: env!("SALESFORCE_SANDBOX_CLIENT_ID", :string, nil),
client_secret: env!("SALESFORCE_SANDBOX_CLIENT_SECRET", :string, nil)
],
microsoft_sharepoint: [
client_id: env!("MICROSOFT_SHAREPOINT_CLIENT_ID", :string, nil),
client_secret: env!("MICROSOFT_SHAREPOINT_CLIENT_SECRET", :string, nil)
],
microsoft_outlook: [
client_id: env!("MICROSOFT_OUTLOOK_CLIENT_ID", :string, nil),
client_secret: env!("MICROSOFT_OUTLOOK_CLIENT_SECRET", :string, nil)
],
microsoft_calendar: [
client_id: env!("MICROSOFT_CALENDAR_CLIENT_ID", :string, nil),
client_secret: env!("MICROSOFT_CALENDAR_CLIENT_SECRET", :string, nil)
],
microsoft_onedrive: [
client_id: env!("MICROSOFT_ONEDRIVE_CLIENT_ID", :string, nil),
client_secret: env!("MICROSOFT_ONEDRIVE_CLIENT_SECRET", :string, nil)
],
microsoft_teams: [
client_id: env!("MICROSOFT_TEAMS_CLIENT_ID", :string, nil),
client_secret: env!("MICROSOFT_TEAMS_CLIENT_SECRET", :string, nil)
]
end
end
Loading