forked from calcom/cal.diy
-
Notifications
You must be signed in to change notification settings - Fork 1
Devin/oauth developer settings 1764693294 #4
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
Open
DhirenMhatre
wants to merge
104
commits into
main
Choose a base branch
from
devin/oauth-developer-settings-1764693294
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
104 commits
Select commit
Hold shift + click to select a range
5dc87b3
feat: add OAuth client developer settings page with approval workflow
devin-ai-integration[bot] c6c68d4
fix: re-export generateSecret for backward compatibility
devin-ai-integration[bot] a3f1bc9
feat: make logo mandatory and list items clickable for OAuth clients
devin-ai-integration[bot] b1b39a2
fix: add missing translation keys and remove client secret from detai…
devin-ai-integration[bot] 03c7d13
fix: address cubic AI reviewer comments
devin-ai-integration[bot] 582cef5
fix: address PR review comments - fix indentation and use useCopy hook
devin-ai-integration[bot] c3e0b70
fix: change react-dom/server import to fix Turbopack compatibility
devin-ai-integration[bot] c29dbb3
Revert "fix: change react-dom/server import to fix Turbopack compatib…
devin-ai-integration[bot] c5f13a5
fix: use email service pattern for OAuth client notifications
devin-ai-integration[bot] fc9d47c
fix: add try-catch around email sending to handle Turbopack react-dom…
devin-ai-integration[bot] 3804fe3
Revert "fix: add try-catch around email sending to handle Turbopack r…
devin-ai-integration[bot] 05172df
fix: improve OAuth client UI with skeleton loaders and smaller dialog…
devin-ai-integration[bot] dfd5bc2
fix: improve skeleton loader to match actual OAuth client list structure
devin-ai-integration[bot] 7500de8
fix skeleton
eunjae-lee a1d86ac
rename the selected oauth client dialog
eunjae-lee bc6f449
fix: address PR feedback - admin auth, dropdown styling, sidebar label
devin-ai-integration[bot] 523db2f
update common.json
eunjae-lee 661ffa7
feat: show client secret in approval email for confidential OAuth cli…
devin-ai-integration[bot] 5b0b738
feat: add Website URL field, fix logo styling, show client secret aft…
devin-ai-integration[bot] a05ffea
fix: move clientSecret variable declaration outside if block for prop…
devin-ai-integration[bot] 3fedda6
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 80dc2ed
refactor: dont expose client secret in emails
supalarry 50daba7
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 098ebcc
refactor: dont regenerate secret upon status change
supalarry c0a7c5f
refactor: reuse existing hash function
supalarry c384a37
refactor: rename admin/oAuth to admin/oauth page
supalarry 82274aa
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 93c2fd7
refactor: deduplicate oauth repositories
supalarry 8415ef0
refactor: remove withGlobalPrisma from oauth repository
supalarry 681f7a9
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry fa7458a
refactor: developer oauth page
supalarry d163a1d
refactor: oauth status by default accepted
supalarry cf5c4e3
refactor: request oauth status when creating
supalarry bb0af5b
refactor ux
supalarry 74b8174
fix: address Cubic AI code review feedback
devin-ai-integration[bot] 8652dbd
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry f6b3852
common.json file
supalarry daf04c4
refactor: delete all prisma migrations
supalarry 8ee1ee5
refactor: have just 1 prisma migration
supalarry f4cdd32
revert: some devin changes
supalarry 9b43e0a
fix: typecheck
supalarry db38f71
test: owner OAuth crud
supalarry a8d1688
test: admin OAuth approval / rejection
supalarry 953e930
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 44dbc67
fix: address Cubic AI review feedback (confidence 9/10 issues)
devin-ai-integration[bot] fe44f1f
cubic changes
ddaa111
refactor: dont log sensitive info and rethrow error
supalarry 91f1f1c
cubic feedback
supalarry 60fd4db
refactor: make oauth client purpose optional
supalarry 6691d50
refactor: admin/oauth not allowed if not logged in
supalarry 1a7453e
refactor: admin view skeleton
supalarry 2795286
refactor: rename state
supalarry 32d61ba
refactor: get rid of redundant mapping
supalarry d8ba093
refactor: remove redundant handler
supalarry 14d5d92
refactor: remove redundant handler
supalarry bc146ab
refactor: re-usable new oauth client button
supalarry e9e0018
refactor: dialogs
supalarry 100e0a1
refactor: modals
supalarry 44a0f67
refactor: handler names, dialog, skeleton
supalarry 350799d
fix: purpose being null
supalarry 44ce7bd
refactor: rename handler and delete old oauth admin page
supalarry bb0faa8
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry c958f96
fix: purpose in submission
supalarry 54ec8b9
refactor: handler names
supalarry 1c6f039
refactor: rename
supalarry b6ebb15
refactor: update handler
supalarry 52dc384
refactor: rename approvalStatus -> status
supalarry 47723a8
refactor: simplify modal
supalarry df18f3c
refactor: name
supalarry ec19534
dont require repproval if redirectUri changes
supalarry 1aa80b4
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 9457c40
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 6cc78d4
fix: remove integration sync index creation
supalarry a5c38be
refactor: require re-approval if redirectUri updated
supalarry 154eee1
fix: flaky e2e test
supalarry 83eccde
fix: flaky e2e test
supalarry b2888f4
fix: flaky e2e test
supalarry 0b03d23
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry ce0fb75
fix: remove duplicate common.json keys
supalarry 4a80d67
refactor: replace team@cal.com with SUPPORT_MAIL_ADDRESS
supalarry 1e5854b
refactor: generate client secret on handler level
supalarry e8b809d
fix: authorization code only available to approved clients
supalarry d13e24a
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry f3278bb
refactor: cubic review dont display exclamation
supalarry 0672df6
refactor: cubic review website_url in common json
supalarry 166f2f3
fix: dont default in ui to approved status
supalarry e7324fd
refactor: optiona logo in schema create handler
supalarry 34e5a52
fix: tests
supalarry f2da0c1
fix: tests
supalarry 78bc8c5
fix: /authorize redirect if client not approved or show error
supalarry ccd11a8
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry 102e5fe
test: authorize page with invalid client id
supalarry 6d527b5
refactor: dont allow refreshing tokens unless approved client
supalarry 80b02a5
fix: flaky e2e test
supalarry 6bcdbd8
fix: flaky e2e test
supalarry 6c6964c
fix: flaky e2e test
supalarry 56939be
fix: flaky e2e test
supalarry 8434fe8
fix: flaky e2e test
supalarry acecda3
fix: flaky e2e test
supalarry bcbd1e7
chore: warn that pending client is not usable
supalarry c761156
fix: approve and reject buttons
supalarry e22eeae
fix: /authorize show error if client not approved
supalarry c1e8b2e
refactor: info message about editing oauth client and status
supalarry 285ec1d
Merge branch 'main' into devin/oauth-developer-settings-1764693294
supalarry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 20 additions & 14 deletions
34
apps/web/app/(use-page-wrapper)/settings/(admin-layout)/admin/oAuth/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,31 @@ | ||
| import { _generateMetadata, getTranslate } from "app/_utils"; | ||
| import { cookies, headers } from "next/headers"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; | ||
| import { getServerSession } from "@calcom/features/auth/lib/getServerSession"; | ||
|
|
||
| import LegacyPage from "~/settings/admin/oauth-view"; | ||
| import { buildLegacyRequest } from "@lib/buildLegacyCtx"; | ||
|
|
||
| import OAuthClientsAdminView from "~/settings/admin/oauth-clients-admin-view"; | ||
|
|
||
| const Page = async () => { | ||
| const session = await getServerSession({ req: buildLegacyRequest(await headers(), await cookies()) }); | ||
| await getTranslate(); | ||
|
|
||
| if (!session) { | ||
| redirect("/auth/login?callbackUrl=/settings/admin/oauth"); | ||
| } | ||
|
|
||
| return <OAuthClientsAdminView />; | ||
| }; | ||
|
|
||
| export const generateMetadata = async () => | ||
| await _generateMetadata( | ||
| (t) => t("oAuth"), | ||
| (t) => t("admin_oAuth_description"), | ||
| (t) => t("oauth_clients_admin"), | ||
| (t) => t("oauth_clients_admin_description"), | ||
| undefined, | ||
| undefined, | ||
| "/settings/admin/oAuth" | ||
| "/settings/admin/oauth" | ||
| ); | ||
|
|
||
| const Page = async () => { | ||
| const t = await getTranslate(); | ||
| return ( | ||
| <SettingsHeader title={t("oAuth")} description={t("admin_oAuth_description")}> | ||
| <LegacyPage /> | ||
| </SettingsHeader> | ||
| ); | ||
| }; | ||
|
|
||
| export default Page; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
apps/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/oauth/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { _generateMetadata, getTranslate } from "app/_utils"; | ||
| import { cookies, headers } from "next/headers"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| import { getServerSession } from "@calcom/features/auth/lib/getServerSession"; | ||
|
|
||
| import { buildLegacyRequest } from "@lib/buildLegacyCtx"; | ||
|
|
||
| import OAuthClientsView from "~/settings/developer/oauth-clients-view"; | ||
|
|
||
| export const generateMetadata = async () => | ||
| await _generateMetadata( | ||
| (t) => t("oauth_clients"), | ||
| (t) => t("oauth_clients_description"), | ||
| undefined, | ||
| undefined, | ||
| "/settings/developer/oauth" | ||
| ); | ||
|
|
||
| const Page = async () => { | ||
| const session = await getServerSession({ req: buildLegacyRequest(await headers(), await cookies()) }); | ||
| const t = await getTranslate(); | ||
|
|
||
| if (!session) { | ||
| redirect("/auth/login?callbackUrl=/settings/developer/oauth"); | ||
| } | ||
|
|
||
| return ( | ||
| <OAuthClientsView /> | ||
| ); | ||
| }; | ||
|
|
||
| export default Page; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client lookup now requires
redirect_uriand bails out unless it is present (enabled: status === "authenticated" && !!redirect_uri), but the later success/error redirects still assumeclient.redirectUriexists and build a URL from it. Ifredirect_uriis missing or malformed in the incoming authorize request, the page no longer loads the client and the user is left on a blank screen instead of being redirected or shown a clear error. For example, an authorize link withoutredirect_urinow never reaches the OAuth client fetch that used to run.Suggested fix
{ clientId: client_id as string, redirectUri: redirect_uri, }, { enabled: status === "authenticated", }Prompt for AI assistance
Copy the prompt below and paste it into ChatGPT, Claude, or any LLM: