-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: Add support for PagerDuty app (#1790)
Added PagerDuty OAuthAppType to exclude sending Basic Auth creds. Added PagerDuty OAuthApp default settings. Added PagerDuty OAuthApp setup. Signed-off-by: Bill Maxwell <[email protected]>
- Loading branch information
1 parent
877fb77
commit 36385e3
Showing
8 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,80 @@ | ||
import { z } from "zod"; | ||
|
||
import { | ||
OAuthAppSpec, | ||
OAuthFormStep, | ||
getOAuthLinks, | ||
} from "~/lib/model/oauthApps/oauth-helpers"; | ||
import { assetUrl } from "~/lib/utils"; | ||
|
||
const schema = z.object({ | ||
clientID: z.string().min(1, "Client ID is required"), | ||
clientSecret: z.string().min(1, "Client Secret is required"), | ||
}); | ||
|
||
const steps: OAuthFormStep<typeof schema.shape>[] = [ | ||
{ | ||
type: "markdown", | ||
text: | ||
"### Step 1: Access PagerDuty Integrations\n" + | ||
"- Log in to your PagerDuty account\n" + | ||
"- Click on 'Integrations' in the top navigation\n" + | ||
"- Select 'App Registration' from the dropdown menu\n" + | ||
"- Click '+ New App'", | ||
}, | ||
{ | ||
type: "markdown", | ||
text: | ||
"### Step 2: Create OAuth App\n" + | ||
"- Fill in the app details:\n" + | ||
" - Name: Choose a name for your integration (e.g., 'Obot')\n" + | ||
" - Description: Brief description of how you'll use Obot\n" + | ||
"- Under 'Authentication Type', select 'OAuth 2.0'\n" + | ||
"- Click 'Next'", | ||
}, | ||
{ | ||
type: "copy", | ||
text: getOAuthLinks("pagerduty").redirectURL, | ||
}, | ||
{ | ||
type: "markdown", | ||
text: | ||
"### Step 3: Configure OAuth Settings\n" + | ||
"- In the OAuth Configuration section:\n" + | ||
"- Copy and paste your Obot redirect URL (shown above) into the 'Redirect URLs' field\n" + | ||
"- Select the following required scopes:\n" + | ||
" - incidents.read\n" + | ||
" - incidents.write\n" + | ||
" - users.read\n" + | ||
"- Click 'Register App'", | ||
}, | ||
{ | ||
type: "markdown", | ||
text: | ||
"### Step 4: Get Your App Credentials\n" + | ||
"- After saving, you'll see your app's 'OAuth 2.0 Client Information'\n" + | ||
"- Copy the 'Client ID' and 'Client Secret'\n" + | ||
"- Enter these values in the fields below\n" + | ||
"- Download the 'Client Credentials' file and save it in a secure location", | ||
}, | ||
{ | ||
type: "input", | ||
input: "clientID", | ||
label: "Client ID", | ||
}, | ||
{ | ||
type: "input", | ||
input: "clientSecret", | ||
label: "Client Secret", | ||
inputType: "password", | ||
}, | ||
]; | ||
|
||
export const PagerDutyOAuthApp = { | ||
schema, | ||
alias: "pagerduty", | ||
type: "pagerduty", | ||
displayName: "PagerDuty", | ||
logo: assetUrl("/assets/pagerduty_logo.svg"), | ||
steps: steps, | ||
} satisfies OAuthAppSpec; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.