Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 3c91e22

Browse files
committed
github enterprise in progress (but mostly done)
1 parent 983b9f1 commit 3c91e22

File tree

18 files changed

+31
-3
lines changed

18 files changed

+31
-3
lines changed

api_server/lib/oauth2/oauth2_module.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,11 @@ class OAuth2Module extends APIServerModule {
277277
const instances = {};
278278
if (this.oauthConfig.host && (this.apiConfig.appClientId || this.apiConfig.apiKey)) {
279279
const host = this.oauthConfig.host.toLowerCase();
280+
const apiHost = this.oauthConfig.apiHost.toLowerCase();
280281
instances[host] = {
281282
public: true,
282283
host,
284+
apiHost,
283285
hasIssues: this.oauthConfig.hasIssues
284286
};
285287
}

api_server/modules/asana_auth/asana_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'asana',
99
host: 'app.asana.com',
10+
apiHost: 'app.asana.com',
1011
authPath: '-/oauth_authorize',
1112
tokenPath: '-/oauth_token',
1213
exchangeFormat: 'form',

api_server/modules/bitbucket_auth/bitbucket_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'bitbucket',
99
host: 'bitbucket.org',
10+
apiHost: 'api.bitbucket.org/2.0',
1011
authPath: 'site/oauth2/authorize',
1112
tokenPath: 'site/oauth2/access_token',
1213
exchangeFormat: 'form',

api_server/modules/codemarks/codemark_attributes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ module.exports = {
102102
maxLength: 25,
103103
description: 'External provider for this codemark (eg. github, trello)'
104104
},
105+
externalProviderHost: {
106+
type: 'string',
107+
maxLength: 200,
108+
description: 'Host of the external provider, which may be an enterprise installation'
109+
},
105110
externalProviderUrl: {
106111
type: 'string',
107112
maxLength: 1000,

api_server/modules/codemarks/codemark_creator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CodemarkCreator extends ModelCreator {
7171
string: ['teamId', 'type']
7272
},
7373
optional: {
74-
string: ['postId', 'streamId', 'parentPostId', 'providerType', 'status', 'color', 'title', 'text', 'externalProvider', 'externalProviderUrl'],
74+
string: ['postId', 'streamId', 'parentPostId', 'providerType', 'status', 'color', 'title', 'text', 'externalProvider', 'externalProviderHost', 'externalProviderUrl'],
7575
object: ['remoteCodeUrl', 'threadUrl'],
7676
'array(object)': ['markers', 'externalAssignees'],
7777
'array(string)': ['assignees'],

api_server/modules/codemarks/post_codemark_request.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ class PostCodemarkRequest extends PostRequest {
124124
'title': '<Title of the codemark>',
125125
'assignees': '<Array of IDs representing users assigned to the codemark, for issues>',
126126
'markers': '<Array of @@#marker objects#marker@@ representing markers to be created for this codemark>',
127-
'externalProvider': '<For externally linked issues, the name of the provider servier (eg. jira, asana)>',
127+
'externalProvider': '<For externally linked issues, the name of the provider service (eg. jira, asana)>',
128+
'externalProviderHost': '<For externally linked issues, the host to the provdier service, which may be an enterprise installation>',
128129
'externalProviderUrl': '<For externally linked issues, the URL to access the issue>',
129130
'externalAssignees': '<For externally linked issues, array of assignees to the issue, expected to be objects with at least displayName>',
130131
'remoteCodeUrl': '<Object referencing a link to the code block references by this codemark in an external provider, contains "name" and "url">',

api_server/modules/github_auth/github_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'github',
99
host: 'github.com',
10+
apiHost: 'api.github.com',
1011
authPath: 'login/oauth/authorize',
1112
tokenPath: 'login/oauth/access_token',
1213
exchangeFormat: 'query',

api_server/modules/gitlab_auth/gitlab_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'gitlab',
99
host: 'gitlab.com',
10+
apiHost: 'gitlab.com/api/v4',
1011
authPath: 'oauth/authorize',
1112
tokenPath: 'oauth/token',
1213
exchangeFormat: 'query',

api_server/modules/glip_auth/glip_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'glip',
99
host: 'api.ringcentral.com',
10+
apiHost: 'api.ringcentral.com',
1011
authPath: 'restapi/oauth/authorize',
1112
tokenPath: 'restapi/oauth/token',
1213
exchangeFormat: 'form',

api_server/modules/jira_auth/jira_auth.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OAuth2Module = require(process.env.CS_API_TOP + '/lib/oauth2/oauth2_module
77
const OAUTH_CONFIG = {
88
provider: 'jira',
99
host: 'auth.atlassian.com',
10+
apiHost: 'api.atlassian.com',
1011
authPath: 'authorize',
1112
tokenPath: 'oauth/token',
1213
exchangeFormat: 'json',

0 commit comments

Comments
 (0)