-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #649 from snyk/feat/add-bearer-scheme-option-for-jira
feat: add jira bearer auth flavor
- Loading branch information
Showing
3 changed files
with
248 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# your unique broker identifier | ||
BROKER_TOKEN=<broker-token> | ||
|
||
# your personal password or API token to your Jira Server account | ||
JIRA_PAT=<jira-pat> | ||
|
||
# your Jira Server hostname, i.e. jira.yourdomain.com | ||
JIRA_HOSTNAME=jira.yourdomain.com | ||
|
||
# the url of your broker client (including scheme and port) | ||
# BROKER_CLIENT_URL= | ||
|
||
# Jira validation url, checked by broker client systemcheck endpoint | ||
BROKER_CLIENT_VALIDATION_URL=https://$JIRA_HOSTNAME/rest/api/2/myself | ||
|
||
# Jira Bearer auth creds | ||
BROKER_CLIENT_VALIDATION_AUTHORIZATION_HEADER="Bearer $JIRA_PAT" | ||
|
||
# The URL of the Snyk broker server | ||
BROKER_SERVER_URL=https://broker.snyk.io | ||
|
||
# the fine detail accept rules that allow Snyk to make API requests to your | ||
# Jira instance | ||
ACCEPT=accept.json | ||
|
||
# The path for the broker's internal healthcheck URL. Must start with a '/'. | ||
BROKER_HEALTHCHECK_PATH=/healthcheck |
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,137 @@ | ||
{ | ||
"public": | ||
[], | ||
"private": | ||
[ | ||
{ | ||
"//": "get jira server info", | ||
"method": "GET", | ||
"path": "/rest/api/2/serverInfo", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "identify user", | ||
"method": "GET", | ||
"path": "/rest/api/2/myself", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get a list of all Jira projects", | ||
"method": "GET", | ||
"path": "/rest/api/2/project", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
}, | ||
"valid": [ | ||
{ | ||
"queryParam": "expand", | ||
"values": [ | ||
"issueTypes" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"//": "used to get a Jira project", | ||
"method": "GET", | ||
"path": "/rest/api/2/project/:project", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get createmeta for a jira project & issueType", | ||
"method": "GET", | ||
"path": "/rest/api/2/issue/createmeta", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get createmeta for a jira project & issueType version 9 and above", | ||
"method": "GET", | ||
"path": "/rest/api/2/issue/createmeta/:project/issuetypes/:issue", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"username": "${JIRA_USERNAME}", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get issue type information for version 9 or above", | ||
"method": "GET", | ||
"path": "/rest/api/2/issuetype/:issuetype", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"username": "${JIRA_USERNAME}", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get jira issue", | ||
"method": "GET", | ||
"path": "/rest/api/2/issue/:issue", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to create jira issue", | ||
"method": "POST", | ||
"path": "/rest/api/2/issue", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to create jira issue link", | ||
"method": "POST", | ||
"path": "/rest/api/2/issue/:issue/remotelink", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get assignable users", | ||
"method": "GET", | ||
"path": "/rest/api/2/user/assignable/search", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
}, | ||
{ | ||
"//": "used to get available components", | ||
"method": "GET", | ||
"path": "/rest/api/2/project/:project/components", | ||
"origin": "https://${JIRA_HOSTNAME}", | ||
"auth": { | ||
"scheme": "bearer", | ||
"token": "${JIRA_PAT}" | ||
} | ||
} | ||
] | ||
} |